update promise icon status

also fix a crash in LauncherModel.DEBUG_LOADERS

Bug: 10778992
Change-Id: Iafc28c1e0c2f2a1283783a7ce27e181634b62993
This commit is contained in:
Chris Wren
2014-02-14 16:59:24 -05:00
parent bfbd52a5e6
commit aeff7ea434
9 changed files with 268 additions and 64 deletions

View File

@@ -173,6 +173,7 @@ public class LauncherModel extends BroadcastReceiver {
ArrayList<ItemInfo> addAnimated,
ArrayList<AppInfo> addedApps);
public void bindAppsUpdated(ArrayList<AppInfo> apps);
public void updatePackageState(String pkgName, int state);
public void bindComponentsRemoved(ArrayList<String> packageNames,
ArrayList<AppInfo> appInfos);
public void bindPackagesUpdated(ArrayList<Object> widgetsAndShortcuts);
@@ -296,6 +297,19 @@ public class LauncherModel extends BroadcastReceiver {
return null;
}
public void setPackageState(final String pkgName, final int state) {
// Process the updated package state
Runnable r = new Runnable() {
public void run() {
Callbacks callbacks = mCallbacks != null ? mCallbacks.get() : null;
if (callbacks != null) {
callbacks.updatePackageState(pkgName, state);
}
}
};
mHandler.post(r);
}
public void addAppsToAllApps(final Context ctx, final ArrayList<AppInfo> allAppsApps) {
final Callbacks callbacks = mCallbacks != null ? mCallbacks.get() : null;
@@ -2193,7 +2207,12 @@ public class LauncherModel extends BroadcastReceiver {
line += " | ";
}
for (int x = 0; x < countX; x++) {
line += ((occupied.get(screenId)[x][y] != null) ? "#" : ".");
ItemInfo[][] screen = occupied.get(screenId);
if (x < screen.length && y < screen[x].length) {
line += (screen[x][y] != null) ? "#" : ".";
} else {
line += "!";
}
}
}
Log.d(TAG, "[ " + line + " ]");