diff options
author | Adam Cohen <adamcohen@google.com> | 2014-04-01 13:33:58 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2014-04-01 14:31:51 -0700 |
commit | dcb173d0e348c23d967bb0939e63b6ce4e1bd503 (patch) | |
tree | 429b29cf6a63be3f572d057dbafb8228140891ba /src/com | |
parent | 8440e7ce17a3d54254217c69982c2ec2937ba4ba (diff) | |
download | android_packages_apps_Trebuchet-dcb173d0e348c23d967bb0939e63b6ce4e1bd503.tar.gz android_packages_apps_Trebuchet-dcb173d0e348c23d967bb0939e63b6ce4e1bd503.tar.bz2 android_packages_apps_Trebuchet-dcb173d0e348c23d967bb0939e63b6ce4e1bd503.zip |
Make sure the workspace screens don't get updated while workspace is loading
-> Found another path that could lead to the same issue
[add shortcut with config activity to an existing folder,
when config activity launches, kill launcher, configure
shortcut. observe crash and data loss].
-> Plugged up above, and a couple other potential holes
-> Initial fix probably took care of the main issue
Issue 12523285
Change-Id: I29db9da4af4a8bf22047eb46bd49354447d04b8d
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 1732e37fb..8d60a3d5b 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -696,6 +696,12 @@ public class Workspace extends SmoothPagedView // Log to disk Launcher.addDumpLog(TAG, "11683562 - convertFinalScreenToEmptyScreenIfNecessary()", true); + if (mLauncher.isWorkspaceLoading()) { + // Invalid and dangerous operation if workspace is loading + Launcher.addDumpLog(TAG, " - workspace loading, skip", true); + return; + } + if (hasExtraEmptyScreen() || mScreenOrder.size() == 0) return; long finalScreenId = mScreenOrder.get(mScreenOrder.size() - 1); @@ -726,6 +732,12 @@ public class Workspace extends SmoothPagedView final int delay, final boolean stripEmptyScreens) { // Log to disk Launcher.addDumpLog(TAG, "11683562 - removeExtraEmptyScreen()", true); + if (mLauncher.isWorkspaceLoading()) { + // Don't strip empty screens if the workspace is still loading + Launcher.addDumpLog(TAG, " - workspace loading, skip", true); + return; + } + if (delay > 0) { postDelayed(new Runnable() { @Override @@ -810,6 +822,11 @@ public class Workspace extends SmoothPagedView public long commitExtraEmptyScreen() { // Log to disk Launcher.addDumpLog(TAG, "11683562 - commitExtraEmptyScreen()", true); + if (mLauncher.isWorkspaceLoading()) { + // Invalid and dangerous operation if workspace is loading + Launcher.addDumpLog(TAG, " - workspace loading, skip", true); + return -1; + } int index = getPageIndexForScreenId(EXTRA_EMPTY_SCREEN_ID); CellLayout cl = mWorkspaceScreens.get(EXTRA_EMPTY_SCREEN_ID); @@ -867,7 +884,8 @@ public class Workspace extends SmoothPagedView Launcher.addDumpLog(TAG, "11683562 - stripEmptyScreens()", true); if (mLauncher.isWorkspaceLoading()) { - // Don't strip empty screens if the workspace is still loading + // Don't strip empty screens if the workspace is still loading. + // This is dangerous and can result in data loss. Launcher.addDumpLog(TAG, " - workspace loading, skip", true); return; } @@ -2022,6 +2040,11 @@ public class Workspace extends SmoothPagedView protected void onEndReordering() { super.onEndReordering(); + if (mLauncher.isWorkspaceLoading()) { + // Invalid and dangerous operation if workspace is loading + return; + } + hideOutlines(); mScreenOrder.clear(); int count = getChildCount(); |