diff options
| author | 2022-08-24 12:39:57 +0800 | |
|---|---|---|
| committer | 2022-08-25 15:20:55 +0800 | |
| commit | f6f4c305a53cd552ad41183b625751f5df479fa4 (patch) | |
| tree | 3c6292da95d47ab82cacba92d142353965c961d4 | |
| parent | 3590c754ffd13694d2177c3ca60e6bb001fbe9d4 (diff) | |
Correct visible status of an activity if no more transition will happen
When user turn screen off during an opening activity transition,
because there won't trigger another transtion for turning screen off,
so the Activity will stay visible if the opening transition did not
finish before the activity report pause complete.
When an activity become invisible and there is no more transition
will happen, also check whether the screen is truned off, so it can
commit invisible after transition finish.
Bug:235381910
Test: enable shell transition, run
atest MultiDisplayPolicyTests#testExternalDisplayToggleState
Change-Id: Ibffa434cbc2ae2a3126d3c678953580ef564020b
| -rw-r--r-- | services/core/java/com/android/server/wm/Transition.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java index 803890b4032d..6b69c94b236b 100644 --- a/services/core/java/com/android/server/wm/Transition.java +++ b/services/core/java/com/android/server/wm/Transition.java @@ -78,6 +78,7 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.Slog; import android.util.SparseArray; +import android.view.Display; import android.view.SurfaceControl; import android.view.WindowManager; import android.view.animation.Animation; @@ -635,7 +636,11 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe // remove the surfaces yet. If it is currently visible, but not expected-visible, // then doing commitVisibility here would actually be out-of-order and leave the // activity in a bad state. - if (!visibleAtTransitionEnd && !ar.isVisibleRequested()) { + // TODO (b/243755838) Create a screen off transition to correct the visible status + // of activities. + final boolean isScreenOff = ar.mDisplayContent == null + || ar.mDisplayContent.getDisplayInfo().state == Display.STATE_OFF; + if ((!visibleAtTransitionEnd || isScreenOff) && !ar.isVisibleRequested()) { final boolean commitVisibility = !checkEnterPipOnFinish(ar); // Avoid commit visibility if entering pip or else we will get a sudden // "flash" / surface going invisible for a split second. |