• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.view;
18 
19 /**
20  * An input queue provides a mechanism for an application to receive incoming
21  * input events.  Currently only usable from native code.
22  */
23 public final class InputQueue {
24     /**
25      * Interface to receive notification of when an InputQueue is associated
26      * and dissociated with a thread.
27      */
28     public static interface Callback {
29         /**
30          * Called when the given InputQueue is now associated with the
31          * thread making this call, so it can start receiving events from it.
32          */
onInputQueueCreated(InputQueue queue)33         void onInputQueueCreated(InputQueue queue);
34 
35         /**
36          * Called when the given InputQueue is no longer associated with
37          * the thread and thus not dispatching events.
38          */
onInputQueueDestroyed(InputQueue queue)39         void onInputQueueDestroyed(InputQueue queue);
40     }
41 
42     final InputChannel mChannel;
43 
44     /** @hide */
InputQueue(InputChannel channel)45     public InputQueue(InputChannel channel) {
46         mChannel = channel;
47     }
48 
49     /** @hide */
getInputChannel()50     public InputChannel getInputChannel() {
51         return mChannel;
52     }
53 }
54