Fix bug in DPM#setDrawable

Fixes: 229265302
Test: atest android.devicepolicy.cts.DevicePolicyResourcesTests
Change-Id: Ida6e72565733c717243a2ffc83b6b5975a9b5a3b
This commit is contained in:
kholoud mohamed
2022-04-21 09:10:37 +01:00
parent 8e54279331
commit aef103de2f

View File

@@ -141,11 +141,11 @@ class DeviceManagementResourcesProvider {
String drawableId, String drawableSource, String drawableStyle,
ParcelableResource updatableResource) {
synchronized (mLock) {
Map<String, Map<String, ParcelableResource>> drawablesForId =
mUpdatedDrawablesForSource.get(drawableId);
if (!mUpdatedDrawablesForSource.containsKey(drawableId)) {
mUpdatedDrawablesForSource.put(drawableId, new HashMap<>());
}
Map<String, Map<String, ParcelableResource>> drawablesForId =
mUpdatedDrawablesForSource.get(drawableId);
if (!drawablesForId.containsKey(drawableSource)) {
mUpdatedDrawablesForSource.get(drawableId).put(drawableSource, new HashMap<>());
}