1791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell/*
2791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * Copyright (C) 2013 The Android Open Source Project
3791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell *
4791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * Licensed under the Apache License, Version 2.0 (the "License");
5791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * you may not use this file except in compliance with the License.
6791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * You may obtain a copy of the License at
7791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell *
8791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell *      http://www.apache.org/licenses/LICENSE-2.0
9791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell *
10791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * Unless required by applicable law or agreed to in writing, software
11791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * distributed under the License is distributed on an "AS IS" BASIS,
12791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * See the License for the specific language governing permissions and
14791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell * limitations under the License.
15791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell */
16791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell
17791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell
18791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powellpackage android.support.v4.view;
19791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell
20791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powellimport android.view.KeyEvent;
21d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackbornimport android.view.View;
22791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell
23791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powellclass KeyEventCompatEclair {
24d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn    public static Object getKeyDispatcherState(View view) {
25d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn        return view.getKeyDispatcherState();
26d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn    }
27d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn
28d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn    public static boolean dispatch(KeyEvent event, KeyEvent.Callback receiver, Object state,
29d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn                Object target) {
30d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn        return event.dispatch(receiver, (KeyEvent.DispatcherState)state, target);
31d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn    }
32d3a70800e5f2cc2855d53ebea82fb7568affe02aDianne Hackborn
33791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell    public static void startTracking(KeyEvent event) {
34791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell        event.startTracking();
35791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell    }
36791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell
37791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell    public static boolean isTracking(KeyEvent event) {
38791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell        return event.isTracking();
39791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell    }
40791f31bbba40b8b51694a1b2cdc804f360786ed1Adam Powell}
41