Loading core/java/android/view/SurfaceView.java +3 −9 Original line number Original line Diff line number Diff line Loading @@ -700,17 +700,11 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb mIsCreating = false; mIsCreating = false; if (mSurfaceControl != null && !mSurfaceCreated) { if (mSurfaceControl != null && !mSurfaceCreated) { mSurface.release(); mSurface.release(); // If we are not in the stopped state, then the destruction of the Surface // represents a visual change we need to display, and we should go ahead // and destroy the SurfaceControl. However if we are in the stopped state, // we can just leave the Surface around so it can be a part of animations, // and we let the life-time be tied to the parent surface. if (!mWindowStopped) { mSurfaceControl.destroy(); mSurfaceControl.destroy(); mSurfaceControl = null; mSurfaceControl = null; } } } } } } catch (Exception ex) { } catch (Exception ex) { Log.e(TAG, "Exception configuring surface", ex); Log.e(TAG, "Exception configuring surface", ex); } } Loading services/core/java/com/android/server/am/ActivityRecord.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -1626,6 +1626,10 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo if (parent != null) { if (parent != null) { parent.onActivityStateChanged(this, state, reason); parent.onActivityStateChanged(this, state, reason); } } if (state == STOPPING) { mWindowContainerController.notifyAppStopping(); } } } ActivityState getState() { ActivityState getState() { Loading services/core/java/com/android/server/wm/AppWindowContainerController.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -671,6 +671,17 @@ public class AppWindowContainerController } } } } public void notifyAppStopping() { synchronized(mWindowMap) { if (mContainer == null) { Slog.w(TAG_WM, "Attempted to notify stopping on non-existing app token: " + mToken); return; } mContainer.detachChildren(); } } public void notifyAppStopped() { public void notifyAppStopped() { synchronized(mWindowMap) { synchronized(mWindowMap) { if (mContainer == null) { if (mContainer == null) { Loading services/core/java/com/android/server/wm/AppWindowToken.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -913,12 +913,16 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // try and clean up it's child surfaces. We need to prevent this from // try and clean up it's child surfaces. We need to prevent this from // happening, so we sever the children, transfering their ownership // happening, so we sever the children, transfering their ownership // from the client it-self to the parent surface (owned by us). // from the client it-self to the parent surface (owned by us). detachChildren(); mPendingRelaunchCount++; } void detachChildren() { for (int i = mChildren.size() - 1; i >= 0; i--) { for (int i = mChildren.size() - 1; i >= 0; i--) { final WindowState w = mChildren.get(i); final WindowState w = mChildren.get(i); w.mWinAnimator.detachChildren(); w.mWinAnimator.detachChildren(); } } mPendingRelaunchCount++; } } void finishRelaunching() { void finishRelaunching() { Loading Loading
core/java/android/view/SurfaceView.java +3 −9 Original line number Original line Diff line number Diff line Loading @@ -700,17 +700,11 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb mIsCreating = false; mIsCreating = false; if (mSurfaceControl != null && !mSurfaceCreated) { if (mSurfaceControl != null && !mSurfaceCreated) { mSurface.release(); mSurface.release(); // If we are not in the stopped state, then the destruction of the Surface // represents a visual change we need to display, and we should go ahead // and destroy the SurfaceControl. However if we are in the stopped state, // we can just leave the Surface around so it can be a part of animations, // and we let the life-time be tied to the parent surface. if (!mWindowStopped) { mSurfaceControl.destroy(); mSurfaceControl.destroy(); mSurfaceControl = null; mSurfaceControl = null; } } } } } } catch (Exception ex) { } catch (Exception ex) { Log.e(TAG, "Exception configuring surface", ex); Log.e(TAG, "Exception configuring surface", ex); } } Loading
services/core/java/com/android/server/am/ActivityRecord.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -1626,6 +1626,10 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo if (parent != null) { if (parent != null) { parent.onActivityStateChanged(this, state, reason); parent.onActivityStateChanged(this, state, reason); } } if (state == STOPPING) { mWindowContainerController.notifyAppStopping(); } } } ActivityState getState() { ActivityState getState() { Loading
services/core/java/com/android/server/wm/AppWindowContainerController.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -671,6 +671,17 @@ public class AppWindowContainerController } } } } public void notifyAppStopping() { synchronized(mWindowMap) { if (mContainer == null) { Slog.w(TAG_WM, "Attempted to notify stopping on non-existing app token: " + mToken); return; } mContainer.detachChildren(); } } public void notifyAppStopped() { public void notifyAppStopped() { synchronized(mWindowMap) { synchronized(mWindowMap) { if (mContainer == null) { if (mContainer == null) { Loading
services/core/java/com/android/server/wm/AppWindowToken.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -913,12 +913,16 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // try and clean up it's child surfaces. We need to prevent this from // try and clean up it's child surfaces. We need to prevent this from // happening, so we sever the children, transfering their ownership // happening, so we sever the children, transfering their ownership // from the client it-self to the parent surface (owned by us). // from the client it-self to the parent surface (owned by us). detachChildren(); mPendingRelaunchCount++; } void detachChildren() { for (int i = mChildren.size() - 1; i >= 0; i--) { for (int i = mChildren.size() - 1; i >= 0; i--) { final WindowState w = mChildren.get(i); final WindowState w = mChildren.get(i); w.mWinAnimator.detachChildren(); w.mWinAnimator.detachChildren(); } } mPendingRelaunchCount++; } } void finishRelaunching() { void finishRelaunching() { Loading