summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/AppWidgetServiceImpl.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-11-16 15:29:16 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-11-16 15:29:17 -0800
commit7b0c877959ee15c766cc7366ec6b4c024c211cd6 (patch)
treee07c0ff4d217f6b1647a66ed446aa4b7ec64e281 /services/java/com/android/server/AppWidgetServiceImpl.java
parenta9c0bb4a579a98cb7694e36454425c84a8c6510e (diff)
parent75b5cfb4a41030333820d072578a288d4ec9899c (diff)
downloadframeworks_base-7b0c877959ee15c766cc7366ec6b4c024c211cd6.zip
frameworks_base-7b0c877959ee15c766cc7366ec6b4c024c211cd6.tar.gz
frameworks_base-7b0c877959ee15c766cc7366ec6b4c024c211cd6.tar.bz2
Merge "Delete appWidgetId when removing lockscreen widgets" into jb-mr1.1-dev
Diffstat (limited to 'services/java/com/android/server/AppWidgetServiceImpl.java')
-rw-r--r--services/java/com/android/server/AppWidgetServiceImpl.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/services/java/com/android/server/AppWidgetServiceImpl.java b/services/java/com/android/server/AppWidgetServiceImpl.java
index d2354a6..fe92b26 100644
--- a/services/java/com/android/server/AppWidgetServiceImpl.java
+++ b/services/java/com/android/server/AppWidgetServiceImpl.java
@@ -1358,6 +1358,28 @@ class AppWidgetServiceImpl {
}
}
+ static int[] getAppWidgetIds(Host h) {
+ int instancesSize = h.instances.size();
+ int appWidgetIds[] = new int[instancesSize];
+ for (int i = 0; i < instancesSize; i++) {
+ appWidgetIds[i] = h.instances.get(i).appWidgetId;
+ }
+ return appWidgetIds;
+ }
+
+ public int[] getAppWidgetIdsForHost(int hostId) {
+ synchronized (mAppWidgetIds) {
+ ensureStateLoadedLocked();
+ int callingUid = Binder.getCallingUid();
+ Host host = lookupHostLocked(callingUid, hostId);
+ if (host != null) {
+ return getAppWidgetIds(host);
+ } else {
+ return new int[0];
+ }
+ }
+ }
+
private Provider parseProviderInfoXml(ComponentName component, ResolveInfo ri) {
Provider p = null;