Loading core/java/android/app/ActivityClient.java +9 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,15 @@ public class ActivityClient { } } /** Reports the activity starts local relaunch. */ public void activityLocalRelaunch(IBinder token) { try { getActivityClientController().activityLocalRelaunch(token); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } /** Reports the activity has completed relaunched. */ public void activityRelaunched(IBinder token) { try { Loading core/java/android/app/ActivityThread.java +1 −0 Original line number Diff line number Diff line Loading @@ -5728,6 +5728,7 @@ public final class ActivityThread extends ClientTransactionHandler return; } ActivityClient.getInstance().activityLocalRelaunch(r.token); // Initialize a relaunch request. final MergedConfiguration mergedConfiguration = new MergedConfiguration( r.createdConfig != null Loading core/java/android/app/IActivityClientController.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ interface IActivityClientController { oneway void activityStopped(in IBinder token, in Bundle state, in PersistableBundle persistentState, in CharSequence description); oneway void activityDestroyed(in IBinder token); oneway void activityLocalRelaunch(in IBinder token); oneway void activityRelaunched(in IBinder token); oneway void reportSizeConfigurations(in IBinder token, Loading core/java/android/hardware/input/TEST_MAPPING 0 → 100644 +7 −0 Original line number Diff line number Diff line { "imports": [ { "path": "frameworks/native/services/inputflinger" } ] } libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +39 −2 Original line number Diff line number Diff line Loading @@ -67,8 +67,12 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont SETTING_VALUE_ON) != SETTING_VALUE_OFF; private static final int PROGRESS_THRESHOLD = SystemProperties .getInt(PREDICTIVE_BACK_PROGRESS_THRESHOLD_PROP, -1); private final AtomicBoolean mEnableAnimations = new AtomicBoolean(false); /** * Max duration to wait for a transition to finish before accepting another gesture start * request. */ private static final long MAX_TRANSITION_DURATION = 2000; /** * Location of the initial touch event of the back gesture. Loading @@ -84,6 +88,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont /** True when a back gesture is ongoing */ private boolean mBackGestureStarted = false; /** Tracks if an uninterruptible transition is in progress */ private boolean mTransitionInProgress = false; /** @see #setTriggerBack(boolean) */ private boolean mTriggerBack; Loading @@ -96,6 +102,10 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont private IOnBackInvokedCallback mBackToLauncherCallback; private float mTriggerThreshold; private float mProgressThreshold; private final Runnable mResetTransitionRunnable = () -> { finishAnimation(); mTransitionInProgress = false; }; public BackAnimationController( @NonNull @ShellMainThread ShellExecutor shellExecutor, Loading Loading @@ -229,7 +239,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mBackToLauncherCallback = null; } private void onBackToLauncherAnimationFinished() { @VisibleForTesting void onBackToLauncherAnimationFinished() { if (mBackNavigationInfo != null) { IOnBackInvokedCallback callback = mBackNavigationInfo.getOnBackInvokedCallback(); if (mTriggerBack) { Loading @@ -246,6 +257,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont * {@link BackAnimationController} */ public void onMotionEvent(MotionEvent event, int action, @BackEvent.SwipeEdge int swipeEdge) { if (mTransitionInProgress) { return; } if (action == MotionEvent.ACTION_MOVE) { if (!mBackGestureStarted) { // Let the animation initialized here to make sure the onPointerDownOutsideFocus Loading Loading @@ -370,6 +384,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont IOnBackInvokedCallback targetCallback = shouldDispatchToLauncher ? mBackToLauncherCallback : mBackNavigationInfo.getOnBackInvokedCallback(); if (shouldDispatchToLauncher) { startTransition(); } if (mTriggerBack) { dispatchOnBackInvoked(targetCallback); } else { Loading Loading @@ -436,6 +453,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont * Sets to true when the back gesture has passed the triggering threshold, false otherwise. */ public void setTriggerBack(boolean triggerBack) { if (mTransitionInProgress) { return; } mTriggerBack = triggerBack; } Loading Loading @@ -467,6 +487,23 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mTransaction.remove(screenshotSurface); } mTransaction.apply(); stopTransition(); backNavigationInfo.onBackNavigationFinished(triggerBack); } private void startTransition() { if (mTransitionInProgress) { return; } mTransitionInProgress = true; mShellExecutor.executeDelayed(mResetTransitionRunnable, MAX_TRANSITION_DURATION); } private void stopTransition() { if (!mTransitionInProgress) { return; } mShellExecutor.removeCallbacks(mResetTransitionRunnable); mTransitionInProgress = false; } } Loading
core/java/android/app/ActivityClient.java +9 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,15 @@ public class ActivityClient { } } /** Reports the activity starts local relaunch. */ public void activityLocalRelaunch(IBinder token) { try { getActivityClientController().activityLocalRelaunch(token); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } /** Reports the activity has completed relaunched. */ public void activityRelaunched(IBinder token) { try { Loading
core/java/android/app/ActivityThread.java +1 −0 Original line number Diff line number Diff line Loading @@ -5728,6 +5728,7 @@ public final class ActivityThread extends ClientTransactionHandler return; } ActivityClient.getInstance().activityLocalRelaunch(r.token); // Initialize a relaunch request. final MergedConfiguration mergedConfiguration = new MergedConfiguration( r.createdConfig != null Loading
core/java/android/app/IActivityClientController.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ interface IActivityClientController { oneway void activityStopped(in IBinder token, in Bundle state, in PersistableBundle persistentState, in CharSequence description); oneway void activityDestroyed(in IBinder token); oneway void activityLocalRelaunch(in IBinder token); oneway void activityRelaunched(in IBinder token); oneway void reportSizeConfigurations(in IBinder token, Loading
core/java/android/hardware/input/TEST_MAPPING 0 → 100644 +7 −0 Original line number Diff line number Diff line { "imports": [ { "path": "frameworks/native/services/inputflinger" } ] }
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +39 −2 Original line number Diff line number Diff line Loading @@ -67,8 +67,12 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont SETTING_VALUE_ON) != SETTING_VALUE_OFF; private static final int PROGRESS_THRESHOLD = SystemProperties .getInt(PREDICTIVE_BACK_PROGRESS_THRESHOLD_PROP, -1); private final AtomicBoolean mEnableAnimations = new AtomicBoolean(false); /** * Max duration to wait for a transition to finish before accepting another gesture start * request. */ private static final long MAX_TRANSITION_DURATION = 2000; /** * Location of the initial touch event of the back gesture. Loading @@ -84,6 +88,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont /** True when a back gesture is ongoing */ private boolean mBackGestureStarted = false; /** Tracks if an uninterruptible transition is in progress */ private boolean mTransitionInProgress = false; /** @see #setTriggerBack(boolean) */ private boolean mTriggerBack; Loading @@ -96,6 +102,10 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont private IOnBackInvokedCallback mBackToLauncherCallback; private float mTriggerThreshold; private float mProgressThreshold; private final Runnable mResetTransitionRunnable = () -> { finishAnimation(); mTransitionInProgress = false; }; public BackAnimationController( @NonNull @ShellMainThread ShellExecutor shellExecutor, Loading Loading @@ -229,7 +239,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mBackToLauncherCallback = null; } private void onBackToLauncherAnimationFinished() { @VisibleForTesting void onBackToLauncherAnimationFinished() { if (mBackNavigationInfo != null) { IOnBackInvokedCallback callback = mBackNavigationInfo.getOnBackInvokedCallback(); if (mTriggerBack) { Loading @@ -246,6 +257,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont * {@link BackAnimationController} */ public void onMotionEvent(MotionEvent event, int action, @BackEvent.SwipeEdge int swipeEdge) { if (mTransitionInProgress) { return; } if (action == MotionEvent.ACTION_MOVE) { if (!mBackGestureStarted) { // Let the animation initialized here to make sure the onPointerDownOutsideFocus Loading Loading @@ -370,6 +384,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont IOnBackInvokedCallback targetCallback = shouldDispatchToLauncher ? mBackToLauncherCallback : mBackNavigationInfo.getOnBackInvokedCallback(); if (shouldDispatchToLauncher) { startTransition(); } if (mTriggerBack) { dispatchOnBackInvoked(targetCallback); } else { Loading Loading @@ -436,6 +453,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont * Sets to true when the back gesture has passed the triggering threshold, false otherwise. */ public void setTriggerBack(boolean triggerBack) { if (mTransitionInProgress) { return; } mTriggerBack = triggerBack; } Loading Loading @@ -467,6 +487,23 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont mTransaction.remove(screenshotSurface); } mTransaction.apply(); stopTransition(); backNavigationInfo.onBackNavigationFinished(triggerBack); } private void startTransition() { if (mTransitionInProgress) { return; } mTransitionInProgress = true; mShellExecutor.executeDelayed(mResetTransitionRunnable, MAX_TRANSITION_DURATION); } private void stopTransition() { if (!mTransitionInProgress) { return; } mShellExecutor.removeCallbacks(mResetTransitionRunnable); mTransitionInProgress = false; } }