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

Commit d958bbff authored by Song Chun Fan's avatar Song Chun Fan Committed by Automerger Merge Worker
Browse files

Merge "[SettingsProvider] workaround for DevicePolicyResourcesManager" into...

Merge "[SettingsProvider] workaround for DevicePolicyResourcesManager" into tm-qpr-dev am: 053dd71d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20302671



Change-Id: I62b3084f9172f8e7b1023767197e3978ab435935
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 30131318 053dd71d
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
@@ -3344,9 +3344,26 @@ public final class Settings {
                    }
                }
                Bundle b;
                // b/252663068: if we're in system server and the caller did not call
                // clearCallingIdentity, the read would fail due to mismatched AttributionSources.
                // TODO(b/256013480): remove this bypass after fixing the callers in system server.
                if (namespace.equals(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER)
                        && Settings.isInSystemServer()
                        && Binder.getCallingUid() != Process.myUid()) {
                    final long token = Binder.clearCallingIdentity();
                    try {
                        // Fetch all flags for the namespace at once for caching purposes
                        b = cp.call(cr.getAttributionSource(),
                                mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
                    } finally {
                        Binder.restoreCallingIdentity(token);
                    }
                } else {
                    // Fetch all flags for the namespace at once for caching purposes
                Bundle b = cp.call(cr.getAttributionSource(),
                    b = cp.call(cr.getAttributionSource(),
                            mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
                }
                if (b == null) {
                    // Invalid response, return an empty map
                    return keyValues;