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

Commit a3db5297 authored by Amith Yamasani's avatar Amith Yamasani Committed by android code review
Browse files

Merge "ProviderMap: remove hashmap when entire user specific entries are removed"

parents 6626398a 8809004b
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -127,7 +127,12 @@ public class ProviderMap {
                Slog.i(TAG,
                        "Removing from providersByName name=" + name + " user="
                        + (optionalUserId == -1 ? Binder.getOrigCallingUser() : optionalUserId));
            getProvidersByName(optionalUserId).remove(name);
            HashMap<String, ContentProviderRecord> map = getProvidersByName(optionalUserId);
            // map returned by getProvidersByName wouldn't be null
            map.remove(name);
            if (map.size() == 0) {
                mProvidersByNamePerUser.remove(optionalUserId);
            }
        }
    }

@@ -141,7 +146,12 @@ public class ProviderMap {
                Slog.i(TAG,
                        "Removing from providersByClass name=" + name + " user="
                        + (optionalUserId == -1 ? Binder.getOrigCallingUser() : optionalUserId));
            getProvidersByClass(optionalUserId).remove(name);
            HashMap<ComponentName, ContentProviderRecord> map = getProvidersByClass(optionalUserId);
            // map returned by getProvidersByClass wouldn't be null
            map.remove(name);
            if (map.size() == 0) {
                mProvidersByClassPerUser.remove(optionalUserId);
            }
        }
    }