Also clear the binder identity to incorrect permission
checks, which lead to crashes when dismissing the docked
stack.
Change-Id: I53175769745e8bbdbc296806b9297eb3c53d4452
throw new IllegalArgumentException("Removing home stack is not allowed.");
}
synchronized (this) {
+ long origId = Binder.clearCallingIdentity();
ActivityStack stack = mStackSupervisor.getStack(stackId);
if (stack != null) {
ArrayList<TaskRecord> tasks = stack.getAllTasks();
for (int i = tasks.size() - 1; i >= 0; i--) {
- removeTaskByIdLocked(tasks.get(i).taskId, true /* killProcess */,
+ removeTaskByIdLocked(tasks.get(i).taskId, false /* killProcess */,
!REMOVE_FROM_RECENTS);
}
}
+ Binder.restoreCallingIdentity(origId);
}
}