Close ActivityView and ActivityContainer cleanly.
- Do not call IActivityContainer.release() from ActivityView.finalize() if it has already been called from ActivityView.release(). Eliminates IBinder finalized Exception. - Call ActivityRecord.makeFinishing() before calling ActivityStack. destroyActivityLocked(). Forces call to scheduleDestroyActivity() and eventually removeFromHistory(). Otherwise removeFromHistory() is never called and window manager AppWindowTokens become orphans. - Defer call to ActivityContainer.detachLocked() until all activities have finished or timed out. Fixes problem where Display is removed while activities are still launching. - Call ActivityStackSupervisor.deleteActivityContainer() when all activities have finished or timed out. Fixes orphaned ActivityContainers. Fixes bug 15450798. Fixes bug 15484154. Fixes bug 15383479. Fixes bug 15316558. Fixes bug 15168560. Fixes bug 15143914. Change-Id: Id3c641976b6f825458690f9ee063c07818b56f23
This commit is contained in:
@ -354,9 +354,11 @@ public class ActivityView extends ViewGroup {
|
||||
private static class ActivityContainerWrapper {
|
||||
private final IActivityContainer mIActivityContainer;
|
||||
private final CloseGuard mGuard = CloseGuard.get();
|
||||
boolean mOpened; // Protected by mGuard.
|
||||
|
||||
ActivityContainerWrapper(IActivityContainer container) {
|
||||
mIActivityContainer = container;
|
||||
mOpened = true;
|
||||
mGuard.open("release");
|
||||
}
|
||||
|
||||
@ -424,11 +426,16 @@ public class ActivityView extends ViewGroup {
|
||||
}
|
||||
|
||||
void release() {
|
||||
if (DEBUG) Log.v(TAG, "ActivityContainerWrapper: release called");
|
||||
try {
|
||||
mIActivityContainer.release();
|
||||
mGuard.close();
|
||||
} catch (RemoteException e) {
|
||||
synchronized (mGuard) {
|
||||
if (mOpened) {
|
||||
if (DEBUG) Log.v(TAG, "ActivityContainerWrapper: release called");
|
||||
try {
|
||||
mIActivityContainer.release();
|
||||
mGuard.close();
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
mOpened = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user