Loading packages/SystemUI/src/com/android/systemui/RecentsComponent.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ import android.view.Display; import android.view.View; public interface RecentsComponent { void showRecents(boolean triggeredFromAltTab, boolean fromHome, View statusBarView); void showRecents(boolean triggeredFromAltTab, boolean fromHome); void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); void toggleRecents(Display display, int layoutDirection, View statusBarView); void toggleRecents(Display display); void preloadRecents(); void cancelPreloadingRecents(); void showNextAffiliatedTask(); Loading packages/SystemUI/src/com/android/systemui/recents/IRecentsNonSystemUserCallbacks.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -27,9 +27,9 @@ oneway interface IRecentsNonSystemUserCallbacks { void preloadRecents(); void cancelPreloadingRecents(); void showRecents(boolean triggeredFromAltTab, boolean draggingInRecents, boolean animate, boolean reloadTasks, boolean fromHome); boolean reloadTasks, boolean fromHome, int recentsGrowTarget); void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); void toggleRecents(); void toggleRecents(int recentsGrowTarget); void onConfigurationChanged(); void dockTopTask(int topTaskId, int dragMode, int stackCreateMode, in Rect initialBounds); Loading packages/SystemUI/src/com/android/systemui/recents/Recents.java +13 −8 Original line number Diff line number Diff line Loading @@ -37,9 +37,7 @@ import android.os.UserHandle; import android.provider.Settings; import android.util.EventLog; import android.util.Log; import android.util.MutableBoolean; import android.view.Display; import android.view.View; import android.widget.Toast; import com.android.internal.logging.MetricsLogger; Loading @@ -59,6 +57,7 @@ import com.android.systemui.recents.events.ui.RecentsDrawnEvent; import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.recents.model.RecentsTaskLoader; import com.android.systemui.recents.tv.RecentsTvImpl; import com.android.systemui.stackdivider.Divider; import java.util.ArrayList; Loading @@ -75,6 +74,7 @@ public class Recents extends SystemUI public final static int EVENT_BUS_PRIORITY = 1; public final static int BIND_TO_SYSTEM_USER_RETRY_DELAY = 5000; public final static int RECENTS_GROW_TARGET_INVALID = -1; // Purely for experimentation private final static String RECENTS_OVERRIDE_SYSPROP_KEY = "persist.recents_override_pkg"; Loading Loading @@ -238,7 +238,7 @@ public class Recents extends SystemUI * Shows the Recents. */ @Override public void showRecents(boolean triggeredFromAltTab, boolean fromHome, View statusBarView) { public void showRecents(boolean triggeredFromAltTab, boolean fromHome) { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isUserSetup()) { Loading @@ -249,10 +249,12 @@ public class Recents extends SystemUI return; } int recentsGrowTarget = getComponent(Divider.class).getView().growsRecents(); int currentUser = sSystemServicesProxy.getCurrentUser(); if (sSystemServicesProxy.isSystemUser(currentUser)) { mImpl.showRecents(triggeredFromAltTab, false /* draggingInRecents */, true /* animate */, false /* reloadTasks */, fromHome); true /* animate */, false /* reloadTasks */, fromHome, recentsGrowTarget); } else { if (mSystemToUserCallbacks != null) { IRecentsNonSystemUserCallbacks callbacks = Loading @@ -260,7 +262,8 @@ public class Recents extends SystemUI if (callbacks != null) { try { callbacks.showRecents(triggeredFromAltTab, false /* draggingInRecents */, true /* animate */, false /* reloadTasks */, fromHome); true /* animate */, false /* reloadTasks */, fromHome, recentsGrowTarget); } catch (RemoteException e) { Log.e(TAG, "Callback failed", e); } Loading Loading @@ -310,7 +313,7 @@ public class Recents extends SystemUI * Toggles the Recents activity. */ @Override public void toggleRecents(Display display, int layoutDirection, View statusBarView) { public void toggleRecents(Display display) { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isUserSetup()) { Loading @@ -321,16 +324,18 @@ public class Recents extends SystemUI return; } int growTarget = getComponent(Divider.class).getView().growsRecents(); int currentUser = sSystemServicesProxy.getCurrentUser(); if (sSystemServicesProxy.isSystemUser(currentUser)) { mImpl.toggleRecents(); mImpl.toggleRecents(growTarget); } else { if (mSystemToUserCallbacks != null) { IRecentsNonSystemUserCallbacks callbacks = mSystemToUserCallbacks.getNonSystemUserRecentsForUser(currentUser); if (callbacks != null) { try { callbacks.toggleRecents(); callbacks.toggleRecents(growTarget); } catch (RemoteException e) { Log.e(TAG, "Callback failed", e); } Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +45 −17 Original line number Diff line number Diff line Loading @@ -38,8 +38,10 @@ import android.util.MutableBoolean; import android.view.AppTransitionAnimationSpec; import android.view.LayoutInflater; import android.view.ViewConfiguration; import android.view.WindowManager; import com.android.internal.logging.MetricsLogger; import com.android.internal.policy.DockedDividerUtils; import com.android.systemui.R; import com.android.systemui.SystemUIApplication; import com.android.systemui.recents.events.EventBus; Loading Loading @@ -68,6 +70,7 @@ import com.android.systemui.recents.views.TaskStackView; import com.android.systemui.recents.views.TaskStackViewScroller; import com.android.systemui.recents.views.TaskViewHeader; import com.android.systemui.recents.views.TaskViewTransform; import com.android.systemui.stackdivider.DividerView; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.phone.NavigationBarGestureHelper; import com.android.systemui.statusbar.phone.PhoneStatusBar; Loading Loading @@ -156,7 +159,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // When this fires, then the user has not released alt-tab for at least // FAST_ALT_TAB_DELAY_MS milliseconds showRecents(mTriggeredFromAltTab, false /* draggingInRecents */, true /* animate */, false /* reloadTasks */, false /* fromHome */); false /* reloadTasks */, false /* fromHome */, DividerView.INVALID_RECENTS_GROW_TARGET); } }); Loading Loading @@ -230,7 +234,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } public void showRecents(boolean triggeredFromAltTab, boolean draggingInRecents, boolean animate, boolean launchedWhileDockingTask, boolean fromHome) { boolean animate, boolean launchedWhileDockingTask, boolean fromHome, int growTarget) { mTriggeredFromAltTab = triggeredFromAltTab; mDraggingInRecents = draggingInRecents; mLaunchedWhileDocking = launchedWhileDockingTask; Loading Loading @@ -260,7 +265,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask(); MutableBoolean isTopTaskHome = new MutableBoolean(true); if (topTask == null || !ssp.isRecentsTopMost(topTask, isTopTaskHome)) { startRecentsActivity(topTask, isTopTaskHome.value || fromHome, animate); startRecentsActivity(topTask, isTopTaskHome.value || fromHome, animate, growTarget); } } catch (ActivityNotFoundException e) { Log.e(TAG, "Failed to launch RecentsActivity", e); Loading @@ -284,7 +289,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener triggeredFromHomeKey)); } public void toggleRecents() { public void toggleRecents(int growTarget) { // Skip this toggle if we are already waiting to trigger recents via alt-tab if (mFastAltTabTrigger.isDozing()) { return; Loading Loading @@ -338,7 +343,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } // Otherwise, start the recents activity startRecentsActivity(topTask, isTopTaskHome.value, true /* animate */); startRecentsActivity(topTask, isTopTaskHome.value, true /* animate */, growTarget); // Only close the other system windows if we are actually showing recents ssp.sendCloseSystemWindows(BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); Loading Loading @@ -369,7 +374,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // At this point, we don't know anything about the stack state. So only calculate // the dimensions of the thumbnail that we need for the transition into Recents, but // do not draw it until we construct the activity options when we start Recents updateHeaderBarLayout(stack); updateHeaderBarLayout(stack, null /* window rect override*/); } } } Loading Loading @@ -535,7 +540,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener dragMode == NavigationBarGestureHelper.DRAG_MODE_RECENTS, false /* animate */, true /* launchedWhileDockingTask*/, false /* fromHome */); false /* fromHome */, DividerView.INVALID_RECENTS_GROW_TARGET); } } Loading Loading @@ -574,12 +580,17 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * since the last call, it will attempt to re-measure and layout the header bar to the new size. * * @param stack the stack to initialize the stack layout with * @param windowRectOverride the rectangle to use when calculating the stack state which can * be different from the current window rect if recents is resizing * while being launched */ private void updateHeaderBarLayout(TaskStack stack) { private void updateHeaderBarLayout(TaskStack stack, Rect windowRectOverride) { SystemServicesProxy ssp = Recents.getSystemServices(); Rect systemInsets = new Rect(); ssp.getStableInsets(systemInsets); Rect windowRect = ssp.getWindowRect(); Rect windowRect = windowRectOverride != null ? new Rect(windowRectOverride) : ssp.getWindowRect(); // When docked, the nav bar insets are consumed and the activity is measured without insets. // However, the window bounds include the insets, so we need to subtract them here to make // them identical. Loading Loading @@ -682,7 +693,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * Creates the activity options for an app->recents transition. */ private ActivityOptions getThumbnailTransitionActivityOptions( ActivityManager.RunningTaskInfo topTask, TaskStackView stackView) { ActivityManager.RunningTaskInfo topTask, TaskStackView stackView, Rect windowOverrideRect) { if (topTask.stackId == FREEFORM_WORKSPACE_STACK_ID) { ArrayList<AppTransitionAnimationSpec> specs = new ArrayList<>(); ArrayList<Task> tasks = stackView.getStack().getStackTasks(); Loading @@ -696,7 +708,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener Task task = tasks.get(i); if (task.isFreeformTask()) { mTmpTransform = stackLayout.getStackTransformScreenCoordinates(task, stackScroller.getStackScroll(), mTmpTransform, null); stackScroller.getStackScroll(), mTmpTransform, null, windowOverrideRect); Bitmap thumbnail = drawThumbnailTransitionBitmap(task, mTmpTransform, mThumbTransitionBitmapCache); Rect toTaskRect = new Rect(); Loading @@ -711,7 +724,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } else { // Update the destination rect Task toTask = new Task(); TaskViewTransform toTransform = getThumbnailTransitionTransform(stackView, toTask); TaskViewTransform toTransform = getThumbnailTransitionTransform(stackView, toTask, windowOverrideRect); Bitmap thumbnail = drawThumbnailTransitionBitmap(toTask, toTransform, mThumbTransitionBitmapCache); if (thumbnail != null) { Loading @@ -729,7 +743,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * Returns the transition rect for the given task id. */ private TaskViewTransform getThumbnailTransitionTransform(TaskStackView stackView, Task runningTaskOut) { Task runningTaskOut, Rect windowOverrideRect) { // Find the running task in the TaskStack TaskStack stack = stackView.getStack(); Task launchTask = stack.getLaunchTarget(); Loading @@ -745,7 +759,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateToInitialState(); stackView.getStackAlgorithm().getStackTransformScreenCoordinates(launchTask, stackView.getScroller().getStackScroll(), mTmpTransform, null); stackView.getScroller().getStackScroll(), mTmpTransform, null, windowOverrideRect); return mTmpTransform; } Loading Loading @@ -788,7 +802,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * Shows the recents activity */ protected void startRecentsActivity(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome, boolean animate) { boolean isTopTaskHome, boolean animate, int growTarget) { RecentsTaskLoader loader = Recents.getTaskLoader(); RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); Loading Loading @@ -820,7 +834,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener preloadIcon(topTask); // Update the header bar if necessary updateHeaderBarLayout(stack); Rect windowOverrideRect = getWindowRectOverride(growTarget); updateHeaderBarLayout(stack, windowOverrideRect); // Prepare the dummy stack for the transition TaskStackLayoutAlgorithm.VisibilityReport stackVr = Loading @@ -838,7 +853,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener ActivityOptions opts; if (useThumbnailTransition) { // Try starting with a thumbnail transition opts = getThumbnailTransitionActivityOptions(topTask, mDummyStackView); opts = getThumbnailTransitionActivityOptions(topTask, mDummyStackView, windowOverrideRect); } else { // If there is no thumbnail transition, but is launching from home into recents, then // use a quick home transition Loading @@ -850,6 +866,18 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener mLastToggleTime = SystemClock.elapsedRealtime(); } private Rect getWindowRectOverride(int growTarget) { if (growTarget == DividerView.INVALID_RECENTS_GROW_TARGET) { return null; } Rect result = new Rect(); Rect displayRect = Recents.getSystemServices().getDisplayRect(); DockedDividerUtils.calculateBoundsForPosition(growTarget, WindowManager.DOCKED_BOTTOM, result, displayRect.width(), displayRect.height(), Recents.getSystemServices().getDockedDividerSize(mContext)); return result; } /** * Starts the recents activity. */ Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImplProxy.java +7 −5 Original line number Diff line number Diff line Loading @@ -57,13 +57,15 @@ public class RecentsImplProxy extends IRecentsNonSystemUserCallbacks.Stub { @Override public void showRecents(boolean triggeredFromAltTab, boolean draggingInRecents, boolean animate, boolean reloadTasks, boolean fromHome) throws RemoteException { boolean reloadTasks, boolean fromHome, int growTarget) throws RemoteException { SomeArgs args = SomeArgs.obtain(); args.argi1 = triggeredFromAltTab ? 1 : 0; args.argi2 = draggingInRecents ? 1 : 0; args.argi3 = animate ? 1 : 0; args.argi4 = reloadTasks ? 1 : 0; args.argi5 = fromHome ? 1 : 0; args.argi6 = growTarget; mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_RECENTS, args)); } Loading @@ -75,8 +77,8 @@ public class RecentsImplProxy extends IRecentsNonSystemUserCallbacks.Stub { } @Override public void toggleRecents() throws RemoteException { mHandler.sendEmptyMessage(MSG_TOGGLE_RECENTS); public void toggleRecents(int growTarget) throws RemoteException { mHandler.sendMessage(mHandler.obtainMessage(MSG_TOGGLE_RECENTS, growTarget)); } @Override Loading Loading @@ -119,13 +121,13 @@ public class RecentsImplProxy extends IRecentsNonSystemUserCallbacks.Stub { case MSG_SHOW_RECENTS: SomeArgs args = (SomeArgs) msg.obj; mImpl.showRecents(args.argi1 != 0, args.argi2 != 0, args.argi3 != 0, args.argi4 != 0, args.argi5 != 0); args.argi4 != 0, args.argi5 != 0, args.argi6); break; case MSG_HIDE_RECENTS: mImpl.hideRecents(msg.arg1 != 0, msg.arg2 != 0); break; case MSG_TOGGLE_RECENTS: mImpl.toggleRecents(); mImpl.toggleRecents(msg.arg1); break; case MSG_ON_CONFIGURATION_CHANGED: mImpl.onConfigurationChanged(); Loading Loading
packages/SystemUI/src/com/android/systemui/RecentsComponent.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ import android.view.Display; import android.view.View; public interface RecentsComponent { void showRecents(boolean triggeredFromAltTab, boolean fromHome, View statusBarView); void showRecents(boolean triggeredFromAltTab, boolean fromHome); void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); void toggleRecents(Display display, int layoutDirection, View statusBarView); void toggleRecents(Display display); void preloadRecents(); void cancelPreloadingRecents(); void showNextAffiliatedTask(); Loading
packages/SystemUI/src/com/android/systemui/recents/IRecentsNonSystemUserCallbacks.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -27,9 +27,9 @@ oneway interface IRecentsNonSystemUserCallbacks { void preloadRecents(); void cancelPreloadingRecents(); void showRecents(boolean triggeredFromAltTab, boolean draggingInRecents, boolean animate, boolean reloadTasks, boolean fromHome); boolean reloadTasks, boolean fromHome, int recentsGrowTarget); void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); void toggleRecents(); void toggleRecents(int recentsGrowTarget); void onConfigurationChanged(); void dockTopTask(int topTaskId, int dragMode, int stackCreateMode, in Rect initialBounds); Loading
packages/SystemUI/src/com/android/systemui/recents/Recents.java +13 −8 Original line number Diff line number Diff line Loading @@ -37,9 +37,7 @@ import android.os.UserHandle; import android.provider.Settings; import android.util.EventLog; import android.util.Log; import android.util.MutableBoolean; import android.view.Display; import android.view.View; import android.widget.Toast; import com.android.internal.logging.MetricsLogger; Loading @@ -59,6 +57,7 @@ import com.android.systemui.recents.events.ui.RecentsDrawnEvent; import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.recents.model.RecentsTaskLoader; import com.android.systemui.recents.tv.RecentsTvImpl; import com.android.systemui.stackdivider.Divider; import java.util.ArrayList; Loading @@ -75,6 +74,7 @@ public class Recents extends SystemUI public final static int EVENT_BUS_PRIORITY = 1; public final static int BIND_TO_SYSTEM_USER_RETRY_DELAY = 5000; public final static int RECENTS_GROW_TARGET_INVALID = -1; // Purely for experimentation private final static String RECENTS_OVERRIDE_SYSPROP_KEY = "persist.recents_override_pkg"; Loading Loading @@ -238,7 +238,7 @@ public class Recents extends SystemUI * Shows the Recents. */ @Override public void showRecents(boolean triggeredFromAltTab, boolean fromHome, View statusBarView) { public void showRecents(boolean triggeredFromAltTab, boolean fromHome) { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isUserSetup()) { Loading @@ -249,10 +249,12 @@ public class Recents extends SystemUI return; } int recentsGrowTarget = getComponent(Divider.class).getView().growsRecents(); int currentUser = sSystemServicesProxy.getCurrentUser(); if (sSystemServicesProxy.isSystemUser(currentUser)) { mImpl.showRecents(triggeredFromAltTab, false /* draggingInRecents */, true /* animate */, false /* reloadTasks */, fromHome); true /* animate */, false /* reloadTasks */, fromHome, recentsGrowTarget); } else { if (mSystemToUserCallbacks != null) { IRecentsNonSystemUserCallbacks callbacks = Loading @@ -260,7 +262,8 @@ public class Recents extends SystemUI if (callbacks != null) { try { callbacks.showRecents(triggeredFromAltTab, false /* draggingInRecents */, true /* animate */, false /* reloadTasks */, fromHome); true /* animate */, false /* reloadTasks */, fromHome, recentsGrowTarget); } catch (RemoteException e) { Log.e(TAG, "Callback failed", e); } Loading Loading @@ -310,7 +313,7 @@ public class Recents extends SystemUI * Toggles the Recents activity. */ @Override public void toggleRecents(Display display, int layoutDirection, View statusBarView) { public void toggleRecents(Display display) { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isUserSetup()) { Loading @@ -321,16 +324,18 @@ public class Recents extends SystemUI return; } int growTarget = getComponent(Divider.class).getView().growsRecents(); int currentUser = sSystemServicesProxy.getCurrentUser(); if (sSystemServicesProxy.isSystemUser(currentUser)) { mImpl.toggleRecents(); mImpl.toggleRecents(growTarget); } else { if (mSystemToUserCallbacks != null) { IRecentsNonSystemUserCallbacks callbacks = mSystemToUserCallbacks.getNonSystemUserRecentsForUser(currentUser); if (callbacks != null) { try { callbacks.toggleRecents(); callbacks.toggleRecents(growTarget); } catch (RemoteException e) { Log.e(TAG, "Callback failed", e); } Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +45 −17 Original line number Diff line number Diff line Loading @@ -38,8 +38,10 @@ import android.util.MutableBoolean; import android.view.AppTransitionAnimationSpec; import android.view.LayoutInflater; import android.view.ViewConfiguration; import android.view.WindowManager; import com.android.internal.logging.MetricsLogger; import com.android.internal.policy.DockedDividerUtils; import com.android.systemui.R; import com.android.systemui.SystemUIApplication; import com.android.systemui.recents.events.EventBus; Loading Loading @@ -68,6 +70,7 @@ import com.android.systemui.recents.views.TaskStackView; import com.android.systemui.recents.views.TaskStackViewScroller; import com.android.systemui.recents.views.TaskViewHeader; import com.android.systemui.recents.views.TaskViewTransform; import com.android.systemui.stackdivider.DividerView; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.phone.NavigationBarGestureHelper; import com.android.systemui.statusbar.phone.PhoneStatusBar; Loading Loading @@ -156,7 +159,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // When this fires, then the user has not released alt-tab for at least // FAST_ALT_TAB_DELAY_MS milliseconds showRecents(mTriggeredFromAltTab, false /* draggingInRecents */, true /* animate */, false /* reloadTasks */, false /* fromHome */); false /* reloadTasks */, false /* fromHome */, DividerView.INVALID_RECENTS_GROW_TARGET); } }); Loading Loading @@ -230,7 +234,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } public void showRecents(boolean triggeredFromAltTab, boolean draggingInRecents, boolean animate, boolean launchedWhileDockingTask, boolean fromHome) { boolean animate, boolean launchedWhileDockingTask, boolean fromHome, int growTarget) { mTriggeredFromAltTab = triggeredFromAltTab; mDraggingInRecents = draggingInRecents; mLaunchedWhileDocking = launchedWhileDockingTask; Loading Loading @@ -260,7 +265,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask(); MutableBoolean isTopTaskHome = new MutableBoolean(true); if (topTask == null || !ssp.isRecentsTopMost(topTask, isTopTaskHome)) { startRecentsActivity(topTask, isTopTaskHome.value || fromHome, animate); startRecentsActivity(topTask, isTopTaskHome.value || fromHome, animate, growTarget); } } catch (ActivityNotFoundException e) { Log.e(TAG, "Failed to launch RecentsActivity", e); Loading @@ -284,7 +289,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener triggeredFromHomeKey)); } public void toggleRecents() { public void toggleRecents(int growTarget) { // Skip this toggle if we are already waiting to trigger recents via alt-tab if (mFastAltTabTrigger.isDozing()) { return; Loading Loading @@ -338,7 +343,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } // Otherwise, start the recents activity startRecentsActivity(topTask, isTopTaskHome.value, true /* animate */); startRecentsActivity(topTask, isTopTaskHome.value, true /* animate */, growTarget); // Only close the other system windows if we are actually showing recents ssp.sendCloseSystemWindows(BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS); Loading Loading @@ -369,7 +374,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // At this point, we don't know anything about the stack state. So only calculate // the dimensions of the thumbnail that we need for the transition into Recents, but // do not draw it until we construct the activity options when we start Recents updateHeaderBarLayout(stack); updateHeaderBarLayout(stack, null /* window rect override*/); } } } Loading Loading @@ -535,7 +540,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener dragMode == NavigationBarGestureHelper.DRAG_MODE_RECENTS, false /* animate */, true /* launchedWhileDockingTask*/, false /* fromHome */); false /* fromHome */, DividerView.INVALID_RECENTS_GROW_TARGET); } } Loading Loading @@ -574,12 +580,17 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * since the last call, it will attempt to re-measure and layout the header bar to the new size. * * @param stack the stack to initialize the stack layout with * @param windowRectOverride the rectangle to use when calculating the stack state which can * be different from the current window rect if recents is resizing * while being launched */ private void updateHeaderBarLayout(TaskStack stack) { private void updateHeaderBarLayout(TaskStack stack, Rect windowRectOverride) { SystemServicesProxy ssp = Recents.getSystemServices(); Rect systemInsets = new Rect(); ssp.getStableInsets(systemInsets); Rect windowRect = ssp.getWindowRect(); Rect windowRect = windowRectOverride != null ? new Rect(windowRectOverride) : ssp.getWindowRect(); // When docked, the nav bar insets are consumed and the activity is measured without insets. // However, the window bounds include the insets, so we need to subtract them here to make // them identical. Loading Loading @@ -682,7 +693,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * Creates the activity options for an app->recents transition. */ private ActivityOptions getThumbnailTransitionActivityOptions( ActivityManager.RunningTaskInfo topTask, TaskStackView stackView) { ActivityManager.RunningTaskInfo topTask, TaskStackView stackView, Rect windowOverrideRect) { if (topTask.stackId == FREEFORM_WORKSPACE_STACK_ID) { ArrayList<AppTransitionAnimationSpec> specs = new ArrayList<>(); ArrayList<Task> tasks = stackView.getStack().getStackTasks(); Loading @@ -696,7 +708,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener Task task = tasks.get(i); if (task.isFreeformTask()) { mTmpTransform = stackLayout.getStackTransformScreenCoordinates(task, stackScroller.getStackScroll(), mTmpTransform, null); stackScroller.getStackScroll(), mTmpTransform, null, windowOverrideRect); Bitmap thumbnail = drawThumbnailTransitionBitmap(task, mTmpTransform, mThumbTransitionBitmapCache); Rect toTaskRect = new Rect(); Loading @@ -711,7 +724,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } else { // Update the destination rect Task toTask = new Task(); TaskViewTransform toTransform = getThumbnailTransitionTransform(stackView, toTask); TaskViewTransform toTransform = getThumbnailTransitionTransform(stackView, toTask, windowOverrideRect); Bitmap thumbnail = drawThumbnailTransitionBitmap(toTask, toTransform, mThumbTransitionBitmapCache); if (thumbnail != null) { Loading @@ -729,7 +743,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * Returns the transition rect for the given task id. */ private TaskViewTransform getThumbnailTransitionTransform(TaskStackView stackView, Task runningTaskOut) { Task runningTaskOut, Rect windowOverrideRect) { // Find the running task in the TaskStack TaskStack stack = stackView.getStack(); Task launchTask = stack.getLaunchTarget(); Loading @@ -745,7 +759,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener stackView.updateLayoutAlgorithm(true /* boundScroll */); stackView.updateToInitialState(); stackView.getStackAlgorithm().getStackTransformScreenCoordinates(launchTask, stackView.getScroller().getStackScroll(), mTmpTransform, null); stackView.getScroller().getStackScroll(), mTmpTransform, null, windowOverrideRect); return mTmpTransform; } Loading Loading @@ -788,7 +802,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * Shows the recents activity */ protected void startRecentsActivity(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome, boolean animate) { boolean isTopTaskHome, boolean animate, int growTarget) { RecentsTaskLoader loader = Recents.getTaskLoader(); RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); Loading Loading @@ -820,7 +834,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener preloadIcon(topTask); // Update the header bar if necessary updateHeaderBarLayout(stack); Rect windowOverrideRect = getWindowRectOverride(growTarget); updateHeaderBarLayout(stack, windowOverrideRect); // Prepare the dummy stack for the transition TaskStackLayoutAlgorithm.VisibilityReport stackVr = Loading @@ -838,7 +853,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener ActivityOptions opts; if (useThumbnailTransition) { // Try starting with a thumbnail transition opts = getThumbnailTransitionActivityOptions(topTask, mDummyStackView); opts = getThumbnailTransitionActivityOptions(topTask, mDummyStackView, windowOverrideRect); } else { // If there is no thumbnail transition, but is launching from home into recents, then // use a quick home transition Loading @@ -850,6 +866,18 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener mLastToggleTime = SystemClock.elapsedRealtime(); } private Rect getWindowRectOverride(int growTarget) { if (growTarget == DividerView.INVALID_RECENTS_GROW_TARGET) { return null; } Rect result = new Rect(); Rect displayRect = Recents.getSystemServices().getDisplayRect(); DockedDividerUtils.calculateBoundsForPosition(growTarget, WindowManager.DOCKED_BOTTOM, result, displayRect.width(), displayRect.height(), Recents.getSystemServices().getDockedDividerSize(mContext)); return result; } /** * Starts the recents activity. */ Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImplProxy.java +7 −5 Original line number Diff line number Diff line Loading @@ -57,13 +57,15 @@ public class RecentsImplProxy extends IRecentsNonSystemUserCallbacks.Stub { @Override public void showRecents(boolean triggeredFromAltTab, boolean draggingInRecents, boolean animate, boolean reloadTasks, boolean fromHome) throws RemoteException { boolean reloadTasks, boolean fromHome, int growTarget) throws RemoteException { SomeArgs args = SomeArgs.obtain(); args.argi1 = triggeredFromAltTab ? 1 : 0; args.argi2 = draggingInRecents ? 1 : 0; args.argi3 = animate ? 1 : 0; args.argi4 = reloadTasks ? 1 : 0; args.argi5 = fromHome ? 1 : 0; args.argi6 = growTarget; mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_RECENTS, args)); } Loading @@ -75,8 +77,8 @@ public class RecentsImplProxy extends IRecentsNonSystemUserCallbacks.Stub { } @Override public void toggleRecents() throws RemoteException { mHandler.sendEmptyMessage(MSG_TOGGLE_RECENTS); public void toggleRecents(int growTarget) throws RemoteException { mHandler.sendMessage(mHandler.obtainMessage(MSG_TOGGLE_RECENTS, growTarget)); } @Override Loading Loading @@ -119,13 +121,13 @@ public class RecentsImplProxy extends IRecentsNonSystemUserCallbacks.Stub { case MSG_SHOW_RECENTS: SomeArgs args = (SomeArgs) msg.obj; mImpl.showRecents(args.argi1 != 0, args.argi2 != 0, args.argi3 != 0, args.argi4 != 0, args.argi5 != 0); args.argi4 != 0, args.argi5 != 0, args.argi6); break; case MSG_HIDE_RECENTS: mImpl.hideRecents(msg.arg1 != 0, msg.arg2 != 0); break; case MSG_TOGGLE_RECENTS: mImpl.toggleRecents(); mImpl.toggleRecents(msg.arg1); break; case MSG_ON_CONFIGURATION_CHANGED: mImpl.onConfigurationChanged(); Loading