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

Commit 60264730 authored by Adam Cohen's avatar Adam Cohen
Browse files

Tweaking how settings adds keyguard widgets

-> Fix for issue 7173587
-> Fix for issue 7173877

Change-Id: I60cd3952113335df60292f67461d50f6c8bd2ed3
parent 6b58fde9
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) {