Invalidate snapshot of home if its UI is changed

Snapshot may be enabled for home task when turning off
screen. If home UI has changed after screen off, the
snapshot should not be used to avoid ugly visual effect.

Bug: 140811348
Test: Lock/unlock device while home is on top with 4 cases:
      1. All apps is shown.
      2. Overview is shown.
      3. Options menu is shown.
      4. Quick search bar is active.
      The expected result should be no starting window
      when unlocking because the snapshot is dropped.

Change-Id: I4bd9926b6f9332ac16b1b3a25ffdd44706015a33
(cherry picked from commit 0ae61c8d29)
This commit is contained in:
Riddle Hsu
2019-11-21 01:32:58 +08:00
committed by Tony Wickham
parent 67457275e0
commit 7a7468fd39
3 changed files with 38 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.RemoteFadeOutAnimationListener;
import com.android.quickstep.util.ShelfPeekAnim;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import java.util.stream.Stream;
@@ -157,6 +158,12 @@ public abstract class BaseQuickstepLauncher extends Launcher
RecentsModel.INSTANCE.get(this).onTrimMemory(level);
}
@Override
protected void onUiChangedWhileSleeping() {
// Remove the snapshot because the content view may have obvious changes.
ActivityManagerWrapper.getInstance().invalidateHomeTaskSnapshot(this);
}
@Override
public void startIntentSenderForResult(IntentSender intent, int requestCode,
Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) {