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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user