summaryrefslogtreecommitdiffstats
path: root/services/jni/com_android_server_InputApplicationHandle.h
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-01-10 11:17:36 -0800
committerJeff Brown <jeffbrown@google.com>2011-01-10 17:23:05 -0800
commit928e054931d357326613c78e62f4d850b7c442ff (patch)
tree28367a3b3d9b11f31a97c9016ab64e22f05c4c47 /services/jni/com_android_server_InputApplicationHandle.h
parentb3fbd7e0fd44a72fb7ccba0959481b8a806608b7 (diff)
downloadframeworks_base-928e054931d357326613c78e62f4d850b7c442ff.zip
frameworks_base-928e054931d357326613c78e62f4d850b7c442ff.tar.gz
frameworks_base-928e054931d357326613c78e62f4d850b7c442ff.tar.bz2
Prevent events from getting backlogged.
This change implements two heuristics. 1. When events are older than 10 seconds, they are dropped. 2. If the application is currently busy processing an event and the user touches a window belonging to a different application then we drop the currently queued events so the other application can start processing the gesture immediately. Note that the system takes care of synthesizing cancelation events automatically for any events that it drops. Added some new handle types to allow the native dispatcher to indirectly refer to the WindowManager's window state and app window token. This was done to enable the dispatcher to identify the application to which each window belongs but it also eliminates some lookup tables and linear searches through the window list on each key press. Bug: 3224911 Change-Id: I9dae8dfe23d195d76865f97011fe2f1d351e2940
Diffstat (limited to 'services/jni/com_android_server_InputApplicationHandle.h')
-rw-r--r--services/jni/com_android_server_InputApplicationHandle.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/services/jni/com_android_server_InputApplicationHandle.h b/services/jni/com_android_server_InputApplicationHandle.h
new file mode 100644
index 0000000..9d18721
--- /dev/null
+++ b/services/jni/com_android_server_InputApplicationHandle.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ANDROID_SERVER_INPUT_APPLICATION_HANDLE_H
+#define _ANDROID_SERVER_INPUT_APPLICATION_HANDLE_H
+
+#include <input/InputApplication.h>
+
+#include "JNIHelp.h"
+#include "jni.h"
+
+namespace android {
+
+class NativeInputApplicationHandle : public InputApplicationHandle {
+public:
+ NativeInputApplicationHandle(jweak objWeak);
+ virtual ~NativeInputApplicationHandle();
+
+ jobject getInputApplicationHandleObjLocalRef(JNIEnv* env);
+
+private:
+ jweak mObjWeak;
+};
+
+
+extern sp<InputApplicationHandle> android_server_InputApplicationHandle_getHandle(
+ JNIEnv* env, jobject inputApplicationHandleObj);
+
+} // namespace android
+
+#endif // _ANDROID_SERVER_INPUT_APPLICATION_HANDLE_H