Merge "RESTRICT AUTOMERGE Make task visible if activity launched behind" into rvc-qpr-dev
This commit is contained in:
@@ -48,6 +48,7 @@ import static com.android.server.wm.ActivityStack.ActivityState.PAUSED;
|
|||||||
import static com.android.server.wm.ActivityStack.ActivityState.RESUMED;
|
import static com.android.server.wm.ActivityStack.ActivityState.RESUMED;
|
||||||
import static com.android.server.wm.ActivityStack.ActivityState.STOPPED;
|
import static com.android.server.wm.ActivityStack.ActivityState.STOPPED;
|
||||||
import static com.android.server.wm.ActivityStack.ActivityState.STOPPING;
|
import static com.android.server.wm.ActivityStack.ActivityState.STOPPING;
|
||||||
|
import static com.android.server.wm.ActivityStack.STACK_VISIBILITY_INVISIBLE;
|
||||||
import static com.android.server.wm.ActivityStackSupervisor.DEFER_RESUME;
|
import static com.android.server.wm.ActivityStackSupervisor.DEFER_RESUME;
|
||||||
import static com.android.server.wm.ActivityStackSupervisor.ON_TOP;
|
import static com.android.server.wm.ActivityStackSupervisor.ON_TOP;
|
||||||
import static com.android.server.wm.ActivityStackSupervisor.dumpHistoryList;
|
import static com.android.server.wm.ActivityStackSupervisor.dumpHistoryList;
|
||||||
@@ -1931,25 +1932,30 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean attachApplication(WindowProcessController app) throws RemoteException {
|
boolean attachApplication(WindowProcessController app) throws RemoteException {
|
||||||
final String processName = app.mName;
|
|
||||||
boolean didSomething = false;
|
boolean didSomething = false;
|
||||||
for (int displayNdx = getChildCount() - 1; displayNdx >= 0; --displayNdx) {
|
for (int displayNdx = getChildCount() - 1; displayNdx >= 0; --displayNdx) {
|
||||||
final DisplayContent display = getChildAt(displayNdx);
|
|
||||||
final ActivityStack stack = display.getFocusedStack();
|
|
||||||
if (stack == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
mTmpRemoteException = null;
|
mTmpRemoteException = null;
|
||||||
mTmpBoolean = false; // Set to true if an activity was started.
|
mTmpBoolean = false; // Set to true if an activity was started.
|
||||||
|
|
||||||
|
final DisplayContent display = getChildAt(displayNdx);
|
||||||
|
for (int areaNdx = display.getTaskDisplayAreaCount() - 1; areaNdx >= 0; --areaNdx) {
|
||||||
|
final TaskDisplayArea taskDisplayArea = display.getTaskDisplayAreaAt(areaNdx);
|
||||||
|
for (int taskNdx = taskDisplayArea.getStackCount() - 1; taskNdx >= 0; --taskNdx) {
|
||||||
|
final ActivityStack rootTask = taskDisplayArea.getStackAt(taskNdx);
|
||||||
|
if (rootTask.getVisibility(null /*starting*/) == STACK_VISIBILITY_INVISIBLE) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
final PooledFunction c = PooledLambda.obtainFunction(
|
final PooledFunction c = PooledLambda.obtainFunction(
|
||||||
RootWindowContainer::startActivityForAttachedApplicationIfNeeded, this,
|
RootWindowContainer::startActivityForAttachedApplicationIfNeeded, this,
|
||||||
PooledLambda.__(ActivityRecord.class), app, stack.topRunningActivity());
|
PooledLambda.__(ActivityRecord.class), app,
|
||||||
stack.forAllActivities(c);
|
rootTask.topRunningActivity());
|
||||||
|
rootTask.forAllActivities(c);
|
||||||
c.recycle();
|
c.recycle();
|
||||||
if (mTmpRemoteException != null) {
|
if (mTmpRemoteException != null) {
|
||||||
throw mTmpRemoteException;
|
throw mTmpRemoteException;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
didSomething |= mTmpBoolean;
|
didSomething |= mTmpBoolean;
|
||||||
}
|
}
|
||||||
if (!didSomething) {
|
if (!didSomething) {
|
||||||
@@ -1966,8 +1972,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (mStackSupervisor.realStartActivityLocked(r, app, top == r /*andResume*/,
|
if (mStackSupervisor.realStartActivityLocked(r, app,
|
||||||
true /*checkConfig*/)) {
|
top == r && r.isFocusable() /*andResume*/, true /*checkConfig*/)) {
|
||||||
mTmpBoolean = true;
|
mTmpBoolean = true;
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|||||||
@@ -3671,6 +3671,10 @@ class Task extends WindowContainer<WindowContainer> {
|
|||||||
return STACK_VISIBILITY_INVISIBLE;
|
return STACK_VISIBILITY_INVISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isTopActivityLaunchedBehind()) {
|
||||||
|
return STACK_VISIBILITY_VISIBLE;
|
||||||
|
}
|
||||||
|
|
||||||
boolean gotSplitScreenStack = false;
|
boolean gotSplitScreenStack = false;
|
||||||
boolean gotOpaqueSplitScreenPrimary = false;
|
boolean gotOpaqueSplitScreenPrimary = false;
|
||||||
boolean gotOpaqueSplitScreenSecondary = false;
|
boolean gotOpaqueSplitScreenSecondary = false;
|
||||||
@@ -3788,6 +3792,14 @@ class Task extends WindowContainer<WindowContainer> {
|
|||||||
: STACK_VISIBILITY_VISIBLE;
|
: STACK_VISIBILITY_VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isTopActivityLaunchedBehind() {
|
||||||
|
final ActivityRecord top = topRunningActivity();
|
||||||
|
if (top != null && top.mLaunchTaskBehind) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ActivityRecord isInTask(ActivityRecord r) {
|
ActivityRecord isInTask(ActivityRecord r) {
|
||||||
if (r == null) {
|
if (r == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -548,7 +548,7 @@ public class ActivityRecordTests extends ActivityTestsBase {
|
|||||||
final ActivityStack stack = new StackBuilder(mRootWindowContainer).build();
|
final ActivityStack stack = new StackBuilder(mRootWindowContainer).build();
|
||||||
try {
|
try {
|
||||||
doReturn(false).when(stack).isTranslucent(any());
|
doReturn(false).when(stack).isTranslucent(any());
|
||||||
assertFalse(mStack.shouldBeVisible(null /* starting */));
|
assertTrue(mStack.shouldBeVisible(null /* starting */));
|
||||||
|
|
||||||
mActivity.setLastReportedConfiguration(new MergedConfiguration(new Configuration(),
|
mActivity.setLastReportedConfiguration(new MergedConfiguration(new Configuration(),
|
||||||
mActivity.getConfiguration()));
|
mActivity.getConfiguration()));
|
||||||
|
|||||||
Reference in New Issue
Block a user