am 7b61beb3: am c88dceb0: Always set the LauncherAppState context before using it from a broadcast. (Bug 10947459)

* commit '7b61beb35fe8d6a30f39875d365725f12c544d75':
  Always set the LauncherAppState context before using it from a broadcast. (Bug 10947459)
This commit is contained in:
Winson Chung authored and Android Git Automerger committed 2013-09-27 15:10:06 -07:00
commit 8675ec1d88
2 files changed
+2

No files matched your search

@@ -224,6 +224,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
data.getParcelableExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE);
// Queue the item up for adding if launcher has not loaded properly yet
LauncherAppState.setApplicationContext(context.getApplicationContext());
LauncherAppState app = LauncherAppState.getInstance();
boolean launcherNotLoaded = (app.getDynamicGrid() == null);
@@ -78,6 +78,7 @@ public class UninstallShortcutReceiver extends BroadcastReceiver {
PendingUninstallShortcutInfo pendingInfo) {
final Intent data = pendingInfo.data;
LauncherAppState.setApplicationContext(context.getApplicationContext());
LauncherAppState app = LauncherAppState.getInstance();
synchronized (app) { // TODO: make removeShortcut internally threadsafe
removeShortcut(context, data);