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

Commit 21ace3f3 authored by Jim Miller's avatar Jim Miller
Browse files

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: I48e1b78d97aa3d0271773219e477d3b741994901
parent bf182c88
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -210,20 +210,17 @@ public class AppWidgetHost {
    }

    /**
     * Get a appWidgetId for a host in the calling process.
     * Get a appWidgetId for a host in the given package.
     *
     * @return a appWidgetId
     * @hide
     */
    public static int allocateAppWidgetIdForSystem(int hostId, int userId) {
    public static int allocateAppWidgetIdForPackage(int hostId, int userId, String packageName) {
        checkCallerIsSystem();
        try {
            if (sService == null) {
                bindService();
            }
            Context systemContext =
                    (Context) ActivityThread.currentActivityThread().getSystemContext();
            String packageName = systemContext.getPackageName();
            return sService.allocateAppWidgetId(packageName, hostId, userId);
        } catch (RemoteException e) {
            throw new RuntimeException("system server dead?", e);