Loading core/api/test-current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -4135,7 +4135,6 @@ package android.window { method @NonNull public static String typeToString(int); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.window.BackNavigationInfo> CREATOR; field public static final String KEY_TRIGGER_BACK = "TriggerBack"; field public static final int TYPE_CALLBACK = 4; // 0x4 field public static final int TYPE_CROSS_ACTIVITY = 2; // 0x2 field public static final int TYPE_CROSS_TASK = 3; // 0x3 Loading core/java/android/window/BackNavigationInfo.java +25 −2 Original line number Diff line number Diff line Loading @@ -72,8 +72,17 @@ public final class BackNavigationInfo implements Parcelable { /** * Key to access the boolean value passed in {#mOnBackNavigationDone} result bundle * that represents if back navigation has been triggered. * @hide */ public static final String KEY_NAVIGATION_FINISHED = "NavigationFinished"; /** * Key to access the boolean value passed in {#mOnBackNavigationDone} result bundle * that represents if back gesture has been triggered. * @hide */ public static final String KEY_TRIGGER_BACK = "TriggerBack"; public static final String KEY_GESTURE_FINISHED = "GestureFinished"; /** * Defines the type of back destinations a back even can lead to. This is used to define the Loading Loading @@ -192,7 +201,21 @@ public final class BackNavigationInfo implements Parcelable { public void onBackNavigationFinished(boolean triggerBack) { if (mOnBackNavigationDone != null) { Bundle result = new Bundle(); result.putBoolean(KEY_TRIGGER_BACK, triggerBack); result.putBoolean(KEY_NAVIGATION_FINISHED, triggerBack); mOnBackNavigationDone.sendResult(result); } } /** * Callback to be called when the back gesture is finished in order to notify the server that * it can ask app to start rendering. * @hide * @param triggerBack Boolean indicating if back gesture has been triggered. */ public void onBackGestureFinished(boolean triggerBack) { if (mOnBackNavigationDone != null) { Bundle result = new Bundle(); result.putBoolean(KEY_GESTURE_FINISHED, triggerBack); mOnBackNavigationDone.sendResult(result); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +2 −0 Original line number Diff line number Diff line Loading @@ -837,6 +837,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont // The next callback should be {@link #onBackAnimationFinished}. if (mCurrentTracker.getTriggerBack()) { // notify gesture finished mBackNavigationInfo.onBackGestureFinished(true); dispatchOrAnimateOnBackInvoked(mActiveCallback, mCurrentTracker); } else { tryDispatchOnBackCancelled(mActiveCallback); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.wm.shell.back; import static android.window.BackNavigationInfo.KEY_TRIGGER_BACK; import static android.window.BackNavigationInfo.KEY_NAVIGATION_FINISHED; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; Loading Loading @@ -677,7 +677,7 @@ public class BackAnimationControllerTest extends ShellTestCase { @Override public void onResult(@Nullable Bundle result) { mBackNavigationDone = true; mTriggerBack = result.getBoolean(KEY_TRIGGER_BACK); mTriggerBack = result.getBoolean(KEY_NAVIGATION_FINISHED); } } } services/core/java/com/android/server/wm/BackNavigationController.java +33 −12 Original line number Diff line number Diff line Loading @@ -1762,8 +1762,12 @@ class BackNavigationController { } private void onBackNavigationDone(Bundle result, int backType) { boolean triggerBack = result != null && result.getBoolean( BackNavigationInfo.KEY_TRIGGER_BACK); if (result == null) { return; } if (result.containsKey(BackNavigationInfo.KEY_NAVIGATION_FINISHED)) { final boolean triggerBack = result.getBoolean( BackNavigationInfo.KEY_NAVIGATION_FINISHED); ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "onBackNavigationDone backType=%s, " + "triggerBack=%b", backType, triggerBack); Loading @@ -1776,6 +1780,23 @@ class BackNavigationController { mPendingAnimationBuilder = null; } } if (result.getBoolean(BackNavigationInfo.KEY_GESTURE_FINISHED)) { synchronized (mWindowManagerService.mGlobalLock) { final AnimationHandler ah = mAnimationHandler; if (!ah.mComposed || ah.mWaitTransition || ah.mOpenActivities == null || (ah.mSwitchType != AnimationHandler.TASK_SWITCH && ah.mSwitchType != AnimationHandler.ACTIVITY_SWITCH)) { return; } for (int i = mAnimationHandler.mOpenActivities.length - 1; i >= 0; --i) { final ActivityRecord preDrawActivity = mAnimationHandler.mOpenActivities[i]; if (!preDrawActivity.mLaunchTaskBehind) { setLaunchBehind(preDrawActivity); } } } } } static TaskSnapshot getSnapshot(@NonNull WindowContainer w, ActivityRecord[] visibleOpenActivities) { Loading Loading
core/api/test-current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -4135,7 +4135,6 @@ package android.window { method @NonNull public static String typeToString(int); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.window.BackNavigationInfo> CREATOR; field public static final String KEY_TRIGGER_BACK = "TriggerBack"; field public static final int TYPE_CALLBACK = 4; // 0x4 field public static final int TYPE_CROSS_ACTIVITY = 2; // 0x2 field public static final int TYPE_CROSS_TASK = 3; // 0x3 Loading
core/java/android/window/BackNavigationInfo.java +25 −2 Original line number Diff line number Diff line Loading @@ -72,8 +72,17 @@ public final class BackNavigationInfo implements Parcelable { /** * Key to access the boolean value passed in {#mOnBackNavigationDone} result bundle * that represents if back navigation has been triggered. * @hide */ public static final String KEY_NAVIGATION_FINISHED = "NavigationFinished"; /** * Key to access the boolean value passed in {#mOnBackNavigationDone} result bundle * that represents if back gesture has been triggered. * @hide */ public static final String KEY_TRIGGER_BACK = "TriggerBack"; public static final String KEY_GESTURE_FINISHED = "GestureFinished"; /** * Defines the type of back destinations a back even can lead to. This is used to define the Loading Loading @@ -192,7 +201,21 @@ public final class BackNavigationInfo implements Parcelable { public void onBackNavigationFinished(boolean triggerBack) { if (mOnBackNavigationDone != null) { Bundle result = new Bundle(); result.putBoolean(KEY_TRIGGER_BACK, triggerBack); result.putBoolean(KEY_NAVIGATION_FINISHED, triggerBack); mOnBackNavigationDone.sendResult(result); } } /** * Callback to be called when the back gesture is finished in order to notify the server that * it can ask app to start rendering. * @hide * @param triggerBack Boolean indicating if back gesture has been triggered. */ public void onBackGestureFinished(boolean triggerBack) { if (mOnBackNavigationDone != null) { Bundle result = new Bundle(); result.putBoolean(KEY_GESTURE_FINISHED, triggerBack); mOnBackNavigationDone.sendResult(result); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +2 −0 Original line number Diff line number Diff line Loading @@ -837,6 +837,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont // The next callback should be {@link #onBackAnimationFinished}. if (mCurrentTracker.getTriggerBack()) { // notify gesture finished mBackNavigationInfo.onBackGestureFinished(true); dispatchOrAnimateOnBackInvoked(mActiveCallback, mCurrentTracker); } else { tryDispatchOnBackCancelled(mActiveCallback); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.wm.shell.back; import static android.window.BackNavigationInfo.KEY_TRIGGER_BACK; import static android.window.BackNavigationInfo.KEY_NAVIGATION_FINISHED; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; Loading Loading @@ -677,7 +677,7 @@ public class BackAnimationControllerTest extends ShellTestCase { @Override public void onResult(@Nullable Bundle result) { mBackNavigationDone = true; mTriggerBack = result.getBoolean(KEY_TRIGGER_BACK); mTriggerBack = result.getBoolean(KEY_NAVIGATION_FINISHED); } } }
services/core/java/com/android/server/wm/BackNavigationController.java +33 −12 Original line number Diff line number Diff line Loading @@ -1762,8 +1762,12 @@ class BackNavigationController { } private void onBackNavigationDone(Bundle result, int backType) { boolean triggerBack = result != null && result.getBoolean( BackNavigationInfo.KEY_TRIGGER_BACK); if (result == null) { return; } if (result.containsKey(BackNavigationInfo.KEY_NAVIGATION_FINISHED)) { final boolean triggerBack = result.getBoolean( BackNavigationInfo.KEY_NAVIGATION_FINISHED); ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "onBackNavigationDone backType=%s, " + "triggerBack=%b", backType, triggerBack); Loading @@ -1776,6 +1780,23 @@ class BackNavigationController { mPendingAnimationBuilder = null; } } if (result.getBoolean(BackNavigationInfo.KEY_GESTURE_FINISHED)) { synchronized (mWindowManagerService.mGlobalLock) { final AnimationHandler ah = mAnimationHandler; if (!ah.mComposed || ah.mWaitTransition || ah.mOpenActivities == null || (ah.mSwitchType != AnimationHandler.TASK_SWITCH && ah.mSwitchType != AnimationHandler.ACTIVITY_SWITCH)) { return; } for (int i = mAnimationHandler.mOpenActivities.length - 1; i >= 0; --i) { final ActivityRecord preDrawActivity = mAnimationHandler.mOpenActivities[i]; if (!preDrawActivity.mLaunchTaskBehind) { setLaunchBehind(preDrawActivity); } } } } } static TaskSnapshot getSnapshot(@NonNull WindowContainer w, ActivityRecord[] visibleOpenActivities) { Loading