Merge "Mark occluded home stack as invisible." into nyc-dev am: 32b54f2e42
am: 6e2ee9e382
* commit '6e2ee9e382dd86340d5242fe04a623b9cda10f6e':
Mark occluded home stack as invisible.
Change-Id: I1762cf46b675fe2c5151332a53139e95d676cb01
This commit is contained in:
@@ -2370,6 +2370,8 @@ public class ActivityManager {
|
|||||||
public int displayId;
|
public int displayId;
|
||||||
public int userId;
|
public int userId;
|
||||||
public boolean visible;
|
public boolean visible;
|
||||||
|
// Index of the stack in the display's stack list, can be used for comparison of stack order
|
||||||
|
public int position;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
@@ -2397,6 +2399,7 @@ public class ActivityManager {
|
|||||||
dest.writeInt(displayId);
|
dest.writeInt(displayId);
|
||||||
dest.writeInt(userId);
|
dest.writeInt(userId);
|
||||||
dest.writeInt(visible ? 1 : 0);
|
dest.writeInt(visible ? 1 : 0);
|
||||||
|
dest.writeInt(position);
|
||||||
if (topActivity != null) {
|
if (topActivity != null) {
|
||||||
dest.writeInt(1);
|
dest.writeInt(1);
|
||||||
topActivity.writeToParcel(dest, 0);
|
topActivity.writeToParcel(dest, 0);
|
||||||
@@ -2426,6 +2429,7 @@ public class ActivityManager {
|
|||||||
displayId = source.readInt();
|
displayId = source.readInt();
|
||||||
userId = source.readInt();
|
userId = source.readInt();
|
||||||
visible = source.readInt() > 0;
|
visible = source.readInt() > 0;
|
||||||
|
position = source.readInt();
|
||||||
if (source.readInt() > 0) {
|
if (source.readInt() > 0) {
|
||||||
topActivity = ComponentName.readFromParcel(source);
|
topActivity = ComponentName.readFromParcel(source);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,11 +371,19 @@ public class SystemServicesProxy {
|
|||||||
try {
|
try {
|
||||||
ActivityManager.StackInfo stackInfo = mIam.getStackInfo(
|
ActivityManager.StackInfo stackInfo = mIam.getStackInfo(
|
||||||
ActivityManager.StackId.HOME_STACK_ID);
|
ActivityManager.StackId.HOME_STACK_ID);
|
||||||
|
ActivityManager.StackInfo fullscreenStackInfo = mIam.getStackInfo(
|
||||||
|
ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID);
|
||||||
ComponentName topActivity = stackInfo.topActivity;
|
ComponentName topActivity = stackInfo.topActivity;
|
||||||
if (isHomeStackVisible != null) {
|
boolean homeStackVisibleNotOccluded = stackInfo.visible;
|
||||||
isHomeStackVisible.value = stackInfo.visible;
|
if (fullscreenStackInfo != null) {
|
||||||
|
boolean isFullscreenStackOccludingHome = fullscreenStackInfo.visible &&
|
||||||
|
fullscreenStackInfo.position > stackInfo.position;
|
||||||
|
homeStackVisibleNotOccluded &= !isFullscreenStackOccludingHome;
|
||||||
}
|
}
|
||||||
return (stackInfo.visible && topActivity != null
|
if (isHomeStackVisible != null) {
|
||||||
|
isHomeStackVisible.value = homeStackVisibleNotOccluded;
|
||||||
|
}
|
||||||
|
return (homeStackVisibleNotOccluded && topActivity != null
|
||||||
&& topActivity.getPackageName().equals(RecentsImpl.RECENTS_PACKAGE)
|
&& topActivity.getPackageName().equals(RecentsImpl.RECENTS_PACKAGE)
|
||||||
&& (topActivity.getClassName().equals(RecentsImpl.RECENTS_ACTIVITY)
|
&& (topActivity.getClassName().equals(RecentsImpl.RECENTS_ACTIVITY)
|
||||||
|| topActivity.getClassName().equals(RecentsTvImpl.RECENTS_TV_ACTIVITY)));
|
|| topActivity.getClassName().equals(RecentsTvImpl.RECENTS_TV_ACTIVITY)));
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
|
|||||||
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
|
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||||
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
|
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
|
|
||||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||||
import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER;
|
import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ALL;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ALL;
|
||||||
@@ -3406,12 +3405,16 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private StackInfo getStackInfoLocked(ActivityStack stack) {
|
private StackInfo getStackInfoLocked(ActivityStack stack) {
|
||||||
|
final ActivityDisplay display = mActivityDisplays.get(Display.DEFAULT_DISPLAY);
|
||||||
StackInfo info = new StackInfo();
|
StackInfo info = new StackInfo();
|
||||||
mWindowManager.getStackBounds(stack.mStackId, info.bounds);
|
mWindowManager.getStackBounds(stack.mStackId, info.bounds);
|
||||||
info.displayId = Display.DEFAULT_DISPLAY;
|
info.displayId = Display.DEFAULT_DISPLAY;
|
||||||
info.stackId = stack.mStackId;
|
info.stackId = stack.mStackId;
|
||||||
info.userId = stack.mCurrentUser;
|
info.userId = stack.mCurrentUser;
|
||||||
info.visible = stack.getStackVisibilityLocked(null) == STACK_VISIBLE;
|
info.visible = stack.getStackVisibilityLocked(null) == STACK_VISIBLE;
|
||||||
|
info.position = display != null
|
||||||
|
? display.mStacks.indexOf(stack)
|
||||||
|
: 0;
|
||||||
|
|
||||||
ArrayList<TaskRecord> tasks = stack.getAllTasks();
|
ArrayList<TaskRecord> tasks = stack.getAllTasks();
|
||||||
final int numTasks = tasks.size();
|
final int numTasks = tasks.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user