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

Commit e21167a9 authored by Ken Shirriff's avatar Ken Shirriff
Browse files

Fix widget stopListening NPE.

lookupHostLocked caller needs to check for null return value.
parent d4c00a17
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -473,10 +473,12 @@ class AppWidgetService extends IAppWidgetService.Stub
    public void stopListening(int hostId) {
    public void stopListening(int hostId) {
        synchronized (mAppWidgetIds) {
        synchronized (mAppWidgetIds) {
            Host host = lookupHostLocked(getCallingUid(), hostId);
            Host host = lookupHostLocked(getCallingUid(), hostId);
            if (host != null) {
                host.callbacks = null;
                host.callbacks = null;
                pruneHostLocked(host);
                pruneHostLocked(host);
            }
            }
        }
        }
    }


    boolean canAccessAppWidgetId(AppWidgetId id, int callingUid) {
    boolean canAccessAppWidgetId(AppWidgetId id, int callingUid) {
        if (id.host.uid == callingUid) {
        if (id.host.uid == callingUid) {