summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-11-16 15:31:07 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-11-16 15:31:07 -0800
commitcf474b1a10a1349d0d6d6f7cbb5d48489bacfb09 (patch)
tree8fd2ae97db3ed148872155baa05dddcf16b58f47 /services
parentdbcdb1a854b155605fe69dc47b8f6e4e441c817d (diff)
parent7b0c877959ee15c766cc7366ec6b4c024c211cd6 (diff)
downloadframeworks_base-cf474b1a10a1349d0d6d6f7cbb5d48489bacfb09.zip
frameworks_base-cf474b1a10a1349d0d6d6f7cbb5d48489bacfb09.tar.gz
frameworks_base-cf474b1a10a1349d0d6d6f7cbb5d48489bacfb09.tar.bz2
am 7b0c8779: Merge "Delete appWidgetId when removing lockscreen widgets" into jb-mr1.1-dev
* commit '7b0c877959ee15c766cc7366ec6b4c024c211cd6': Delete appWidgetId when removing lockscreen widgets
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/AppWidgetService.java5
-rw-r--r--services/java/com/android/server/AppWidgetServiceImpl.java22
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;