When the launcher is paused and we reload stuff in the background, we need to re-re-load it in onResume.

Otherwise we can load widgets and other resources from the wrong Configuration.
This doesn't completely fix the bug, but it makes it much less likely.  We tell
the launcher once at the beginning of starting a reload because of SD cards coming
back, and once when we bind.

Bug: 3126698
Change-Id: I99ee6af38bef91e261832bad4dec978a5d4a8b3d
This commit is contained in:
Joe Onorato
2010-10-26 19:25:42 -07:00
parent 188eb40670
commit ec8345a13f
2 changed files with 51 additions and 4 deletions
+14 -1
View File
@@ -96,6 +96,7 @@ public class LauncherModel extends BroadcastReceiver {
private Bitmap mDefaultIcon;
public interface Callbacks {
public boolean setLoadOnResume();
public int getCurrentWorkspaceScreen();
public void startBinding();
public void bindItems(ArrayList<ItemInfo> shortcuts, int start, int end);
@@ -349,7 +350,19 @@ public class LauncherModel extends BroadcastReceiver {
String[] packages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_ADD, packages));
// Then, rebind everything.
startLoader(mApp, false);
boolean runLoader = true;
if (mCallbacks != null) {
Callbacks callbacks = mCallbacks.get();
if (callbacks != null) {
// If they're paused, we can skip loading, because they'll do it again anyway
if (callbacks.setLoadOnResume()) {
runLoader = false;
}
}
}
if (runLoader) {
startLoader(mApp, false);
}
} else if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action)) {
String[] packages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);