Clear binder identity before checking with compat service

Bug: 149673005
Test: manual
Change-Id: I3afa190d658106e6fa31bfe11d5dd9775c108887
This commit is contained in:
Soonil Nagarkar
2020-03-02 15:37:01 -08:00
parent a903ed0d7a
commit e21ba28bec

View File

@@ -11814,12 +11814,15 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
}
private boolean isSetSecureSettingLocationModeCheckEnabled(String packageName, int userId) {
long ident = mInjector.binderClearCallingIdentity();
try {
return mIPlatformCompat.isChangeEnabledByPackageName(USE_SET_LOCATION_ENABLED,
packageName, userId);
} catch (RemoteException e) {
Log.e(LOG_TAG, "Failed to get a response from PLATFORM_COMPAT_SERVICE", e);
return getTargetSdk(packageName, userId) > Build.VERSION_CODES.Q;
} finally {
mInjector.binderRestoreCallingIdentity(ident);
}
}