Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +7 −14 Original line number Original line Diff line number Diff line Loading @@ -1687,19 +1687,10 @@ public class SettingsProvider extends ContentProvider { } } private List<String> getSettingsNamesLocked(int settingsType, int userId) { private List<String> getSettingsNamesLocked(int settingsType, int userId) { boolean instantApp; // Don't enforce the instant app whitelist for now -- its too prone to unintended breakage if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { // in the current form. instantApp = false; } else { ApplicationInfo ai = getCallingApplicationInfoOrThrow(); instantApp = ai.isInstantApp(); } if (instantApp) { return new ArrayList<String>(getInstantAppAccessibleSettings(settingsType)); } else { return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId); return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId); } } } private void enforceSettingReadable(String settingName, int settingsType, int userId) { private void enforceSettingReadable(String settingName, int settingsType, int userId) { if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { Loading @@ -1711,8 +1702,10 @@ public class SettingsProvider extends ContentProvider { } } if (!getInstantAppAccessibleSettings(settingsType).contains(settingName) if (!getInstantAppAccessibleSettings(settingsType).contains(settingName) && !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) { && !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) { throw new SecurityException("Setting " + settingName + " is not accessible from" // Don't enforce the instant app whitelist for now -- its too prone to unintended + " ephemeral package " + getCallingPackage()); // breakage in the current form. Slog.w(LOG_TAG, "Instant App " + ai.packageName + " trying to access unexposed setting, this will be an error in the future."); } } } } Loading Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +7 −14 Original line number Original line Diff line number Diff line Loading @@ -1687,19 +1687,10 @@ public class SettingsProvider extends ContentProvider { } } private List<String> getSettingsNamesLocked(int settingsType, int userId) { private List<String> getSettingsNamesLocked(int settingsType, int userId) { boolean instantApp; // Don't enforce the instant app whitelist for now -- its too prone to unintended breakage if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { // in the current form. instantApp = false; } else { ApplicationInfo ai = getCallingApplicationInfoOrThrow(); instantApp = ai.isInstantApp(); } if (instantApp) { return new ArrayList<String>(getInstantAppAccessibleSettings(settingsType)); } else { return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId); return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId); } } } private void enforceSettingReadable(String settingName, int settingsType, int userId) { private void enforceSettingReadable(String settingName, int settingsType, int userId) { if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { Loading @@ -1711,8 +1702,10 @@ public class SettingsProvider extends ContentProvider { } } if (!getInstantAppAccessibleSettings(settingsType).contains(settingName) if (!getInstantAppAccessibleSettings(settingsType).contains(settingName) && !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) { && !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) { throw new SecurityException("Setting " + settingName + " is not accessible from" // Don't enforce the instant app whitelist for now -- its too prone to unintended + " ephemeral package " + getCallingPackage()); // breakage in the current form. Slog.w(LOG_TAG, "Instant App " + ai.packageName + " trying to access unexposed setting, this will be an error in the future."); } } } } Loading