return true;
}
- case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
- data.enforceInterface(IActivityManager.descriptor);
- IActivityContainer activityContainer =
- IActivityContainer.Stub.asInterface(data.readStrongBinder());
- deleteActivityContainer(activityContainer);
- reply.writeNoException();
- return true;
- }
-
case CREATE_STACK_ON_DISPLAY: {
data.enforceInterface(IActivityManager.descriptor);
int displayId = data.readInt();
return res;
}
- public void deleteActivityContainer(IActivityContainer activityContainer)
- throws RemoteException {
- Parcel data = Parcel.obtain();
- Parcel reply = Parcel.obtain();
- data.writeInterfaceToken(IActivityManager.descriptor);
- data.writeStrongBinder(activityContainer.asBinder());
- mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
- reply.readException();
- data.recycle();
- reply.recycle();
- }
-
public boolean startBinderTracking() throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException;
- public void deleteActivityContainer(IActivityContainer container) throws RemoteException;
-
public int getActivityDisplayId(IBinder activityToken) throws RemoteException;
public void startSystemLockTaskMode(int taskId) throws RemoteException;
}
@Override
- public void deleteActivityContainer(IActivityContainer container) throws RemoteException {
- enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "deleteActivityContainer()");
- synchronized (this) {
- mStackSupervisor.deleteActivityContainer(container);
- }
- }
-
- @Override
public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "createStackOnDisplay()");
synchronized (this) {
}
}
- void detachDisplay() {
+ void remove() {
mDisplayId = Display.INVALID_DISPLAY;
mStacks = null;
if (mTaskPositioner != null) {
mTaskPositioner.reset();
}
- mWindowManager.detachStack(mStackId);
- onParentChanged();
if (mStackId == DOCKED_STACK_ID) {
// If we removed a docked stack we want to resize it so it resizes all other stacks
// in the system to fullscreen.
mStackSupervisor.resizeDockedStackLocked(
null, null, null, null, null, PRESERVE_WINDOWS);
}
+ mStackSupervisor.deleteActivityContainerRecord(mStackId);
+ mWindowManager.removeStack(mStackId);
+ onParentChanged();
}
void getDisplaySize(Point out) {
}
}
- void deleteActivityContainer(IActivityContainer container) {
- ActivityContainer activityContainer = (ActivityContainer)container;
- if (activityContainer != null) {
- if (DEBUG_CONTAINERS) Slog.d(TAG_CONTAINERS,
- "deleteActivityContainer: callers=" + Debug.getCallers(4));
- final int stackId = activityContainer.mStackId;
- mActivityContainers.remove(stackId);
- mWindowManager.removeStack(stackId);
- }
+ void deleteActivityContainerRecord(int stackId) {
+ if (DEBUG_CONTAINERS) Slog.d(TAG_CONTAINERS,
+ "deleteActivityContainerRecord: callers=" + Debug.getCallers(4));
+ mActivityContainers.remove(stackId);
}
void resizeStackLocked(int stackId, Rect bounds, Rect tempTaskBounds, Rect tempTaskInsetBounds,
if (activityDisplay != null) {
ArrayList<ActivityStack> stacks = activityDisplay.mStacks;
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
- stacks.get(stackNdx).mActivityContainer.detachLocked();
+ stacks.get(stackNdx).mActivityContainer.removeLocked();
}
mActivityDisplays.remove(displayId);
}
}
}
- protected void detachLocked() {
- if (DEBUG_STACK) Slog.d(TAG_STACK, "detachLocked: " + this + " from display="
+ void removeLocked() {
+ if (DEBUG_STACK) Slog.d(TAG_STACK, "removeLocked: " + this + " from display="
+ mActivityDisplay + " Callers=" + Debug.getCallers(2));
if (mActivityDisplay != null) {
mActivityDisplay.detachActivitiesLocked(mStack);
mActivityDisplay = null;
- mStack.detachDisplay();
}
+ mStack.remove();
}
@Override
}
void onTaskListEmptyLocked() {
- detachLocked();
- deleteActivityContainer(this);
+ removeLocked();
mHandler.obtainMessage(CONTAINER_CALLBACK_TASK_LIST_EMPTY, this).sendToTarget();
}
}
}
- public void detachStack(int stackId) {
+ public void removeStack(int stackId) {
synchronized (mWindowMap) {
final TaskStack stack = mStackIdToStack.get(stackId);
if (stack != null) {
stack.removeIfPossible();
+ mStackIdToStack.remove(stackId);
}
}
}
- public void removeStack(int stackId) {
- synchronized (mWindowMap) {
- mStackIdToStack.remove(stackId);
- }
- }
-
public void removeTask(int taskId) {
synchronized (mWindowMap) {
Task task = mTaskIdToTask.get(taskId);