summaryrefslogtreecommitdiff
path: root/core/java/android/view/InputApplicationHandle.java
Commit message (Collapse)AuthorAgeFilesLines
* Reduce unnecessary invocation of setInputWindowInfoRiddle Hsu2020-11-021-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usually most fields of InputWindowHandle don't change frequently. Therefore, only the changed instances need to be updated. That reduces the overhead of JNI invocation (especially NativeInputWindowHandle::updateInfo which may be called from setInputWindowInfo). There should be no behavior change. - Add a InputWindowHandle.ChangeDetectionWrapper to wrap the original handle. So the changes of its fields can be tracked. - Make InputApplicationHandle java side immutable. Its content should be rarely changed. Then it is easier to compare by instance. This might also reduces the race condition of accessing its field from InputDispatcher because the instance is different. - Move some fields that won't change of InputWindowHandle to the constructor of WindowState to reduce unnecessary updates. - When a window cannot receive input, reuse the per-window input window handle to populate the disabled info, so there won't be a shared instance that its fields always need to be updated. - Reduce unnecessary Region#translate if the offsets are zero. - For a simple activity launch, the invocation amount of setInputWindowInfo is reduced 90% (from 126 to 11). - The metrics updateInputWindows_mean of WmPerfTests is reduced 50%+ (from 0.89ms to 0.38ms on an old mid-end device). Bug: 168008622 Test: WindowStateTests#testUpdateInputWindowHandle WindowInputTests InternalWindowOperationPerfTest Change-Id: Ief84bbe6e6fa4da5309912059904932ccf775b75
* Unify dispatching timeout constantsSiarhei Vishniakou2020-08-041-2/+2
| | | | | | | | | | | | | | | | | | | | The same constant is defined today with slightly different names in both WindowMananagerService and ActivityTaskManagerService. To prevent proliferation, make a constant in aidl and use it here. Also, the two constants used to be in either nanoseconds or milliseconds. Make all constants in milliseconds because aidl does not support "const long", and 5 seconds' worth of nanoseconds does not fit into an int. Bug: 143459140 Test: interact with device after booting Test: adb shell dumpsys input Change-Id: Ia9b3f56d8eddcc6f2f0132bac9254655b180837f Change-Id: If4d40b63c41f6fb54b99d167da8db1924945f3ef
* Update input policy to handle embedded windowsVishnu Nair2019-11-071-1/+7
| | | | | | | | | | | | | | | ANR - If embedded windows are slow in handling inputs the system should blame the embedded app. PointerDownOutsideFocus - if a user taps outside the currently focused window onto an embedded window, treat it as if the host window was tapped. Rename blessInputSurface -> grantInputChannel and add a name to embedded windows. Bug: 134365580 Test: b WindowlessWmTest Test: atest CtsWindowManagerDeviceTestCases:WindowlessWmTests Change-Id: If88970cf6ce17669b41fec995535151a492fab12
* Track native changes: Rework InputApplicationInfoRobert Carr2018-11-271-5/+6
| | | | | | | | | | | | 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
* Plumbing for SurfaceControl#setInputWindowInfo.Robert Carr2018-11-141-0/+54
The standard SurfaceControl plumbing, plus moving InputWindowInfo from the services jar to the framework jar so that it is accessible from SurfaceControl. Bug: 80101428 Bug: 113136004 Bug: 111440400 Test: None Change-Id: I3443a98cd04ac6b36977e1874641a34c6befca34