Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3e98d2a authored by Adam Cohen's avatar Adam Cohen Committed by Android Git Automerger
Browse files

am 642258a2: Merge "Tweaking how settings adds keyguard widgets" into jb-mr1-dev

* commit '642258a2':
  Tweaking how settings adds keyguard widgets
parents 7dc062a9 642258a2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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) {