summaryrefslogtreecommitdiff
path: root/core/java/android/appwidget/AppWidgetHost.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-09-18 13:39:42 -0700
committerAdam Cohen <adamcohen@google.com>2012-09-18 14:38:04 -0700
commit60264730c1c730dbd184bc661fd398d97f5df31d (patch)
treed9ecf6191ab1900a50b7799f8e49ea2f0e53b3c5 /core/java/android/appwidget/AppWidgetHost.java
parent6b58fde99a2c78e4ef66679dd62eb29848e9a9f7 (diff)
Tweaking how settings adds keyguard widgets
-> Fix for issue 7173587 -> Fix for issue 7173877 Change-Id: I60cd3952113335df60292f67461d50f6c8bd2ed3
Diffstat (limited to 'core/java/android/appwidget/AppWidgetHost.java')
-rw-r--r--core/java/android/appwidget/AppWidgetHost.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/appwidget/AppWidgetHost.java b/core/java/android/appwidget/AppWidgetHost.java
index 84a447f4ca4c..185fb5a8de59 100644
--- a/core/java/android/appwidget/AppWidgetHost.java
+++ b/core/java/android/appwidget/AppWidgetHost.java
@@ -19,6 +19,7 @@ package android.appwidget;
import java.util.ArrayList;
import java.util.HashMap;
+import android.app.ActivityThread;
import android.content.Context;
import android.os.Handler;
import android.os.IBinder;
@@ -201,12 +202,15 @@ public class AppWidgetHost {
* @return a appWidgetId
* @hide
*/
- public static int allocateAppWidgetIdForHost(String packageName, int hostId) {
+ public static int allocateAppWidgetIdForSystem(int hostId) {
checkCallerIsSystem();
try {
if (sService == null) {
bindService();
}
+ Context systemContext =
+ (Context) ActivityThread.currentActivityThread().getSystemContext();
+ String packageName = systemContext.getPackageName();
return sService.allocateAppWidgetId(packageName, hostId);
} catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
@@ -240,7 +244,7 @@ public class AppWidgetHost {
* Stop listening to changes for this AppWidget.
* @hide
*/
- public static void deleteAppWidgetIdForHost(int appWidgetId) {
+ public static void deleteAppWidgetIdForSystem(int appWidgetId) {
checkCallerIsSystem();
try {
if (sService == null) {