From 11b5535556cc3d53d7e521715178ddcd4b708daf Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Wed, 17 Jul 2019 21:24:07 -0700 Subject: [PATCH] Skip TouchInteractionService preload if restore task is pending. Otherwise the preload may cause launcher to restore too early, resulting in data loss. Bug: 131315856 Change-Id: I4412c8f691286ba142e9c748a908a3ed42713a82 --- .../src/com/android/quickstep/TouchInteractionService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index 4bc4c761b0..debed898ef 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -76,6 +76,7 @@ import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.logging.EventLogArray; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.model.AppLaunchTracker; +import com.android.launcher3.provider.RestoreDbTask; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.util.LooperExecutor; import com.android.launcher3.util.UiThreadHelper; @@ -710,6 +711,12 @@ public class TouchInteractionService extends Service implements return; } + if (RestoreDbTask.isPending(this)) { + // Preloading while a restore is pending may cause launcher to start the restore + // too early. + return; + } + final ActivityControlHelper activityControl = mOverviewComponentObserver.getActivityControlHelper(); if (activityControl.getCreatedActivity() == null) {