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/libs/input/InputWindow.cpp b/libs/input/InputWindow.cpp
index 96646dc..b1d9d6a 100644
--- a/libs/input/InputWindow.cpp
+++ b/libs/input/InputWindow.cpp
@@ -92,6 +92,7 @@
     output.writeInt32(ownerUid);
     output.writeInt32(inputFeatures);
     output.writeInt32(displayId);
+    applicationInfo.write(output);
     output.write(touchableRegion);
 
     return OK;
@@ -129,6 +130,7 @@
     ret.ownerUid = from.readInt32();
     ret.inputFeatures = from.readInt32();
     ret.displayId = from.readInt32();
+    ret.applicationInfo = InputApplicationInfo::read(from);
     from.read(ret.touchableRegion);
 
     return ret;
@@ -140,8 +142,7 @@
 
 // --- InputWindowHandle ---
 
-InputWindowHandle::InputWindowHandle(const sp<InputApplicationHandle>& inputApplicationHandle) :
-    inputApplicationHandle(inputApplicationHandle) {
+InputWindowHandle::InputWindowHandle() {
 }
 
 InputWindowHandle::~InputWindowHandle() {