summaryrefslogtreecommitdiffstats
path: root/services/appwidget
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2014-08-05 18:57:05 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2014-08-07 00:12:27 +0000
commitc71c42fdb2ee54a419dc8eb0a5f4f82532b16c0c (patch)
tree87aed5a3e13bd4ea8afbc811948e09b72dd98909 /services/appwidget
parentbc2fef0b2a065aafacebe69bae53bd0e0fb9ef67 (diff)
downloadframeworks_base-c71c42fdb2ee54a419dc8eb0a5f4f82532b16c0c.zip
frameworks_base-c71c42fdb2ee54a419dc8eb0a5f4f82532b16c0c.tar.gz
frameworks_base-c71c42fdb2ee54a419dc8eb0a5f4f82532b16c0c.tar.bz2
Polish of the app widgets cross-profiles feature.
1. Added API for badging an arbitrary drawable at a given location. 2. Updated the icon and previewImage deprecation as they are no longer returning a badged drawable. The methods to load the icon and the preview are now just making it easier for a developer to get the drawables. 3. Fixed a bug in AppWidgetServiceImpl leading to a crash when a user is removed. 4. Fixed a bug in AppWidgetHost which was unnecessarily caching its package name and having code paths where the cached value was not populated when calling into the system. bug:14991269 Change-Id: I50d011a6597d88814715d5ec04ee67815e8ce0bd
Diffstat (limited to 'services/appwidget')
-rw-r--r--services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index bdaf9ec..e9d0c46 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -2732,13 +2732,16 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
}
// Take a note we no longer have state for this user.
- final int index = mLoadedUserIds.indexOfKey(userId);
- if (index >= 0) {
- mLoadedUserIds.removeAt(index);
+ final int userIndex = mLoadedUserIds.indexOfKey(userId);
+ if (userIndex >= 0) {
+ mLoadedUserIds.removeAt(userIndex);
}
// Remove the widget id counter.
- mNextAppWidgetIds.removeAt(userId);
+ final int nextIdIndex = mNextAppWidgetIds.indexOfKey(userId);
+ if (nextIdIndex >= 0) {
+ mNextAppWidgetIds.removeAt(nextIdIndex);
+ }
}
}