Rework InputApplicationInfo
First we move it inside of InputWindowInfo instead of InputWindowHandle
so it is part of the data sent across binder. Second we give it a persistent
identity of an IBinder token and use this for comparisons.
Bug: 80101428
Bug: 113136004
Bug: 111440400
Test: EndToEndNativeInputTest. Existing tests pass.
Change-Id: Id89a40e66887d834020f8e645fd1fb48adb7ee2e
diff --git a/include/input/InputWindow.h b/include/input/InputWindow.h
index 6164aa6..1a46825 100644
--- a/include/input/InputWindow.h
+++ b/include/input/InputWindow.h
@@ -138,6 +138,7 @@
int32_t ownerUid;
int32_t inputFeatures;
int32_t displayId;
+ InputApplicationInfo applicationInfo;
void addTouchableRegion(const Rect& region);
@@ -168,7 +169,6 @@
*/
class InputWindowHandle : public RefBase {
public:
- const sp<InputApplicationHandle> inputApplicationHandle;
inline const InputWindowInfo* getInfo() const {
return &mInfo;
@@ -176,6 +176,10 @@
sp<IBinder> getToken() const;
+ sp<IBinder> getApplicationToken() {
+ return mInfo.applicationInfo.token;
+ }
+
inline std::string getName() const {
return mInfo.token ? mInfo.name : "<invalid>";
}
@@ -202,7 +206,7 @@
void releaseChannel();
protected:
- explicit InputWindowHandle(const sp<InputApplicationHandle>& inputApplicationHandle);
+ explicit InputWindowHandle();
virtual ~InputWindowHandle();
InputWindowInfo mInfo;