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
This commit is contained in:
Jon Miranda
2019-07-17 21:24:07 -07:00
parent 04ca73b590
commit 11b5535556
@@ -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<BaseDraggingActivity> activityControl =
mOverviewComponentObserver.getActivityControlHelper();
if (activityControl.getCreatedActivity() == null) {