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

Commit 2d78fa2d authored by Amith Yamasani's avatar Amith Yamasani Committed by Android Git Automerger
Browse files

am ff7735b0: am a3db5297: Merge "ProviderMap: remove hashmap when entire user...

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

* commit 'ff7735b0':
  ProviderMap: remove hashmap when entire user specific entries are removed
parents ec42c3c3 ff7735b0
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);
            }
        }
    }