Loading packages/SystemUI/res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -790,6 +790,10 @@ <!-- Recents: MultiStack add stack split custom radio button. [CHAR LIMIT=NONE] --> <string name="recents_multistack_add_stack_dialog_split_custom">Split Custom</string> <!-- Fully qualified activity class names to be blacklisted in Recents, add package names into overlay as needed --> <string-array name="recents_blacklist_array"> </string-array> <!-- Expanded Status Bar Header: Battery Charged [CHAR LIMIT=40] --> <string name="expanded_header_battery_charged">Charged</string> Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java +11 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ public class RecentsActivityLaunchState { public boolean launchedWithAltTab; public boolean launchedFromApp; public boolean launchedFromBlacklistedApp; public boolean launchedFromHome; public boolean launchedViaDragGesture; public boolean launchedViaDockGesture; Loading @@ -39,6 +40,7 @@ public class RecentsActivityLaunchState { public void reset() { launchedFromHome = false; launchedFromApp = false; launchedFromBlacklistedApp = false; launchedToTaskId = -1; launchedWithAltTab = false; launchedViaDragGesture = false; Loading @@ -53,8 +55,14 @@ public class RecentsActivityLaunchState { RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); if (launchedFromApp) { if (!launchState.launchedWithAltTab && debugFlags.isFastToggleRecentsEnabled()) { // If fast toggling, focus the front most task so that the next tap will focus the // N-1 task // If fast toggling, focus the front most task so that the next tap will launch the // task return numTasks - 1; } if (launchState.launchedFromBlacklistedApp) { // If we are launching from a blacklisted app, focus the front most task so that the // next tap will launch the task return numTasks - 1; } Loading @@ -67,7 +75,7 @@ public class RecentsActivityLaunchState { return -1; } // If coming from home, focus the first task // If coming from home, focus the front most task return numTasks - 1; } } Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +12 −4 Original line number Diff line number Diff line Loading @@ -807,8 +807,12 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener boolean isHomeStackVisible, boolean animate, int growTarget) { RecentsTaskLoader loader = Recents.getTaskLoader(); RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); SystemServicesProxy ssp = Recents.getSystemServices(); boolean isBlacklisted = (runningTask != null) ? ssp.isBlackListedActivity(runningTask.baseActivity.getClassName()) : false; int runningTaskId = !mLaunchedWhileDocking && (runningTask != null) int runningTaskId = !mLaunchedWhileDocking && !isBlacklisted && (runningTask != null) ? runningTask.id : -1; Loading @@ -825,11 +829,13 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener TaskStack stack = sInstanceLoadPlan.getTaskStack(); boolean hasRecentTasks = stack.getTaskCount() > 0; boolean useThumbnailTransition = (runningTask != null) && !isHomeStackVisible && hasRecentTasks; boolean useThumbnailTransition = (runningTask != null) && !isHomeStackVisible && hasRecentTasks; // Update the launch state that we need in updateHeaderBarLayout() launchState.launchedFromHome = !useThumbnailTransition && !mLaunchedWhileDocking; launchState.launchedFromApp = useThumbnailTransition || mLaunchedWhileDocking; launchState.launchedFromBlacklistedApp = launchState.launchedFromApp && isBlacklisted; launchState.launchedViaDockGesture = mLaunchedWhileDocking; launchState.launchedViaDragGesture = mDraggingInRecents; launchState.launchedToTaskId = runningTaskId; Loading Loading @@ -857,7 +863,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } ActivityOptions opts; if (useThumbnailTransition) { if (isBlacklisted) { opts = getUnknownTransitionActivityOptions(); } else if (useThumbnailTransition) { // Try starting with a thumbnail transition opts = getThumbnailTransitionActivityOptions(runningTask, mDummyStackView, windowOverrideRect); Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +10 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,9 @@ public class SystemServicesProxy { if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) { Collections.addAll(sRecentsBlacklist, res.getStringArray(R.array.recents_tv_blacklist_array)); } else { Collections.addAll(sRecentsBlacklist, res.getStringArray(R.array.recents_blacklist_array)); } } Loading @@ -260,6 +263,13 @@ public class SystemServicesProxy { return sSystemServicesProxy; } /** * @return whether the provided {@param className} is blacklisted */ public boolean isBlackListedActivity(String className) { return sRecentsBlacklist.contains(className); } /** * Returns a list of the recents tasks. * Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java +4 −1 Original line number Diff line number Diff line Loading @@ -556,7 +556,9 @@ public class TaskStackLayoutAlgorithm { Math.max(0, mUnfocusedRange.getAbsoluteX(maxBottomNormX))); boolean scrollToFront = launchState.launchedFromHome || launchState.launchedViaDockGesture; if (launchState.launchedWithAltTab) { if (launchState.launchedFromBlacklistedApp) { mInitialScrollP = mMaxScrollP; } else if (launchState.launchedWithAltTab) { mInitialScrollP = Utilities.clamp(launchTaskIndex, mMinScrollP, mMaxScrollP); } else if (scrollToFront) { mInitialScrollP = Utilities.clamp(launchTaskIndex, mMinScrollP, mMaxScrollP); Loading @@ -579,6 +581,7 @@ public class TaskStackLayoutAlgorithm { mTaskIndexOverrideMap.clear(); boolean scrollToFront = launchState.launchedFromHome || launchState.launchedFromBlacklistedApp || launchState.launchedViaDockGesture; if (getInitialFocusState() == STATE_UNFOCUSED && mNumStackTasks > 1) { if (ignoreScrollToFront || (!launchState.launchedWithAltTab && !scrollToFront)) { Loading Loading
packages/SystemUI/res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -790,6 +790,10 @@ <!-- Recents: MultiStack add stack split custom radio button. [CHAR LIMIT=NONE] --> <string name="recents_multistack_add_stack_dialog_split_custom">Split Custom</string> <!-- Fully qualified activity class names to be blacklisted in Recents, add package names into overlay as needed --> <string-array name="recents_blacklist_array"> </string-array> <!-- Expanded Status Bar Header: Battery Charged [CHAR LIMIT=40] --> <string name="expanded_header_battery_charged">Charged</string> Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java +11 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ public class RecentsActivityLaunchState { public boolean launchedWithAltTab; public boolean launchedFromApp; public boolean launchedFromBlacklistedApp; public boolean launchedFromHome; public boolean launchedViaDragGesture; public boolean launchedViaDockGesture; Loading @@ -39,6 +40,7 @@ public class RecentsActivityLaunchState { public void reset() { launchedFromHome = false; launchedFromApp = false; launchedFromBlacklistedApp = false; launchedToTaskId = -1; launchedWithAltTab = false; launchedViaDragGesture = false; Loading @@ -53,8 +55,14 @@ public class RecentsActivityLaunchState { RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); if (launchedFromApp) { if (!launchState.launchedWithAltTab && debugFlags.isFastToggleRecentsEnabled()) { // If fast toggling, focus the front most task so that the next tap will focus the // N-1 task // If fast toggling, focus the front most task so that the next tap will launch the // task return numTasks - 1; } if (launchState.launchedFromBlacklistedApp) { // If we are launching from a blacklisted app, focus the front most task so that the // next tap will launch the task return numTasks - 1; } Loading @@ -67,7 +75,7 @@ public class RecentsActivityLaunchState { return -1; } // If coming from home, focus the first task // If coming from home, focus the front most task return numTasks - 1; } } Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +12 −4 Original line number Diff line number Diff line Loading @@ -807,8 +807,12 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener boolean isHomeStackVisible, boolean animate, int growTarget) { RecentsTaskLoader loader = Recents.getTaskLoader(); RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); SystemServicesProxy ssp = Recents.getSystemServices(); boolean isBlacklisted = (runningTask != null) ? ssp.isBlackListedActivity(runningTask.baseActivity.getClassName()) : false; int runningTaskId = !mLaunchedWhileDocking && (runningTask != null) int runningTaskId = !mLaunchedWhileDocking && !isBlacklisted && (runningTask != null) ? runningTask.id : -1; Loading @@ -825,11 +829,13 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener TaskStack stack = sInstanceLoadPlan.getTaskStack(); boolean hasRecentTasks = stack.getTaskCount() > 0; boolean useThumbnailTransition = (runningTask != null) && !isHomeStackVisible && hasRecentTasks; boolean useThumbnailTransition = (runningTask != null) && !isHomeStackVisible && hasRecentTasks; // Update the launch state that we need in updateHeaderBarLayout() launchState.launchedFromHome = !useThumbnailTransition && !mLaunchedWhileDocking; launchState.launchedFromApp = useThumbnailTransition || mLaunchedWhileDocking; launchState.launchedFromBlacklistedApp = launchState.launchedFromApp && isBlacklisted; launchState.launchedViaDockGesture = mLaunchedWhileDocking; launchState.launchedViaDragGesture = mDraggingInRecents; launchState.launchedToTaskId = runningTaskId; Loading Loading @@ -857,7 +863,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } ActivityOptions opts; if (useThumbnailTransition) { if (isBlacklisted) { opts = getUnknownTransitionActivityOptions(); } else if (useThumbnailTransition) { // Try starting with a thumbnail transition opts = getThumbnailTransitionActivityOptions(runningTask, mDummyStackView, windowOverrideRect); Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +10 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,9 @@ public class SystemServicesProxy { if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) { Collections.addAll(sRecentsBlacklist, res.getStringArray(R.array.recents_tv_blacklist_array)); } else { Collections.addAll(sRecentsBlacklist, res.getStringArray(R.array.recents_blacklist_array)); } } Loading @@ -260,6 +263,13 @@ public class SystemServicesProxy { return sSystemServicesProxy; } /** * @return whether the provided {@param className} is blacklisted */ public boolean isBlackListedActivity(String className) { return sRecentsBlacklist.contains(className); } /** * Returns a list of the recents tasks. * Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java +4 −1 Original line number Diff line number Diff line Loading @@ -556,7 +556,9 @@ public class TaskStackLayoutAlgorithm { Math.max(0, mUnfocusedRange.getAbsoluteX(maxBottomNormX))); boolean scrollToFront = launchState.launchedFromHome || launchState.launchedViaDockGesture; if (launchState.launchedWithAltTab) { if (launchState.launchedFromBlacklistedApp) { mInitialScrollP = mMaxScrollP; } else if (launchState.launchedWithAltTab) { mInitialScrollP = Utilities.clamp(launchTaskIndex, mMinScrollP, mMaxScrollP); } else if (scrollToFront) { mInitialScrollP = Utilities.clamp(launchTaskIndex, mMinScrollP, mMaxScrollP); Loading @@ -579,6 +581,7 @@ public class TaskStackLayoutAlgorithm { mTaskIndexOverrideMap.clear(); boolean scrollToFront = launchState.launchedFromHome || launchState.launchedFromBlacklistedApp || launchState.launchedViaDockGesture; if (getInitialFocusState() == STATE_UNFOCUSED && mNumStackTasks > 1) { if (ignoreScrollToFront || (!launchState.launchedWithAltTab && !scrollToFront)) { Loading