Merge "Tweaking how settings adds keyguard widgets" into jb-mr1-dev
diff --git a/core/java/android/appwidget/AppWidgetHost.java b/core/java/android/appwidget/AppWidgetHost.java
index 84a447f..185fb5a 100644
--- a/core/java/android/appwidget/AppWidgetHost.java
+++ b/core/java/android/appwidget/AppWidgetHost.java
@@ -19,6 +19,7 @@
 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 @@
      * @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 @@
      * 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) {