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

Commit 4912f160 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix to clear calling identity when binding a widget.

Change-Id: Id66abc50ec9ee69317b9838f302c4153995664f7
parent 576715c7
Loading
Loading
Loading
Loading
+40 −34
Original line number Diff line number Diff line
@@ -395,6 +395,9 @@ class AppWidgetService extends IAppWidgetService.Stub
    public void bindAppWidgetId(int appWidgetId, ComponentName provider) {
        mContext.enforceCallingPermission(android.Manifest.permission.BIND_APPWIDGET,
                "bindGagetId appWidgetId=" + appWidgetId + " provider=" + provider);
        
        final long ident = Binder.clearCallingIdentity();
        try {
            synchronized (mAppWidgetIds) {
                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
                if (id == null) {
@@ -431,6 +434,9 @@ class AppWidgetService extends IAppWidgetService.Stub
                registerForBroadcastsLocked(p, getAppWidgetIds(p));
                saveStateLocked();
            }
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
    }

    // Binds to a specific RemoteViewsService