diff options
| author | Craig Mautner <cmautner@google.com> | 2014-06-14 00:30:47 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-14 00:30:47 +0000 |
| commit | 916cd9770ce865bad98f15a68be74f3aa607e727 (patch) | |
| tree | 2dcc07ef2bac169dcafe6ecf1021276a93ca416c /core/java/android | |
| parent | 40190375408034b2b7dd1aef358086da2914051b (diff) | |
| parent | 6335fbcba106147d914acae0a9d8f4fcd53af768 (diff) | |
| download | frameworks_base-916cd9770ce865bad98f15a68be74f3aa607e727.zip frameworks_base-916cd9770ce865bad98f15a68be74f3aa607e727.tar.gz frameworks_base-916cd9770ce865bad98f15a68be74f3aa607e727.tar.bz2 | |
am 6335fbcb: Revert "Revert "Close ActivityView and ActivityContainer cleanly.""
* commit '6335fbcba106147d914acae0a9d8f4fcd53af768':
Revert "Revert "Close ActivityView and ActivityContainer cleanly.""
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ActivityView.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityView.java b/core/java/android/app/ActivityView.java index c29d75e..94ea2c5 100644 --- a/core/java/android/app/ActivityView.java +++ b/core/java/android/app/ActivityView.java @@ -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; + } } } |
