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

Commit c1972e1f authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix to clear calling identity when binding a widget."

parents 280b7fd0 4912f160
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