Skip to content

Commit 642258a

Browse files
Adam CohenAndroid (Google) Code Review
authored andcommitted
Merge "Tweaking how settings adds keyguard widgets" into jb-mr1-dev
2 parents dbed514 + 6026473 commit 642258a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/java/android/appwidget/AppWidgetHost.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.ArrayList;
2020
import java.util.HashMap;
2121

22+
import android.app.ActivityThread;
2223
import android.content.Context;
2324
import android.os.Handler;
2425
import android.os.IBinder;
@@ -201,12 +202,15 @@ public int allocateAppWidgetId() {
201202
* @return a appWidgetId
202203
* @hide
203204
*/
204-
public static int allocateAppWidgetIdForHost(String packageName, int hostId) {
205+
public static int allocateAppWidgetIdForSystem(int hostId) {
205206
checkCallerIsSystem();
206207
try {
207208
if (sService == null) {
208209
bindService();
209210
}
211+
Context systemContext =
212+
(Context) ActivityThread.currentActivityThread().getSystemContext();
213+
String packageName = systemContext.getPackageName();
210214
return sService.allocateAppWidgetId(packageName, hostId);
211215
} catch (RemoteException e) {
212216
throw new RuntimeException("system server dead?", e);
@@ -240,7 +244,7 @@ public void deleteAppWidgetId(int appWidgetId) {
240244
* Stop listening to changes for this AppWidget.
241245
* @hide
242246
*/
243-
public static void deleteAppWidgetIdForHost(int appWidgetId) {
247+
public static void deleteAppWidgetIdForSystem(int appWidgetId) {
244248
checkCallerIsSystem();
245249
try {
246250
if (sService == null) {

0 commit comments

Comments
 (0)