Merge changes I222e50f6,I9832874d into nyc-dev
am: 6c83c7a
* commit '6c83c7aa5f84680ffd53d3e318279cbead8b1af5':
Removing legacy calculation of Recents visibility.
Adding additional dump logging to track down bugs.
Change-Id: I20c8aeb4b943284b2bee2b7d45d3530a5d6dfa06
This commit is contained in:
@@ -31,7 +31,6 @@ import android.os.BatteryStats;
|
||||
import android.os.IBinder;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
import android.util.Log;
|
||||
import com.android.internal.app.procstats.ProcessStats;
|
||||
import com.android.internal.os.TransferPipe;
|
||||
import com.android.internal.util.FastPrintWriter;
|
||||
@@ -63,7 +62,6 @@ import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Size;
|
||||
import android.util.Slog;
|
||||
|
||||
import org.xmlpull.v1.XmlSerializer;
|
||||
|
||||
@@ -2360,8 +2358,10 @@ public class ActivityManager {
|
||||
public String[] taskNames;
|
||||
public Rect[] taskBounds;
|
||||
public int[] taskUserIds;
|
||||
public ComponentName topActivity;
|
||||
public int displayId;
|
||||
public int userId;
|
||||
public boolean visible;
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
@@ -2388,6 +2388,13 @@ public class ActivityManager {
|
||||
dest.writeIntArray(taskUserIds);
|
||||
dest.writeInt(displayId);
|
||||
dest.writeInt(userId);
|
||||
dest.writeInt(visible ? 1 : 0);
|
||||
if (topActivity != null) {
|
||||
dest.writeInt(1);
|
||||
topActivity.writeToParcel(dest, 0);
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromParcel(Parcel source) {
|
||||
@@ -2410,6 +2417,10 @@ public class ActivityManager {
|
||||
taskUserIds = source.createIntArray();
|
||||
displayId = source.readInt();
|
||||
userId = source.readInt();
|
||||
visible = source.readInt() > 0;
|
||||
if (source.readInt() > 0) {
|
||||
topActivity = ComponentName.readFromParcel(source);
|
||||
}
|
||||
}
|
||||
|
||||
public static final Creator<StackInfo> CREATOR = new Creator<StackInfo>() {
|
||||
@@ -2445,6 +2456,10 @@ public class ActivityManager {
|
||||
sb.append(" bounds="); sb.append(taskBounds[i].toShortString());
|
||||
}
|
||||
sb.append(" userId=").append(taskUserIds[i]);
|
||||
sb.append(" visible=").append(visible);
|
||||
if (topActivity != null) {
|
||||
sb.append(" topActivity=").append(topActivity);
|
||||
}
|
||||
sb.append("\n");
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
@@ -423,25 +423,26 @@ public class Recents extends SystemUI
|
||||
|
||||
int currentUser = sSystemServicesProxy.getCurrentUser();
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask();
|
||||
ActivityManager.RunningTaskInfo runningTask = ssp.getRunningTask();
|
||||
boolean screenPinningActive = ssp.isScreenPinningActive();
|
||||
boolean isTopTaskHome = topTask != null && SystemServicesProxy.isHomeStack(topTask.stackId);
|
||||
if (topTask != null && !isTopTaskHome && !screenPinningActive) {
|
||||
logDockAttempt(mContext, topTask.topActivity, topTask.resizeMode);
|
||||
if (topTask.isDockable) {
|
||||
boolean isRunningTaskInHomeStack = runningTask != null &&
|
||||
SystemServicesProxy.isHomeStack(runningTask.stackId);
|
||||
if (runningTask != null && !isRunningTaskInHomeStack && !screenPinningActive) {
|
||||
logDockAttempt(mContext, runningTask.topActivity, runningTask.resizeMode);
|
||||
if (runningTask.isDockable) {
|
||||
if (metricsDockAction != -1) {
|
||||
MetricsLogger.action(mContext, metricsDockAction,
|
||||
topTask.topActivity.flattenToShortString());
|
||||
runningTask.topActivity.flattenToShortString());
|
||||
}
|
||||
if (sSystemServicesProxy.isSystemUser(currentUser)) {
|
||||
mImpl.dockTopTask(topTask.id, dragMode, stackCreateMode, initialBounds);
|
||||
mImpl.dockTopTask(runningTask.id, dragMode, stackCreateMode, initialBounds);
|
||||
} else {
|
||||
if (mSystemToUserCallbacks != null) {
|
||||
IRecentsNonSystemUserCallbacks callbacks =
|
||||
mSystemToUserCallbacks.getNonSystemUserRecentsForUser(currentUser);
|
||||
if (callbacks != null) {
|
||||
try {
|
||||
callbacks.dockTopTask(topTask.id, dragMode, stackCreateMode,
|
||||
callbacks.dockTopTask(runningTask.id, dragMode, stackCreateMode,
|
||||
initialBounds);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Callback failed", e);
|
||||
|
||||
@@ -169,7 +169,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
*/
|
||||
boolean dismissRecentsToFocusedTask(int logCategory) {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
|
||||
if (ssp.isRecentsActivityVisible()) {
|
||||
// If we have a focused Task, launch that Task now
|
||||
if (mRecentsView.launchFocusedTask(logCategory)) return true;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
*/
|
||||
boolean dismissRecentsToLaunchTargetTaskOrHome() {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
|
||||
if (ssp.isRecentsActivityVisible()) {
|
||||
// If we have a focused Task, launch that Task now
|
||||
if (mRecentsView.launchPreviousTask()) return true;
|
||||
// If none of the other cases apply, then just go Home
|
||||
@@ -195,7 +195,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
*/
|
||||
boolean dismissRecentsToFocusedTaskOrHome() {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
|
||||
if (ssp.isRecentsActivityVisible()) {
|
||||
// If we have a focused Task, launch that Task now
|
||||
if (mRecentsView.launchFocusedTask(0 /* logCategory */)) return true;
|
||||
// If none of the other cases apply, then just go Home
|
||||
@@ -236,7 +236,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
/** Dismisses Recents directly to Home if we currently aren't transitioning. */
|
||||
boolean dismissRecentsToHomeIfVisible(boolean animated) {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
|
||||
if (ssp.isRecentsActivityVisible()) {
|
||||
// Return to Home
|
||||
dismissRecentsToHome(animated);
|
||||
return true;
|
||||
@@ -448,7 +448,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
RecentsActivityLaunchState launchState = config.getLaunchState();
|
||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||
RecentsTaskLoadPlan loadPlan = loader.createLoadPlan(this);
|
||||
loader.preloadTasks(loadPlan, -1 /* topTaskId */, false /* isTopTaskHome */);
|
||||
loader.preloadTasks(loadPlan, -1 /* runningTaskId */, false /* isHomeStackVisible */);
|
||||
|
||||
RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options();
|
||||
loadOpts.numVisibleTasks = launchState.launchedNumVisibleTasks;
|
||||
@@ -777,6 +777,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
||||
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
|
||||
super.dump(prefix, fd, writer, args);
|
||||
EventBus.getDefault().dump(prefix, writer);
|
||||
Recents.getTaskLoader().dump(prefix, writer);
|
||||
|
||||
String id = Integer.toHexString(System.identityHashCode(this));
|
||||
|
||||
|
||||
@@ -108,11 +108,11 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
if (config.svelteLevel == RecentsConfiguration.SVELTE_NONE) {
|
||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
ActivityManager.RunningTaskInfo runningTaskInfo = ssp.getTopMostTask();
|
||||
ActivityManager.RunningTaskInfo runningTaskInfo = ssp.getRunningTask();
|
||||
|
||||
// Load the next task only if we aren't svelte
|
||||
RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext);
|
||||
loader.preloadTasks(plan, -1, true /* isTopTaskHome */);
|
||||
loader.preloadTasks(plan, -1, true /* isHomeStackVisible */);
|
||||
RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options();
|
||||
// This callback is made when a new activity is launched and the old one is paused
|
||||
// so ignore the current activity and try and preload the thumbnail for the
|
||||
@@ -189,7 +189,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
// We can use a new plan since the caches will be the same.
|
||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||
RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext);
|
||||
loader.preloadTasks(plan, -1, true /* isTopTaskHome */);
|
||||
loader.preloadTasks(plan, -1, true /* isHomeStackVisible */);
|
||||
RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options();
|
||||
launchOpts.numVisibleTasks = loader.getIconCacheSize();
|
||||
launchOpts.numVisibleTaskThumbnails = loader.getThumbnailCacheSize();
|
||||
@@ -262,10 +262,11 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
try {
|
||||
// Check if the top task is in the home stack, and start the recents activity
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask();
|
||||
MutableBoolean isTopTaskHome = new MutableBoolean(true);
|
||||
if (topTask == null || !ssp.isRecentsTopMost(topTask, isTopTaskHome)) {
|
||||
startRecentsActivity(topTask, isTopTaskHome.value || fromHome, animate, growTarget);
|
||||
MutableBoolean isHomeStackVisible = new MutableBoolean(false);
|
||||
if (!ssp.isRecentsActivityVisible(isHomeStackVisible)) {
|
||||
ActivityManager.RunningTaskInfo runningTask = ssp.getRunningTask();
|
||||
startRecentsActivity(runningTask, isHomeStackVisible.value || fromHome, animate,
|
||||
growTarget);
|
||||
}
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Log.e(TAG, "Failed to launch RecentsActivity", e);
|
||||
@@ -301,11 +302,10 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
|
||||
try {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask();
|
||||
MutableBoolean isTopTaskHome = new MutableBoolean(true);
|
||||
MutableBoolean isHomeStackVisible = new MutableBoolean(true);
|
||||
long elapsedTime = SystemClock.elapsedRealtime() - mLastToggleTime;
|
||||
|
||||
if (topTask != null && ssp.isRecentsTopMost(topTask, isTopTaskHome)) {
|
||||
if (ssp.isRecentsActivityVisible(isHomeStackVisible)) {
|
||||
RecentsDebugFlags debugFlags = Recents.getDebugFlags();
|
||||
RecentsConfiguration config = Recents.getConfiguration();
|
||||
RecentsActivityLaunchState launchState = config.getLaunchState();
|
||||
@@ -343,7 +343,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
}
|
||||
|
||||
// Otherwise, start the recents activity
|
||||
startRecentsActivity(topTask, isTopTaskHome.value, true /* animate */, growTarget);
|
||||
ActivityManager.RunningTaskInfo runningTask = ssp.getRunningTask();
|
||||
startRecentsActivity(runningTask, isHomeStackVisible.value, true /* animate */,
|
||||
growTarget);
|
||||
|
||||
// Only close the other system windows if we are actually showing recents
|
||||
ssp.sendCloseSystemWindows(BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
|
||||
@@ -358,18 +360,18 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
// Preload only the raw task list into a new load plan (which will be consumed by the
|
||||
// RecentsActivity) only if there is a task to animate to.
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask();
|
||||
MutableBoolean topTaskHome = new MutableBoolean(true);
|
||||
if (topTask != null && !ssp.isRecentsTopMost(topTask, topTaskHome)) {
|
||||
MutableBoolean isHomeStackVisible = new MutableBoolean(true);
|
||||
if (!ssp.isRecentsActivityVisible(isHomeStackVisible)) {
|
||||
ActivityManager.RunningTaskInfo runningTask = ssp.getRunningTask();
|
||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||
sInstanceLoadPlan = loader.createLoadPlan(mContext);
|
||||
sInstanceLoadPlan.preloadRawTasks(topTaskHome.value);
|
||||
loader.preloadTasks(sInstanceLoadPlan, topTask.id, topTaskHome.value);
|
||||
sInstanceLoadPlan.preloadRawTasks(isHomeStackVisible.value);
|
||||
loader.preloadTasks(sInstanceLoadPlan, runningTask.id, isHomeStackVisible.value);
|
||||
TaskStack stack = sInstanceLoadPlan.getTaskStack();
|
||||
if (stack.getTaskCount() > 0) {
|
||||
// Only preload the icon (but not the thumbnail since it may not have been taken for
|
||||
// the pausing activity)
|
||||
preloadIcon(topTask);
|
||||
preloadIcon(runningTask);
|
||||
|
||||
// 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
|
||||
@@ -398,25 +400,25 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||
RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext);
|
||||
loader.preloadTasks(plan, -1, true /* isTopTaskHome */);
|
||||
loader.preloadTasks(plan, -1, true /* isHomeStackVisible */);
|
||||
TaskStack focusedStack = plan.getTaskStack();
|
||||
|
||||
// Return early if there are no tasks in the focused stack
|
||||
if (focusedStack == null || focusedStack.getTaskCount() == 0) return;
|
||||
|
||||
ActivityManager.RunningTaskInfo runningTask = ssp.getTopMostTask();
|
||||
// Return early if there is no running task
|
||||
ActivityManager.RunningTaskInfo runningTask = ssp.getRunningTask();
|
||||
if (runningTask == null) return;
|
||||
|
||||
// Find the task in the recents list
|
||||
boolean isTopTaskHome = SystemServicesProxy.isHomeStack(runningTask.stackId);
|
||||
boolean isRunningTaskInHomeStack = SystemServicesProxy.isHomeStack(runningTask.stackId);
|
||||
ArrayList<Task> tasks = focusedStack.getStackTasks();
|
||||
Task toTask = null;
|
||||
ActivityOptions launchOpts = null;
|
||||
int taskCount = tasks.size();
|
||||
for (int i = taskCount - 1; i >= 1; i--) {
|
||||
Task task = tasks.get(i);
|
||||
if (isTopTaskHome) {
|
||||
if (isRunningTaskInHomeStack) {
|
||||
toTask = tasks.get(i - 1);
|
||||
launchOpts = ActivityOptions.makeCustomAnimation(mContext,
|
||||
R.anim.recents_launch_next_affiliated_task_target,
|
||||
@@ -450,14 +452,14 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||
RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext);
|
||||
loader.preloadTasks(plan, -1, true /* isTopTaskHome */);
|
||||
loader.preloadTasks(plan, -1, true /* isHomeStackVisible */);
|
||||
TaskStack focusedStack = plan.getTaskStack();
|
||||
|
||||
// Return early if there are no tasks in the focused stack
|
||||
if (focusedStack == null || focusedStack.getTaskCount() == 0) return;
|
||||
|
||||
ActivityManager.RunningTaskInfo runningTask = ssp.getTopMostTask();
|
||||
// Return early if there is no running task (can't determine affiliated tasks in this case)
|
||||
ActivityManager.RunningTaskInfo runningTask = ssp.getRunningTask();
|
||||
if (runningTask == null) return;
|
||||
// Return early if the running task is in the home stack (optimization)
|
||||
if (SystemServicesProxy.isHomeStack(runningTask.stackId)) return;
|
||||
@@ -693,9 +695,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
* Creates the activity options for an app->recents transition.
|
||||
*/
|
||||
private ActivityOptions getThumbnailTransitionActivityOptions(
|
||||
ActivityManager.RunningTaskInfo topTask, TaskStackView stackView,
|
||||
Rect windowOverrideRect) {
|
||||
if (topTask.stackId == FREEFORM_WORKSPACE_STACK_ID) {
|
||||
ActivityManager.RunningTaskInfo runningTask, TaskStackView stackView,
|
||||
Rect windowOverrideRect) {
|
||||
if (runningTask.stackId == FREEFORM_WORKSPACE_STACK_ID) {
|
||||
ArrayList<AppTransitionAnimationSpec> specs = new ArrayList<>();
|
||||
ArrayList<Task> tasks = stackView.getStack().getStackTasks();
|
||||
TaskStackLayoutAlgorithm stackLayout = stackView.getStackAlgorithm();
|
||||
@@ -801,8 +803,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
/**
|
||||
* Shows the recents activity
|
||||
*/
|
||||
protected void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,
|
||||
boolean isTopTaskHome, boolean animate, int growTarget) {
|
||||
protected void startRecentsActivity(ActivityManager.RunningTaskInfo runningTask,
|
||||
boolean isHomeStackVisible, boolean animate, int growTarget) {
|
||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
|
||||
|
||||
@@ -814,24 +816,24 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
sInstanceLoadPlan = loader.createLoadPlan(mContext);
|
||||
}
|
||||
if (mLaunchedWhileDocking || mTriggeredFromAltTab || !sInstanceLoadPlan.hasTasks()) {
|
||||
loader.preloadTasks(sInstanceLoadPlan, topTask.id, isTopTaskHome);
|
||||
loader.preloadTasks(sInstanceLoadPlan, runningTask.id, isHomeStackVisible);
|
||||
}
|
||||
|
||||
TaskStack stack = sInstanceLoadPlan.getTaskStack();
|
||||
boolean hasRecentTasks = stack.getTaskCount() > 0;
|
||||
boolean useThumbnailTransition = (topTask != null) && !isTopTaskHome && hasRecentTasks;
|
||||
boolean useThumbnailTransition = (runningTask != null) && !isHomeStackVisible && hasRecentTasks;
|
||||
|
||||
// Update the launch state that we need in updateHeaderBarLayout()
|
||||
launchState.launchedFromHome = !useThumbnailTransition;
|
||||
launchState.launchedFromApp = useThumbnailTransition || mLaunchedWhileDocking;
|
||||
launchState.launchedViaDockGesture = mLaunchedWhileDocking;
|
||||
launchState.launchedViaDragGesture = mDraggingInRecents;
|
||||
launchState.launchedToTaskId = (topTask != null) ? topTask.id : -1;
|
||||
launchState.launchedToTaskId = (runningTask != null) ? runningTask.id : -1;
|
||||
launchState.launchedWithAltTab = mTriggeredFromAltTab;
|
||||
|
||||
// Preload the icon (this will be a null-op if we have preloaded the icon already in
|
||||
// preloadRecents())
|
||||
preloadIcon(topTask);
|
||||
preloadIcon(runningTask);
|
||||
|
||||
// Update the header bar if necessary
|
||||
Rect windowOverrideRect = getWindowRectOverride(growTarget);
|
||||
@@ -853,7 +855,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
||||
ActivityOptions opts;
|
||||
if (useThumbnailTransition) {
|
||||
// Try starting with a thumbnail transition
|
||||
opts = getThumbnailTransitionActivityOptions(topTask, mDummyStackView,
|
||||
opts = getThumbnailTransitionActivityOptions(runningTask, mDummyStackView,
|
||||
windowOverrideRect);
|
||||
} else {
|
||||
// If there is no thumbnail transition, but is launching from home into recents, then
|
||||
|
||||
@@ -38,7 +38,6 @@ import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.IPackageManager;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
@@ -251,9 +250,14 @@ public class SystemServicesProxy {
|
||||
return sSystemServicesProxy;
|
||||
}
|
||||
|
||||
/** Returns a list of the recents tasks */
|
||||
/**
|
||||
* Returns a list of the recents tasks.
|
||||
*
|
||||
* @param isHomeStackVisible whether or not the home stack is currently visible. If it is
|
||||
* visible, then we ignore all excluded tasks (even the first one).
|
||||
*/
|
||||
public List<ActivityManager.RecentTaskInfo> getRecentTasks(int numLatestTasks, int userId,
|
||||
boolean isTopTaskHome, ArraySet<Integer> quietProfileIds) {
|
||||
boolean isHomeStackVisible, ArraySet<Integer> quietProfileIds) {
|
||||
if (mAm == null) return null;
|
||||
|
||||
// If we are mocking, then create some recent tasks
|
||||
@@ -320,7 +324,7 @@ public class SystemServicesProxy {
|
||||
boolean isBlackListed = sRecentsBlacklist.contains(t.realActivity.getClassName());
|
||||
// Filter out recent tasks from managed profiles which are in quiet mode.
|
||||
isExcluded |= quietProfileIds.contains(t.userId);
|
||||
if (isBlackListed || (isExcluded && (isTopTaskHome || !isFirstValidTask))) {
|
||||
if (isBlackListed || (isExcluded && (isHomeStackVisible || !isFirstValidTask))) {
|
||||
iter.remove();
|
||||
continue;
|
||||
}
|
||||
@@ -330,21 +334,50 @@ public class SystemServicesProxy {
|
||||
return tasks.subList(0, Math.min(tasks.size(), numLatestTasks));
|
||||
}
|
||||
|
||||
/** Returns a list of the running tasks */
|
||||
private List<ActivityManager.RunningTaskInfo> getRunningTasks(int numTasks) {
|
||||
if (mAm == null) return null;
|
||||
return mAm.getRunningTasks(numTasks);
|
||||
}
|
||||
|
||||
/** Returns the top task. */
|
||||
public ActivityManager.RunningTaskInfo getTopMostTask() {
|
||||
List<ActivityManager.RunningTaskInfo> tasks = getRunningTasks(1);
|
||||
/**
|
||||
* Returns the top running task.
|
||||
*/
|
||||
public ActivityManager.RunningTaskInfo getRunningTask() {
|
||||
List<ActivityManager.RunningTaskInfo> tasks = mAm.getRunningTasks(1);
|
||||
if (tasks != null && !tasks.isEmpty()) {
|
||||
return tasks.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the recents activity is currently visible.
|
||||
*/
|
||||
public boolean isRecentsActivityVisible() {
|
||||
return isRecentsActivityVisible(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the recents activity is currently visible.
|
||||
*
|
||||
* @param isHomeStackVisible if provided, will return whether the home stack is visible
|
||||
* regardless of the recents visibility
|
||||
*/
|
||||
public boolean isRecentsActivityVisible(MutableBoolean isHomeStackVisible) {
|
||||
if (mIam == null) return false;
|
||||
|
||||
try {
|
||||
ActivityManager.StackInfo stackInfo = mIam.getStackInfo(
|
||||
ActivityManager.StackId.HOME_STACK_ID);
|
||||
ComponentName topActivity = stackInfo.topActivity;
|
||||
if (isHomeStackVisible != null) {
|
||||
isHomeStackVisible.value = stackInfo.visible;
|
||||
}
|
||||
return (stackInfo.visible && topActivity != null
|
||||
&& topActivity.getPackageName().equals(RecentsImpl.RECENTS_PACKAGE)
|
||||
&& (topActivity.getClassName().equals(RecentsImpl.RECENTS_ACTIVITY)
|
||||
|| topActivity.getClassName().equals(RecentsTvImpl.RECENTS_TV_ACTIVITY)));
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this device has freeform workspaces.
|
||||
*/
|
||||
@@ -359,56 +392,6 @@ public class SystemServicesProxy {
|
||||
return mIsSafeMode;
|
||||
}
|
||||
|
||||
/** Returns whether the recents is currently running */
|
||||
public boolean isRecentsTopMost(ActivityManager.RunningTaskInfo topTask,
|
||||
MutableBoolean isHomeTopMost) {
|
||||
if (topTask != null) {
|
||||
ComponentName topActivity = topTask.topActivity;
|
||||
|
||||
// Check if the front most activity is recents
|
||||
if ((topActivity.getPackageName().equals(RecentsImpl.RECENTS_PACKAGE) &&
|
||||
(topActivity.getClassName().equals(RecentsImpl.RECENTS_ACTIVITY) ||
|
||||
topActivity.getClassName().equals(RecentsTvImpl.RECENTS_TV_ACTIVITY)))) {
|
||||
if (isHomeTopMost != null) {
|
||||
isHomeTopMost.value = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Note, this is only valid because we currently only allow the recents and home
|
||||
// activities in the home stack
|
||||
if (isHomeTopMost != null) {
|
||||
isHomeTopMost.value = SystemServicesProxy.isHomeStack(topTask.stackId);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get the bounds of a task. */
|
||||
public Rect getTaskBounds(int taskId) {
|
||||
if (mIam == null) return null;
|
||||
|
||||
try {
|
||||
return mIam.getTaskBounds(taskId);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes the given task to the new bounds.
|
||||
*/
|
||||
public void resizeTask(int taskId, Rect bounds) {
|
||||
if (mIam == null) return;
|
||||
|
||||
try {
|
||||
mIam.resizeTask(taskId, bounds, ActivityManager.RESIZE_MODE_FORCED);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/** Docks a task to the side of the screen and starts it. */
|
||||
public void startTaskInDockedMode(int taskId, int createMode) {
|
||||
if (mIam == null) return;
|
||||
@@ -439,18 +422,6 @@ public class SystemServicesProxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Returns the focused stack id. */
|
||||
public int getFocusedStack() {
|
||||
if (mIam == null) return -1;
|
||||
|
||||
try {
|
||||
return mIam.getFocusedStackId();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the given stack id is the home stack id.
|
||||
*/
|
||||
@@ -515,6 +486,16 @@ public class SystemServicesProxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the device has a transposed nav bar (on the right of the screen) in the
|
||||
* current display orientation.
|
||||
*/
|
||||
public boolean hasTransposedNavigationBar() {
|
||||
Rect insets = new Rect();
|
||||
getStableInsets(insets);
|
||||
return insets.right > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels the current window transtion to/from Recents for the given task id.
|
||||
*/
|
||||
@@ -613,19 +594,6 @@ public class SystemServicesProxy {
|
||||
}
|
||||
}
|
||||
|
||||
/** Moves a task to the front with the specified activity options. */
|
||||
public void moveTaskToFront(int taskId, ActivityOptions opts) {
|
||||
if (mAm == null) return;
|
||||
if (RecentsDebugFlags.Static.EnableMockTasks) return;
|
||||
|
||||
if (opts != null) {
|
||||
mAm.moveTaskToFront(taskId, ActivityManager.MOVE_TASK_WITH_HOME,
|
||||
opts.toBundle());
|
||||
} else {
|
||||
mAm.moveTaskToFront(taskId, ActivityManager.MOVE_TASK_WITH_HOME);
|
||||
}
|
||||
}
|
||||
|
||||
/** Removes the task */
|
||||
public void removeTask(final int taskId) {
|
||||
if (mAm == null) return;
|
||||
@@ -1082,16 +1050,6 @@ public class SystemServicesProxy {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the device has a transposed nav bar (on the right of the screen) in the
|
||||
* current display orientation.
|
||||
*/
|
||||
public boolean hasTransposedNavBar() {
|
||||
Rect insets = new Rect();
|
||||
getStableInsets(insets);
|
||||
return insets.right > 0;
|
||||
}
|
||||
|
||||
private final class H extends Handler {
|
||||
private static final int ON_TASK_STACK_CHANGED = 1;
|
||||
private static final int ON_ACTIVITY_PINNED = 2;
|
||||
|
||||
@@ -100,12 +100,12 @@ public class RecentsTaskLoadPlan {
|
||||
* An optimization to preload the raw list of tasks. The raw tasks are saved in least-recent
|
||||
* to most-recent order.
|
||||
*/
|
||||
public synchronized void preloadRawTasks(boolean isTopTaskHome) {
|
||||
public synchronized void preloadRawTasks(boolean isHomeStackVisible) {
|
||||
int currentUserId = UserHandle.USER_CURRENT;
|
||||
updateCurrentQuietProfilesCache(currentUserId);
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
mRawTasks = ssp.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(),
|
||||
currentUserId, isTopTaskHome, mCurrentQuietProfiles);
|
||||
currentUserId, isHomeStackVisible, mCurrentQuietProfiles);
|
||||
|
||||
// Since the raw tasks are given in most-recent to least-recent order, we need to reverse it
|
||||
Collections.reverse(mRawTasks);
|
||||
@@ -120,12 +120,12 @@ public class RecentsTaskLoadPlan {
|
||||
* - least-recent to most-recent stack tasks
|
||||
* - least-recent to most-recent freeform tasks
|
||||
*/
|
||||
public synchronized void preloadPlan(RecentsTaskLoader loader, int topTaskId,
|
||||
boolean isTopTaskHome) {
|
||||
public synchronized void preloadPlan(RecentsTaskLoader loader, int runningTaskId,
|
||||
boolean isHomeStackVisible) {
|
||||
Resources res = mContext.getResources();
|
||||
ArrayList<Task> allTasks = new ArrayList<>();
|
||||
if (mRawTasks == null) {
|
||||
preloadRawTasks(isTopTaskHome);
|
||||
preloadRawTasks(isHomeStackVisible);
|
||||
}
|
||||
|
||||
SparseArray<Task.TaskKey> affiliatedTasks = new SparseArray<>();
|
||||
@@ -182,7 +182,7 @@ public class RecentsTaskLoadPlan {
|
||||
boolean isFreeformTask = SystemServicesProxy.isFreeformStack(t.stackId);
|
||||
boolean isStackTask = isFreeformTask || (!isHistoricalTask(t) ||
|
||||
(t.lastActiveTime >= lastStackActiveTime && i >= (taskCount - MIN_NUM_TASKS)));
|
||||
boolean isLaunchTarget = taskKey.id == topTaskId;
|
||||
boolean isLaunchTarget = taskKey.id == runningTaskId;
|
||||
if (isStackTask && newLastStackActiveTime < 0) {
|
||||
newLastStackActiveTime = t.lastActiveTime;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ public class RecentsTaskLoadPlan {
|
||||
Drawable icon = isStackTask
|
||||
? loader.getAndUpdateActivityIcon(taskKey, t.taskDescription, res, false)
|
||||
: null;
|
||||
Bitmap thumbnail = loader.getAndUpdateThumbnail(taskKey, false);
|
||||
Bitmap thumbnail = loader.getAndUpdateThumbnail(taskKey, false /* loadIfNotCached */);
|
||||
int activityColor = loader.getActivityPrimaryColor(t.taskDescription);
|
||||
int backgroundColor = loader.getActivityBackgroundColor(t.taskDescription);
|
||||
boolean isSystemApp = (info != null) &&
|
||||
@@ -256,7 +256,8 @@ public class RecentsTaskLoadPlan {
|
||||
if (opts.loadThumbnails && (isRunningTask || isVisibleThumbnail)) {
|
||||
if (task.thumbnail == null || isRunningTask) {
|
||||
if (config.svelteLevel <= RecentsConfiguration.SVELTE_LIMIT_CACHE) {
|
||||
task.thumbnail = loader.getAndUpdateThumbnail(taskKey, true);
|
||||
task.thumbnail = loader.getAndUpdateThumbnail(taskKey,
|
||||
true /* loadIfNotCached */);
|
||||
} else if (config.svelteLevel == RecentsConfiguration.SVELTE_DISABLE_CACHE) {
|
||||
loadQueue.addTask(task);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,9 @@ import com.android.systemui.recents.RecentsConfiguration;
|
||||
import com.android.systemui.recents.RecentsDebugFlags;
|
||||
import com.android.systemui.recents.events.activity.PackagesChangedEvent;
|
||||
import com.android.systemui.recents.misc.SystemServicesProxy;
|
||||
import com.android.systemui.recents.misc.Utilities;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
@@ -331,8 +333,9 @@ public class RecentsTaskLoader {
|
||||
}
|
||||
|
||||
/** Preloads recents tasks using the specified plan to store the output. */
|
||||
public void preloadTasks(RecentsTaskLoadPlan plan, int topTaskId, boolean isTopTaskHome) {
|
||||
plan.preloadPlan(this, topTaskId, isTopTaskHome);
|
||||
public void preloadTasks(RecentsTaskLoadPlan plan, int runningTaskId,
|
||||
boolean isHomeStackVisible) {
|
||||
plan.preloadPlan(this, runningTaskId, isHomeStackVisible);
|
||||
}
|
||||
|
||||
/** Begins loading the heavy task data according to the specified options. */
|
||||
@@ -624,4 +627,14 @@ public class RecentsTaskLoader {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dump(String prefix, PrintWriter writer) {
|
||||
String innerPrefix = prefix + " ";
|
||||
|
||||
writer.print(prefix); writer.println(TAG);
|
||||
writer.print(prefix); writer.println("Icon Cache");
|
||||
mIconCache.dump(innerPrefix, writer);
|
||||
writer.print(prefix); writer.println("Thumbnail Cache");
|
||||
mThumbnailCache.dump(innerPrefix, writer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,9 +338,18 @@ public class Task {
|
||||
|
||||
public void dump(String prefix, PrintWriter writer) {
|
||||
writer.print(prefix); writer.print(key);
|
||||
if (affiliationTaskId != key.id) {
|
||||
if (isAffiliatedTask()) {
|
||||
writer.print(" "); writer.print("affTaskId=" + affiliationTaskId);
|
||||
}
|
||||
if (!isDockable) {
|
||||
writer.print(" dockable=N");
|
||||
}
|
||||
if (isLaunchTarget) {
|
||||
writer.print(" launchTarget=Y");
|
||||
}
|
||||
if (isFreeformTask()) {
|
||||
writer.print(" freeform=Y");
|
||||
}
|
||||
writer.print(" "); writer.print(title);
|
||||
writer.println();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ import android.util.Log;
|
||||
import android.util.LruCache;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* A mapping of {@link Task.TaskKey} to value, with additional LRU functionality where the least
|
||||
* recently referenced key/values will be evicted as more values than the given cache size are
|
||||
@@ -112,4 +115,16 @@ public class TaskKeyLruCache<V> {
|
||||
final void trimToSize(int cacheSize) {
|
||||
mCache.trimToSize(cacheSize);
|
||||
}
|
||||
|
||||
public void dump(String prefix, PrintWriter writer) {
|
||||
String innerPrefix = prefix + " ";
|
||||
|
||||
writer.print(prefix); writer.print(TAG);
|
||||
writer.print(" numEntries="); writer.print(mKeys.size());
|
||||
writer.println();
|
||||
int keyCount = mKeys.size();
|
||||
for (int i = 0; i < keyCount; i++) {
|
||||
writer.print(innerPrefix); writer.println(mKeys.get(mKeys.keyAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener {
|
||||
|
||||
boolean dismissRecentsToLaunchTargetTaskOrHome(boolean animate) {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
|
||||
if (ssp.isRecentsActivityVisible()) {
|
||||
// If we have a focused Task, launch that Task now
|
||||
if (mRecentsView.launchPreviousTask(animate)) {
|
||||
return true;
|
||||
@@ -230,7 +230,7 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener {
|
||||
|
||||
boolean dismissRecentsToFocusedTaskOrHome() {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
|
||||
if (ssp.isRecentsActivityVisible()) {
|
||||
// If we have a focused Task, launch that Task now
|
||||
if (mRecentsView.launchFocusedTask()) return true;
|
||||
// If none of the other cases apply, then just go Home
|
||||
@@ -263,7 +263,7 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener {
|
||||
|
||||
boolean dismissRecentsToHomeIfVisible(boolean animated) {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
|
||||
if (ssp.isRecentsActivityVisible()) {
|
||||
// Return to Home
|
||||
dismissRecentsToHome(animated);
|
||||
return true;
|
||||
|
||||
@@ -48,8 +48,8 @@ public class RecentsTvImpl extends RecentsImpl{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,
|
||||
boolean isTopTaskHome, boolean animate, int growTarget) {
|
||||
protected void startRecentsActivity(ActivityManager.RunningTaskInfo runningTask,
|
||||
boolean isHomeStackVisible, boolean animate, int growTarget) {
|
||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||
|
||||
// In the case where alt-tab is triggered, we never get a preloadRecents() call, so we
|
||||
@@ -60,25 +60,25 @@ public class RecentsTvImpl extends RecentsImpl{
|
||||
sInstanceLoadPlan = loader.createLoadPlan(mContext);
|
||||
}
|
||||
if (mTriggeredFromAltTab || !sInstanceLoadPlan.hasTasks()) {
|
||||
loader.preloadTasks(sInstanceLoadPlan, topTask.id, isTopTaskHome);
|
||||
loader.preloadTasks(sInstanceLoadPlan, runningTask.id, isHomeStackVisible);
|
||||
}
|
||||
TaskStack stack = sInstanceLoadPlan.getTaskStack();
|
||||
|
||||
if (!animate) {
|
||||
ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext, -1, -1);
|
||||
startRecentsActivity(topTask, opts, false /* fromHome */, false /* fromThumbnail*/);
|
||||
startRecentsActivity(runningTask, opts, false /* fromHome */, false /* fromThumbnail*/);
|
||||
return;
|
||||
}
|
||||
|
||||
boolean hasRecentTasks = stack.getTaskCount() > 0;
|
||||
boolean useThumbnailTransition = (topTask != null) && !isTopTaskHome && hasRecentTasks;
|
||||
boolean useThumbnailTransition = (runningTask != null) && !isHomeStackVisible && hasRecentTasks;
|
||||
|
||||
if (useThumbnailTransition) {
|
||||
// Try starting with a thumbnail transition
|
||||
ActivityOptions opts = getThumbnailTransitionActivityOptionsForTV(topTask,
|
||||
ActivityOptions opts = getThumbnailTransitionActivityOptionsForTV(runningTask,
|
||||
stack.getTaskCount());
|
||||
if (opts != null) {
|
||||
startRecentsActivity(topTask, opts, false /* fromHome */, true /* fromThumbnail */);
|
||||
startRecentsActivity(runningTask, opts, false /* fromHome */, true /* fromThumbnail */);
|
||||
} else {
|
||||
// Fall through below to the non-thumbnail transition
|
||||
useThumbnailTransition = false;
|
||||
@@ -86,19 +86,19 @@ public class RecentsTvImpl extends RecentsImpl{
|
||||
}
|
||||
|
||||
if (!useThumbnailTransition) {
|
||||
startRecentsActivity(topTask, null, true /* fromHome */, false /* fromThumbnail */);
|
||||
startRecentsActivity(runningTask, null, true /* fromHome */, false /* fromThumbnail */);
|
||||
}
|
||||
mLastToggleTime = SystemClock.elapsedRealtime();
|
||||
}
|
||||
|
||||
protected void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,
|
||||
protected void startRecentsActivity(ActivityManager.RunningTaskInfo runningTask,
|
||||
ActivityOptions opts, boolean fromHome, boolean fromThumbnail) {
|
||||
// Update the configuration based on the launch options
|
||||
RecentsConfiguration config = Recents.getConfiguration();
|
||||
RecentsActivityLaunchState launchState = config.getLaunchState();
|
||||
launchState.launchedFromHome = fromHome;
|
||||
launchState.launchedFromApp = fromThumbnail;
|
||||
launchState.launchedToTaskId = (topTask != null) ? topTask.id : -1;
|
||||
launchState.launchedToTaskId = (runningTask != null) ? runningTask.id : -1;
|
||||
launchState.launchedWithAltTab = mTriggeredFromAltTab;
|
||||
|
||||
Intent intent = new Intent();
|
||||
@@ -119,10 +119,10 @@ public class RecentsTvImpl extends RecentsImpl{
|
||||
* Creates the activity options for an app->recents transition on TV.
|
||||
*/
|
||||
private ActivityOptions getThumbnailTransitionActivityOptionsForTV(
|
||||
ActivityManager.RunningTaskInfo topTask, int numTasks) {
|
||||
ActivityManager.RunningTaskInfo runningTask, int numTasks) {
|
||||
Rect rect = TaskCardView.getStartingCardThumbnailRect(mContext, numTasks);
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
ThumbnailData thumbnailData = ssp.getTaskThumbnail(topTask.id);
|
||||
ThumbnailData thumbnailData = ssp.getTaskThumbnail(runningTask.id);
|
||||
if (thumbnailData.thumbnail != null) {
|
||||
Bitmap thumbnail = Bitmap.createScaledBitmap(thumbnailData.thumbnail, rect.width(),
|
||||
rect.height(), false);
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.android.systemui.recents.events.activity.DismissRecentsToHomeAnimatio
|
||||
import com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent;
|
||||
import com.android.systemui.recents.events.ui.DismissAllTaskViewsEvent;
|
||||
import com.android.systemui.recents.events.activity.MultiWindowStateChangedEvent;
|
||||
import com.android.systemui.recents.misc.SystemServicesProxy;
|
||||
|
||||
/** Manages the scrims for the various system bars. */
|
||||
public class SystemBarScrimViews {
|
||||
@@ -51,7 +50,7 @@ public class SystemBarScrimViews {
|
||||
mNavBarScrimView.forceHasOverlappingRendering(false);
|
||||
mNavBarScrimEnterDuration = activity.getResources().getInteger(
|
||||
R.integer.recents_nav_bar_scrim_enter_duration);
|
||||
mHasNavBarScrim = Recents.getSystemServices().hasTransposedNavBar();
|
||||
mHasNavBarScrim = Recents.getSystemServices().hasTransposedNavigationBar();
|
||||
mHasDockedTasks = Recents.getSystemServices().hasDockedTask();
|
||||
}
|
||||
|
||||
@@ -145,7 +144,7 @@ public class SystemBarScrimViews {
|
||||
|
||||
public final void onBusEvent(ConfigurationChangedEvent event) {
|
||||
if (event.fromDeviceOrientationChange) {
|
||||
mHasNavBarScrim = Recents.getSystemServices().hasTransposedNavBar();
|
||||
mHasNavBarScrim = Recents.getSystemServices().hasTransposedNavigationBar();
|
||||
}
|
||||
animateScrimToCurrentNavBarState(event.hasStackTasks);
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
updateDockSide();
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
if (mDockSide != WindowManager.DOCKED_INVALID
|
||||
&& !ssp.isRecentsTopMost(ssp.getTopMostTask(), null /* isTopHome */)) {
|
||||
&& !ssp.isRecentsActivityVisible()) {
|
||||
mWindowManagerProxy.swapTasks();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ public class CarStatusBar extends PhoneStatusBar implements
|
||||
@Override
|
||||
public void onTaskStackChanged() {
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
ActivityManager.RunningTaskInfo runningTaskInfo = ssp.getTopMostTask();
|
||||
ActivityManager.RunningTaskInfo runningTaskInfo = ssp.getRunningTask();
|
||||
mController.taskChanged(runningTaskInfo.baseActivity.getPackageName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ import android.app.IActivityContainer;
|
||||
import android.app.IActivityContainerCallback;
|
||||
import android.app.IActivityManager;
|
||||
import android.app.IActivityManager.WaitResult;
|
||||
import android.app.KeyguardManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.ProfilerInfo;
|
||||
import android.app.ResultInfo;
|
||||
import android.app.StatusBarManager;
|
||||
@@ -40,7 +38,6 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.IIntentSender;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
@@ -171,6 +168,7 @@ import static com.android.server.am.ActivityStack.ActivityState.RESUMED;
|
||||
import static com.android.server.am.ActivityStack.ActivityState.STOPPED;
|
||||
import static com.android.server.am.ActivityStack.ActivityState.STOPPING;
|
||||
import static com.android.server.am.ActivityStack.STACK_INVISIBLE;
|
||||
import static com.android.server.am.ActivityStack.STACK_VISIBLE;
|
||||
import static com.android.server.am.TaskRecord.LOCK_TASK_AUTH_DONT_LOCK;
|
||||
import static com.android.server.am.TaskRecord.LOCK_TASK_AUTH_LAUNCHABLE;
|
||||
import static com.android.server.am.TaskRecord.LOCK_TASK_AUTH_LAUNCHABLE_PRIV;
|
||||
@@ -3400,6 +3398,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
info.displayId = Display.DEFAULT_DISPLAY;
|
||||
info.stackId = stack.mStackId;
|
||||
info.userId = stack.mCurrentUser;
|
||||
info.visible = stack.getStackVisibilityLocked(null) == STACK_VISIBLE;
|
||||
|
||||
ArrayList<TaskRecord> tasks = stack.getAllTasks();
|
||||
final int numTasks = tasks.size();
|
||||
@@ -3422,6 +3421,9 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
info.taskNames = taskNames;
|
||||
info.taskBounds = taskBounds;
|
||||
info.taskUserIds = taskUserIds;
|
||||
|
||||
final ActivityRecord top = stack.topRunningActivityLocked();
|
||||
info.topActivity = top != null ? top.intent.getComponent() : null;
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user