From 740167f1a2b5a141debb0efc952eb4e57152bdd4 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 11 Oct 2018 19:03:41 -0700 Subject: 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 --- include/input/InputWindow.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/input/InputWindow.h') diff --git a/include/input/InputWindow.h b/include/input/InputWindow.h index 6164aa6f09..1a46825692 100644 --- a/include/input/InputWindow.h +++ b/include/input/InputWindow.h @@ -138,6 +138,7 @@ struct InputWindowInfo { int32_t ownerUid; int32_t inputFeatures; int32_t displayId; + InputApplicationInfo applicationInfo; void addTouchableRegion(const Rect& region); @@ -168,7 +169,6 @@ struct InputWindowInfo { */ class InputWindowHandle : public RefBase { public: - const sp inputApplicationHandle; inline const InputWindowInfo* getInfo() const { return &mInfo; @@ -176,6 +176,10 @@ public: sp getToken() const; + sp getApplicationToken() { + return mInfo.applicationInfo.token; + } + inline std::string getName() const { return mInfo.token ? mInfo.name : ""; } @@ -202,7 +206,7 @@ public: void releaseChannel(); protected: - explicit InputWindowHandle(const sp& inputApplicationHandle); + explicit InputWindowHandle(); virtual ~InputWindowHandle(); InputWindowInfo mInfo; -- cgit v1.2.3-59-g8ed1b