Fix widget update issue

This fixes an issue where widgets weren't being updated.  It
was caused by creating widgets with the wrong package id.
Keyguard used to be identified with package "android" when it
was running in the system proces.  Now that it's separate, we need
to explicitly pass in the package name for keyguard ("com.android.keyguard")
when we allocate app widget ids.

Change-Id: I4911be8533ea4d24c64669fe98d03f39a684f55a
This commit is contained in:
Jim Miller
2013-03-05 15:33:54 -08:00
parent 0c701c623a
commit 32f48dd41b

View File

@@ -517,8 +517,8 @@ public class KeyguardAppWidgetPickActivity extends Activity
// Found in KeyguardHostView.java
final int KEYGUARD_HOST_ID = 0x4B455947;
int userId = ActivityManager.getCurrentUser();
mAppWidgetId = AppWidgetHost.allocateAppWidgetIdForSystem(KEYGUARD_HOST_ID,
userId);
mAppWidgetId = AppWidgetHost.allocateAppWidgetIdForPackage(KEYGUARD_HOST_ID,
userId, "com.android.keyguard");
}
mAppWidgetManager.bindAppWidgetId(
mAppWidgetId, intent.getComponent(), mExtraConfigureOptions);