if (activityDisplay != null) {
ArrayList<ActivityStack> stacks = activityDisplay.mStacks;
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
- stacks.get(stackNdx).mActivityContainer.removeLocked();
+ final ActivityStack stack = stacks.get(stackNdx);
+ // TODO: Implement proper stack removal and ability to choose the behavior -
+ // remove stack completely or move it to other display.
+ moveStackToDisplayLocked(stack.mStackId, DEFAULT_DISPLAY);
}
mActivityDisplays.remove(displayId);
}
}
}
- /** Remove the stack completely. */
+ /**
+ * Remove the stack completely. Must be called only when there are no tasks left in it,
+ * as this method does not finish running activities.
+ */
void removeLocked() {
if (DEBUG_STACK) Slog.d(TAG_STACK, "removeLocked: " + this + " from display="
+ mActivityDisplay + " Callers=" + Debug.getCallers(2));
if (err == ActivityManager.START_SUCCESS) {
Slog.i(TAG, "START u" + userId + " {" + intent.toShortString(true, true, true, false)
- + "} from uid " + callingUid
- + " on display " + (container == null ? (mSupervisor.mFocusedStack == null ?
- Display.DEFAULT_DISPLAY : mSupervisor.mFocusedStack.mDisplayId) :
- (container.mActivityDisplay == null ? Display.DEFAULT_DISPLAY :
- container.mActivityDisplay.mDisplayId)));
+ + "} from uid " + callingUid);
}
ActivityRecord sourceRecord = null;
win.getTouchableRegion(mTmpRegion);
mTouchExcludeRegion.op(mTmpRegion, Region.Op.UNION);
}
- if (getDockedStackLocked() != null) {
+ // TODO(multi-display): Support docked stacks on secondary displays.
+ if (mDisplayId == DEFAULT_DISPLAY && getDockedStackLocked() != null) {
mDividerControllerLocked.getTouchRegion(mTmpRect);
mTmpRegion.set(mTmpRect);
mTouchExcludeRegion.op(mTmpRegion, Op.UNION);