summaryrefslogtreecommitdiffstats
path: root/services/jni/com_android_server_InputApplicationHandle.h
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-07-13 22:51:29 -0700
committerJeff Brown <jeffbrown@google.com>2011-07-14 04:11:21 -0700
commit9302c8796fc4dcda08d4bd1e11733848fd4fafaf (patch)
tree1008e3db6ba1eb6ee02b7bf8c4a648a13a0b741d /services/jni/com_android_server_InputApplicationHandle.h
parent14fcf900ce65e5c8c952c95ee12041f8de16fbb7 (diff)
downloadframeworks_base-9302c8796fc4dcda08d4bd1e11733848fd4fafaf.zip
frameworks_base-9302c8796fc4dcda08d4bd1e11733848fd4fafaf.tar.gz
frameworks_base-9302c8796fc4dcda08d4bd1e11733848fd4fafaf.tar.bz2
Refactor input dispatcher use of window/app handles.
This change moves the cached window and application input state into the handle objects themselves. It simplifies the dispatcher somewhat because it no longer needs to fix up references to transient InputWindow objects each time the window list is updated. This change will also make it easier to optimize setInputWindows to avoid doing a lot of redundant data copying. In principle, only the modified fields need to be updated. However, for now we continue to update all fields in unison as before. It turns out that the input dispatcher was inappropriately retaining pointers to InputWindow objects within the mWindows InputWindow vector. This vector is copy-on-write so it is possible and the item pointers to change if an editing operation is performed on the vector when it does not exclusively own the underlying SharedBuffer. This bug was uncovered by a previous change that replaced calls to clear() and appendVector() with a simple use of operator= which caused the buffer to be shared. Consequently after editItemAt was called (which it shouldn't have, actually) the buffer was copied and the cached InputWindow pointers became invalid. Oops. This change fixes the problem. Change-Id: I0a259339a6015fcf9113dc4081a6875e047fd425
Diffstat (limited to 'services/jni/com_android_server_InputApplicationHandle.h')
-rw-r--r--services/jni/com_android_server_InputApplicationHandle.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/jni/com_android_server_InputApplicationHandle.h b/services/jni/com_android_server_InputApplicationHandle.h
index 9d18721..04cd9d6 100644
--- a/services/jni/com_android_server_InputApplicationHandle.h
+++ b/services/jni/com_android_server_InputApplicationHandle.h
@@ -31,6 +31,8 @@ public:
jobject getInputApplicationHandleObjLocalRef(JNIEnv* env);
+ virtual bool update();
+
private:
jweak mObjWeak;
};