summaryrefslogtreecommitdiff
path: root/core/java/android/window/OnBackInvokedDispatcher.java
Commit message (Collapse)AuthorAgeFilesLines
* Disable debug loggingVadim Caen2022-05-251-2/+1
| | | | | | Bug: 227173606 Test: N/A Change-Id: Ia03f7b6e5d9dfb6e247fab4526d6293b3600d398
* Migrate IME to handle back with OnBackInvokedDispatcher.Shan Huang2022-05-041-0/+15
| | | | | | | | | | | | | | We currently close the IME by having the target application forward KEYCODE_BACK to the IME process through InputMethodManager#dispatchInputEvent and having the IME handle the keycode in InputMethodService#onKeyDown. When apps opt in to OnBackInvokedDispatcher API, we will not dispatch KEYCODE_BACK to apps anymore. Thus we need to migrate IME to the new API for it to close on back invocation. This implementation forwards OnBackInvokedCallbacks from the IME process to the app process. This is necessary because all callbacks need to exist in the app process for them to be considered by hardware back keys. While back gestures go through WM to resolve callbacks from the focused window, hw keys are directly sent to the focused window's ViewRootImpl, bypassing server side back nav logic. Bug: 228358882 Test: atest CtsInputMethodTestCases:KeyboardVisibilityControlTest Test: atest CtsInputMethodTestCases:InputMethodServiceTest Test: atest CtsInputMethodTestCases Change-Id: Ie207b63b11a56c9b2173f26b734a27b13ebccc60
* Some cleanup logging and test for back navigationVadim Caen2022-04-011-10/+0
| | | | | | | | | | | - Better logging - Remove method form OnBackInvokedDispatcher interface (but not the implementation) - Add test for ag/17211289 Bug: 222675481 Test: BackNavigationControllerTests#testUnregisterCallbacksWithSystemCallback Change-Id: I6a3ae30da7e29dddda116acd8fa0c9af4b9faa6e
* Remove DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME.Shan Huang2022-03-291-20/+0
| | | | | | | | | We are not gating the new back dispatch by targetSdkVersion in T. The new dispatch is controlled by the enableOnBackInvokedCallback app manifest flag (which defaults to false). Test: m -j update-api Bug: 195946584 Change-Id: Iab59051ec5b6336ca4d42cc47015fe86a3f37942
* Change parameter order to make it SAM compatibleVadim Caen2022-03-171-3/+3
| | | | | | | | Move the callback as the last paramter to registerOnBackInvokedCallback Test: Existing Bug: 224562951 Change-Id: I8608a03b53baa04bedee81d2e86b2339abd6c594
* Move OnBackInvokedCallback to window package.Vadim Caen2022-03-021-0/+129
Originally, View was implementing onBackInvokedDisptacherOwner, but now only Activity and Dialog and since back event are related to the window, it makes sense to move them into the android.window package This follow up comment at: ag/c/platform/frameworks/base/+/16764116/comments/e131f3ef_e3e1d2e0 Test: atest BackNavigationTests Bug: 221401221 Change-Id: Ia2f26162beb6a41b6e162b31e599e882f8bf7320