Loading libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java +0 −1 Original line number Diff line number Diff line Loading @@ -353,7 +353,6 @@ public class CrossActivityAnimation extends ShellBackAnimation { closingLeft += mapRange(interpolatedProgress, deltaXMin, deltaXMax); // Move the window along the Y axis. final float deltaYRatio = (touchY - mInitialTouchPos.y) / height; final float closingTop = (height - closingHeight) * 0.5f; targetRect.set( closingLeft, closingTop, closingLeft + closingWidth, closingTop + closingHeight); Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +0 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_UNSPECI import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_RELAUNCH; import static android.window.TransitionInfo.FLAG_BACK_GESTURE_ANIMATED; import static android.window.TransitionInfo.FLAG_CROSS_PROFILE_OWNER_THUMBNAIL; import static android.window.TransitionInfo.FLAG_CROSS_PROFILE_WORK_THUMBNAIL; import static android.window.TransitionInfo.FLAG_DISPLAY_HAS_ALERT_WINDOWS; Loading Loading @@ -422,11 +421,6 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { continue; } // The back gesture has animated this change before transition happen, so here we don't // play the animation again. if (change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) { continue; } // Don't animate anything that isn't independent. if (!TransitionInfo.isIndependent(change, info)) continue; Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +6 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static android.view.WindowManager.TRANSIT_SLEEP; import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; import static android.view.WindowManager.fixScale; import static android.window.TransitionInfo.FLAG_BACK_GESTURE_ANIMATED; import static android.window.TransitionInfo.FLAG_IS_BEHIND_STARTING_WINDOW; import static android.window.TransitionInfo.FLAG_IS_OCCLUDED; import static android.window.TransitionInfo.FLAG_IS_WALLPAPER; Loading Loading @@ -743,6 +744,11 @@ public class Transitions implements RemoteCallable<Transitions>, if (!change.hasFlags(FLAG_IS_OCCLUDED)) { allOccluded = false; } // The change has already animated by back gesture, don't need to play transition // animation on it. if (change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) { info.getChanges().remove(i); } } // There does not need animation when: // A. Transfer starting window. Apply transfer starting window directly if there is no other Loading services/core/java/com/android/server/wm/ActivityClientController.java +30 −35 Original line number Diff line number Diff line Loading @@ -1585,7 +1585,7 @@ class ActivityClientController extends IActivityClientController.Stub { * the Activities in the Task should be finished when it finishes. Otherwise, return {@code * false}. */ private boolean isRelativeTaskRootActivity(ActivityRecord r, ActivityRecord taskRoot) { private static boolean isRelativeTaskRootActivity(ActivityRecord r, ActivityRecord taskRoot) { // Not a relative root if the given Activity is not the root Activity of its TaskFragment. final TaskFragment taskFragment = r.getTaskFragment(); if (r != taskFragment.getActivity(ar -> !ar.finishing || ar == r, Loading @@ -1598,7 +1598,7 @@ class ActivityClientController extends IActivityClientController.Stub { return taskRoot.getTaskFragment().getCompanionTaskFragment() == taskFragment; } private boolean isTopActivityInTaskFragment(ActivityRecord activity) { private static boolean isTopActivityInTaskFragment(ActivityRecord activity) { return activity.getTaskFragment().topRunningActivity() == activity; } Loading @@ -1614,9 +1614,6 @@ class ActivityClientController extends IActivityClientController.Stub { public void onBackPressed(IBinder token, IRequestFinishCallback callback) { final long origId = Binder.clearCallingIdentity(); try { final Intent baseActivityIntent; final boolean launchedFromHome; final boolean isLastRunningActivity; synchronized (mGlobalLock) { final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token); if (r == null) return; Loading @@ -1624,27 +1621,32 @@ class ActivityClientController extends IActivityClientController.Stub { final Task task = r.getTask(); final ActivityRecord root = task.getRootActivity(false /*ignoreRelinquishIdentity*/, true /*setToBottomIfNone*/); final boolean isTaskRoot = r == root; if (isTaskRoot) { if (mService.mWindowOrganizerController.mTaskOrganizerController if (r == root && mService.mWindowOrganizerController.mTaskOrganizerController .handleInterceptBackPressedOnTaskRoot(r.getRootTask())) { // This task is handled by a task organizer that has requested the back // pressed callback. return; } } else if (!isRelativeTaskRootActivity(r, root)) { // Finish the Activity if the activity is not the task root or relative root. requestCallbackFinish(callback); if (shouldMoveTaskToBack(r, root)) { moveActivityTaskToBack(token, true /* nonRoot */); return; } } isLastRunningActivity = isTopActivityInTaskFragment(isTaskRoot ? root : r); final boolean isBaseActivity = root.mActivityComponent.equals(task.realActivity); baseActivityIntent = isBaseActivity ? root.intent : null; // The default option for handling the back button is to finish the Activity. requestCallbackFinish(callback); } finally { Binder.restoreCallingIdentity(origId); } } launchedFromHome = root.isLaunchSourceType(ActivityRecord.LAUNCH_SOURCE_TYPE_HOME); static boolean shouldMoveTaskToBack(ActivityRecord r, ActivityRecord rootActivity) { if (r != rootActivity && !isRelativeTaskRootActivity(r, rootActivity)) { return false; } final boolean isBaseActivity = rootActivity.mActivityComponent.equals( r.getTask().realActivity); final Intent baseActivityIntent = isBaseActivity ? rootActivity.intent : null; // If the activity was launched directly from the home screen, then we should // refrain from finishing the activity and instead move it to the back to keep it in Loading @@ -1653,17 +1655,10 @@ class ActivityClientController extends IActivityClientController.Stub { // 2. The current activity is the base activity for the task. // 3. The activity was launched by the home process, and is one of the main entry // points for the application. if (baseActivityIntent != null && isLastRunningActivity && launchedFromHome && ActivityRecord.isMainIntent(baseActivityIntent)) { moveActivityTaskToBack(token, true /* nonRoot */); return; } // The default option for handling the back button is to finish the Activity. requestCallbackFinish(callback); } finally { Binder.restoreCallingIdentity(origId); } return baseActivityIntent != null && isTopActivityInTaskFragment(r) && rootActivity.isLaunchSourceType(ActivityRecord.LAUNCH_SOURCE_TYPE_HOME) && ActivityRecord.isMainIntent(baseActivityIntent); } @Override Loading services/core/java/com/android/server/wm/BackNavigationController.java +416 −132 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityAnimation.java +0 −1 Original line number Diff line number Diff line Loading @@ -353,7 +353,6 @@ public class CrossActivityAnimation extends ShellBackAnimation { closingLeft += mapRange(interpolatedProgress, deltaXMin, deltaXMax); // Move the window along the Y axis. final float deltaYRatio = (touchY - mInitialTouchPos.y) / height; final float closingTop = (height - closingHeight) * 0.5f; targetRect.set( closingLeft, closingTop, closingLeft + closingWidth, closingTop + closingHeight); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +0 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_UNSPECI import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_RELAUNCH; import static android.window.TransitionInfo.FLAG_BACK_GESTURE_ANIMATED; import static android.window.TransitionInfo.FLAG_CROSS_PROFILE_OWNER_THUMBNAIL; import static android.window.TransitionInfo.FLAG_CROSS_PROFILE_WORK_THUMBNAIL; import static android.window.TransitionInfo.FLAG_DISPLAY_HAS_ALERT_WINDOWS; Loading Loading @@ -422,11 +421,6 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { continue; } // The back gesture has animated this change before transition happen, so here we don't // play the animation again. if (change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) { continue; } // Don't animate anything that isn't independent. if (!TransitionInfo.isIndependent(change, info)) continue; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +6 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static android.view.WindowManager.TRANSIT_SLEEP; import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; import static android.view.WindowManager.fixScale; import static android.window.TransitionInfo.FLAG_BACK_GESTURE_ANIMATED; import static android.window.TransitionInfo.FLAG_IS_BEHIND_STARTING_WINDOW; import static android.window.TransitionInfo.FLAG_IS_OCCLUDED; import static android.window.TransitionInfo.FLAG_IS_WALLPAPER; Loading Loading @@ -743,6 +744,11 @@ public class Transitions implements RemoteCallable<Transitions>, if (!change.hasFlags(FLAG_IS_OCCLUDED)) { allOccluded = false; } // The change has already animated by back gesture, don't need to play transition // animation on it. if (change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) { info.getChanges().remove(i); } } // There does not need animation when: // A. Transfer starting window. Apply transfer starting window directly if there is no other Loading
services/core/java/com/android/server/wm/ActivityClientController.java +30 −35 Original line number Diff line number Diff line Loading @@ -1585,7 +1585,7 @@ class ActivityClientController extends IActivityClientController.Stub { * the Activities in the Task should be finished when it finishes. Otherwise, return {@code * false}. */ private boolean isRelativeTaskRootActivity(ActivityRecord r, ActivityRecord taskRoot) { private static boolean isRelativeTaskRootActivity(ActivityRecord r, ActivityRecord taskRoot) { // Not a relative root if the given Activity is not the root Activity of its TaskFragment. final TaskFragment taskFragment = r.getTaskFragment(); if (r != taskFragment.getActivity(ar -> !ar.finishing || ar == r, Loading @@ -1598,7 +1598,7 @@ class ActivityClientController extends IActivityClientController.Stub { return taskRoot.getTaskFragment().getCompanionTaskFragment() == taskFragment; } private boolean isTopActivityInTaskFragment(ActivityRecord activity) { private static boolean isTopActivityInTaskFragment(ActivityRecord activity) { return activity.getTaskFragment().topRunningActivity() == activity; } Loading @@ -1614,9 +1614,6 @@ class ActivityClientController extends IActivityClientController.Stub { public void onBackPressed(IBinder token, IRequestFinishCallback callback) { final long origId = Binder.clearCallingIdentity(); try { final Intent baseActivityIntent; final boolean launchedFromHome; final boolean isLastRunningActivity; synchronized (mGlobalLock) { final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token); if (r == null) return; Loading @@ -1624,27 +1621,32 @@ class ActivityClientController extends IActivityClientController.Stub { final Task task = r.getTask(); final ActivityRecord root = task.getRootActivity(false /*ignoreRelinquishIdentity*/, true /*setToBottomIfNone*/); final boolean isTaskRoot = r == root; if (isTaskRoot) { if (mService.mWindowOrganizerController.mTaskOrganizerController if (r == root && mService.mWindowOrganizerController.mTaskOrganizerController .handleInterceptBackPressedOnTaskRoot(r.getRootTask())) { // This task is handled by a task organizer that has requested the back // pressed callback. return; } } else if (!isRelativeTaskRootActivity(r, root)) { // Finish the Activity if the activity is not the task root or relative root. requestCallbackFinish(callback); if (shouldMoveTaskToBack(r, root)) { moveActivityTaskToBack(token, true /* nonRoot */); return; } } isLastRunningActivity = isTopActivityInTaskFragment(isTaskRoot ? root : r); final boolean isBaseActivity = root.mActivityComponent.equals(task.realActivity); baseActivityIntent = isBaseActivity ? root.intent : null; // The default option for handling the back button is to finish the Activity. requestCallbackFinish(callback); } finally { Binder.restoreCallingIdentity(origId); } } launchedFromHome = root.isLaunchSourceType(ActivityRecord.LAUNCH_SOURCE_TYPE_HOME); static boolean shouldMoveTaskToBack(ActivityRecord r, ActivityRecord rootActivity) { if (r != rootActivity && !isRelativeTaskRootActivity(r, rootActivity)) { return false; } final boolean isBaseActivity = rootActivity.mActivityComponent.equals( r.getTask().realActivity); final Intent baseActivityIntent = isBaseActivity ? rootActivity.intent : null; // If the activity was launched directly from the home screen, then we should // refrain from finishing the activity and instead move it to the back to keep it in Loading @@ -1653,17 +1655,10 @@ class ActivityClientController extends IActivityClientController.Stub { // 2. The current activity is the base activity for the task. // 3. The activity was launched by the home process, and is one of the main entry // points for the application. if (baseActivityIntent != null && isLastRunningActivity && launchedFromHome && ActivityRecord.isMainIntent(baseActivityIntent)) { moveActivityTaskToBack(token, true /* nonRoot */); return; } // The default option for handling the back button is to finish the Activity. requestCallbackFinish(callback); } finally { Binder.restoreCallingIdentity(origId); } return baseActivityIntent != null && isTopActivityInTaskFragment(r) && rootActivity.isLaunchSourceType(ActivityRecord.LAUNCH_SOURCE_TYPE_HOME) && ActivityRecord.isMainIntent(baseActivityIntent); } @Override Loading
services/core/java/com/android/server/wm/BackNavigationController.java +416 −132 File changed.Preview size limit exceeded, changes collapsed. Show changes