diff options
| author | Michael Jurka <mikejurka@google.com> | 2012-11-16 15:29:16 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-11-16 15:29:17 -0800 |
| commit | 7b0c877959ee15c766cc7366ec6b4c024c211cd6 (patch) | |
| tree | e07c0ff4d217f6b1647a66ed446aa4b7ec64e281 /services/java/com/android | |
| parent | a9c0bb4a579a98cb7694e36454425c84a8c6510e (diff) | |
| parent | 75b5cfb4a41030333820d072578a288d4ec9899c (diff) | |
| download | frameworks_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')
| -rw-r--r-- | services/java/com/android/server/AppWidgetService.java | 5 | ||||
| -rw-r--r-- | services/java/com/android/server/AppWidgetServiceImpl.java | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/services/java/com/android/server/AppWidgetService.java b/services/java/com/android/server/AppWidgetService.java index 532b36a..9590712 100644 --- a/services/java/com/android/server/AppWidgetService.java +++ b/services/java/com/android/server/AppWidgetService.java @@ -146,6 +146,11 @@ class AppWidgetService extends IAppWidgetService.Stub return getImplForUser(getCallingOrCurrentUserId()).allocateAppWidgetId( packageName, hostId); } + + @Override + public int[] getAppWidgetIdsForHost(int hostId) throws RemoteException { + return getImplForUser(getCallingOrCurrentUserId()).getAppWidgetIdsForHost(hostId); + } @Override public void deleteAppWidgetId(int appWidgetId) throws RemoteException { 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; |
