InputWindow: use read/writeStrongBinder
Still storing binder locally as a weak binder, but the plan is to remove
read/writeWeakBinder APIs. This is because weak binders can't be
promoted unless there is already a strong binder in a given process.
Bug: 137785053
Test: atest libgui_tests libinput_tests
Before and after:
libgui_test: Passed: 202, Failed: 1, Ignored: 0, Assumption Failed: 0
libinput_tests: Passed: 74, Failed: 0, Ignored: 0, Assumption Failed: 0
The ToT failure is:
[133/203] SurfaceTest#GetHdrSupport: FAILED (6ms)
Change-Id: I4e952672885a035174152286c529d82f55d48326
diff --git a/libs/input/InputWindow.cpp b/libs/input/InputWindow.cpp
index 5a60347..ec28757 100644
--- a/libs/input/InputWindow.cpp
+++ b/libs/input/InputWindow.cpp
@@ -99,7 +99,7 @@
applicationInfo.write(output);
output.write(touchableRegion);
output.writeBool(replaceTouchableRegionWithCrop);
- output.writeWeakBinder(touchableRegionCropHandle);
+ output.writeStrongBinder(touchableRegionCropHandle.promote());
return OK;
}
@@ -142,7 +142,7 @@
ret.applicationInfo = InputApplicationInfo::read(from);
from.read(ret.touchableRegion);
ret.replaceTouchableRegionWithCrop = from.readBool();
- ret.touchableRegionCropHandle = from.readWeakBinder();
+ ret.touchableRegionCropHandle = from.readStrongBinder();
return ret;
}