Loading services/core/java/com/android/server/wm/ActivityRecord.java +12 −2 Original line number Diff line number Diff line Loading @@ -3272,8 +3272,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mOccludesParent = occludesParent; setMainWindowOpaque(occludesParent); if (changed && task != null && !occludesParent) { if (changed && task != null) { if (!occludesParent) { getRootTask().convertActivityToTranslucent(this); } else { getRootTask().convertActivityFromTranslucent(this); } } // Always ensure visibility if this activity doesn't occlude parent, so the // {@link #returningOptions} of the activity under this one can be applied in Loading Loading @@ -4266,6 +4270,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A getTaskFragment().cleanUpActivityReferences(this); clearLastParentBeforePip(); // Abort and reset state if the scence transition is playing. final Task rootTask = getRootTask(); if (rootTask != null) { rootTask.abortTranslucentActivityWaiting(this); } // Clean up the splash screen if it was still displayed. cleanUpSplashScreen(); Loading services/core/java/com/android/server/wm/Task.java +34 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,10 @@ class Task extends TaskFragment { ActivityRecord mTranslucentActivityWaiting = null; ArrayList<ActivityRecord> mUndrawnActivitiesBelowTopTranslucent = new ArrayList<>(); // The topmost Activity that was converted to translucent for scene transition, which should // be converted from translucent once the transition is completed, or the app died. private ActivityRecord mPendingConvertFromTranslucentActivity = null; /** * Set when we know we are going to be calling updateConfiguration() * soon, so want to skip intermediate config checks. Loading Loading @@ -4988,6 +4992,27 @@ class Task extends TaskFragment { } } void abortTranslucentActivityWaiting(@NonNull ActivityRecord r) { if (r != mTranslucentActivityWaiting && r != mPendingConvertFromTranslucentActivity) { return; } if (mTranslucentActivityWaiting != null) { if (!mTranslucentActivityWaiting.finishing) { mTranslucentActivityWaiting.setOccludesParent(true); } mTranslucentActivityWaiting = null; } if (mPendingConvertFromTranslucentActivity != null) { if (!mPendingConvertFromTranslucentActivity.finishing) { mPendingConvertFromTranslucentActivity.setOccludesParent(true); } mPendingConvertFromTranslucentActivity = null; } mUndrawnActivitiesBelowTopTranslucent.clear(); mHandler.removeMessages(TRANSLUCENT_TIMEOUT_MSG); } void checkTranslucentActivityWaiting(ActivityRecord top) { if (mTranslucentActivityWaiting != top) { mUndrawnActivitiesBelowTopTranslucent.clear(); Loading @@ -5002,10 +5027,19 @@ class Task extends TaskFragment { void convertActivityToTranslucent(ActivityRecord r) { mTranslucentActivityWaiting = r; mPendingConvertFromTranslucentActivity = r; mUndrawnActivitiesBelowTopTranslucent.clear(); mHandler.sendEmptyMessageDelayed(TRANSLUCENT_TIMEOUT_MSG, TRANSLUCENT_CONVERSION_TIMEOUT); } void convertActivityFromTranslucent(ActivityRecord r) { if (r != mPendingConvertFromTranslucentActivity) { Slog.e(TAG, "convertFromTranslucent expects " + mPendingConvertFromTranslucentActivity + " but is " + r); } mPendingConvertFromTranslucentActivity = null; } /** * Called as activities below the top translucent activity are redrawn. When the last one is * redrawn notify the top activity by calling Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +12 −2 Original line number Diff line number Diff line Loading @@ -3272,8 +3272,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A mOccludesParent = occludesParent; setMainWindowOpaque(occludesParent); if (changed && task != null && !occludesParent) { if (changed && task != null) { if (!occludesParent) { getRootTask().convertActivityToTranslucent(this); } else { getRootTask().convertActivityFromTranslucent(this); } } // Always ensure visibility if this activity doesn't occlude parent, so the // {@link #returningOptions} of the activity under this one can be applied in Loading Loading @@ -4266,6 +4270,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A getTaskFragment().cleanUpActivityReferences(this); clearLastParentBeforePip(); // Abort and reset state if the scence transition is playing. final Task rootTask = getRootTask(); if (rootTask != null) { rootTask.abortTranslucentActivityWaiting(this); } // Clean up the splash screen if it was still displayed. cleanUpSplashScreen(); Loading
services/core/java/com/android/server/wm/Task.java +34 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,10 @@ class Task extends TaskFragment { ActivityRecord mTranslucentActivityWaiting = null; ArrayList<ActivityRecord> mUndrawnActivitiesBelowTopTranslucent = new ArrayList<>(); // The topmost Activity that was converted to translucent for scene transition, which should // be converted from translucent once the transition is completed, or the app died. private ActivityRecord mPendingConvertFromTranslucentActivity = null; /** * Set when we know we are going to be calling updateConfiguration() * soon, so want to skip intermediate config checks. Loading Loading @@ -4988,6 +4992,27 @@ class Task extends TaskFragment { } } void abortTranslucentActivityWaiting(@NonNull ActivityRecord r) { if (r != mTranslucentActivityWaiting && r != mPendingConvertFromTranslucentActivity) { return; } if (mTranslucentActivityWaiting != null) { if (!mTranslucentActivityWaiting.finishing) { mTranslucentActivityWaiting.setOccludesParent(true); } mTranslucentActivityWaiting = null; } if (mPendingConvertFromTranslucentActivity != null) { if (!mPendingConvertFromTranslucentActivity.finishing) { mPendingConvertFromTranslucentActivity.setOccludesParent(true); } mPendingConvertFromTranslucentActivity = null; } mUndrawnActivitiesBelowTopTranslucent.clear(); mHandler.removeMessages(TRANSLUCENT_TIMEOUT_MSG); } void checkTranslucentActivityWaiting(ActivityRecord top) { if (mTranslucentActivityWaiting != top) { mUndrawnActivitiesBelowTopTranslucent.clear(); Loading @@ -5002,10 +5027,19 @@ class Task extends TaskFragment { void convertActivityToTranslucent(ActivityRecord r) { mTranslucentActivityWaiting = r; mPendingConvertFromTranslucentActivity = r; mUndrawnActivitiesBelowTopTranslucent.clear(); mHandler.sendEmptyMessageDelayed(TRANSLUCENT_TIMEOUT_MSG, TRANSLUCENT_CONVERSION_TIMEOUT); } void convertActivityFromTranslucent(ActivityRecord r) { if (r != mPendingConvertFromTranslucentActivity) { Slog.e(TAG, "convertFromTranslucent expects " + mPendingConvertFromTranslucentActivity + " but is " + r); } mPendingConvertFromTranslucentActivity = null; } /** * Called as activities below the top translucent activity are redrawn. When the last one is * redrawn notify the top activity by calling Loading