[SettingsProvider] do not check @Readable for system/priv apps in the server

We already have this check on the client side. Copying it over to the
server side for cases when the server side is called directly.

BUG: 175024829
Test: atest com.android.devicehealthchecks.SystemAppCheck#system_app_crash
Change-Id: Ib540b9bdb29343eec79a2f31e0b26fe333117395
This commit is contained in:
Songchun Fan
2021-03-10 23:14:43 +00:00
parent 167dea1218
commit 403d4ee851

View File

@@ -1937,8 +1937,11 @@ public class SettingsProvider extends ContentProvider {
if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) {
return;
}
checkReadableAnnotation(settingsType, settingName);
ApplicationInfo ai = getCallingApplicationInfoOrThrow();
if (ai.isSystemApp() || ai.isSignedWithPlatformKey()) {
return;
}
checkReadableAnnotation(settingsType, settingName);
if (!ai.isInstantApp()) {
return;
}