Loading packages/SettingsLib/src/com/android/settingslib/RestrictedDropDownPreference.java +14 −1 Original line number Original line Diff line number Diff line Loading @@ -41,10 +41,23 @@ public class RestrictedDropDownPreference extends DropDownPreference implements * package. Marks the preference as disabled if so. * package. Marks the preference as disabled if so. * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName, boolean settingEnabled) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, settingEnabled); } /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * TODO b/390196024: remove this and update all callers to use the "settingEnabled" version * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for */ */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName); mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, false); } } @Override @Override Loading packages/SettingsLib/src/com/android/settingslib/RestrictedPreference.java +14 −1 Original line number Original line Diff line number Diff line Loading @@ -107,12 +107,25 @@ public class RestrictedPreference extends TwoTargetPreference implements /** /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * package. Marks the preference as disabled if so. * TODO b/390196024: remove this and update all callers to use the "settingEnabled" version * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for */ */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName); mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, false); } /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName, boolean settingEnabled) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, settingEnabled); } } @Override @Override Loading packages/SettingsLib/src/com/android/settingslib/RestrictedPreferenceHelper.java +18 −1 Original line number Original line Diff line number Diff line Loading @@ -204,15 +204,32 @@ public class RestrictedPreferenceHelper { * package. Marks the preference as disabled if so. * package. Marks the preference as disabled if so. * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName, boolean settingEnabled) { updatePackageDetails(packageName, android.os.Process.INVALID_UID); updatePackageDetails(packageName, android.os.Process.INVALID_UID); if (settingEnabled) { setDisabledByEcm(null); return; } Intent intent = RestrictedLockUtilsInternal.checkIfRequiresEnhancedConfirmation( Intent intent = RestrictedLockUtilsInternal.checkIfRequiresEnhancedConfirmation( mContext, settingIdentifier, packageName); mContext, settingIdentifier, packageName); setDisabledByEcm(intent); setDisabledByEcm(intent); } } /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * TODO b/390196024: remove this and update all callers to use the "settingEnabled" version * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, false); } /** /** * @return EnforcedAdmin if we have been passed the restriction in the xml. * @return EnforcedAdmin if we have been passed the restriction in the xml. */ */ Loading packages/SettingsLib/src/com/android/settingslib/RestrictedSelectorWithWidgetPreference.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -134,10 +134,11 @@ public class RestrictedSelectorWithWidgetPreference extends SelectorWithWidgetPr * * * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ */ public void checkEcmRestrictionAndSetDisabled( public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName, boolean settingEnabled) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName); mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, settingEnabled); } } @Override @Override Loading packages/SettingsLib/src/com/android/settingslib/RestrictedSwitchPreference.java +15 −2 Original line number Original line Diff line number Diff line Loading @@ -220,10 +220,23 @@ public class RestrictedSwitchPreference extends SwitchPreferenceCompat implement * package. Marks the preference as disabled if so. * package. Marks the preference as disabled if so. * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName, boolean settingEnabled) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, settingEnabled); } /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * TODO b/390196024: remove this and update all callers to use the "settingEnabled" version * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for */ */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName); mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, false); } } @Override @Override Loading Loading
packages/SettingsLib/src/com/android/settingslib/RestrictedDropDownPreference.java +14 −1 Original line number Original line Diff line number Diff line Loading @@ -41,10 +41,23 @@ public class RestrictedDropDownPreference extends DropDownPreference implements * package. Marks the preference as disabled if so. * package. Marks the preference as disabled if so. * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName, boolean settingEnabled) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, settingEnabled); } /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * TODO b/390196024: remove this and update all callers to use the "settingEnabled" version * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for */ */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName); mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, false); } } @Override @Override Loading
packages/SettingsLib/src/com/android/settingslib/RestrictedPreference.java +14 −1 Original line number Original line Diff line number Diff line Loading @@ -107,12 +107,25 @@ public class RestrictedPreference extends TwoTargetPreference implements /** /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * package. Marks the preference as disabled if so. * TODO b/390196024: remove this and update all callers to use the "settingEnabled" version * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for */ */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName); mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, false); } /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName, boolean settingEnabled) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, settingEnabled); } } @Override @Override Loading
packages/SettingsLib/src/com/android/settingslib/RestrictedPreferenceHelper.java +18 −1 Original line number Original line Diff line number Diff line Loading @@ -204,15 +204,32 @@ public class RestrictedPreferenceHelper { * package. Marks the preference as disabled if so. * package. Marks the preference as disabled if so. * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName, boolean settingEnabled) { updatePackageDetails(packageName, android.os.Process.INVALID_UID); updatePackageDetails(packageName, android.os.Process.INVALID_UID); if (settingEnabled) { setDisabledByEcm(null); return; } Intent intent = RestrictedLockUtilsInternal.checkIfRequiresEnhancedConfirmation( Intent intent = RestrictedLockUtilsInternal.checkIfRequiresEnhancedConfirmation( mContext, settingIdentifier, packageName); mContext, settingIdentifier, packageName); setDisabledByEcm(intent); setDisabledByEcm(intent); } } /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * TODO b/390196024: remove this and update all callers to use the "settingEnabled" version * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, false); } /** /** * @return EnforcedAdmin if we have been passed the restriction in the xml. * @return EnforcedAdmin if we have been passed the restriction in the xml. */ */ Loading
packages/SettingsLib/src/com/android/settingslib/RestrictedSelectorWithWidgetPreference.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -134,10 +134,11 @@ public class RestrictedSelectorWithWidgetPreference extends SelectorWithWidgetPr * * * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ */ public void checkEcmRestrictionAndSetDisabled( public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName, boolean settingEnabled) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName); mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, settingEnabled); } } @Override @Override Loading
packages/SettingsLib/src/com/android/settingslib/RestrictedSwitchPreference.java +15 −2 Original line number Original line Diff line number Diff line Loading @@ -220,10 +220,23 @@ public class RestrictedSwitchPreference extends SwitchPreferenceCompat implement * package. Marks the preference as disabled if so. * package. Marks the preference as disabled if so. * @param settingIdentifier The key identifying the setting * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for * @param packageName the package to check the settingIdentifier for * @param settingEnabled Whether the setting in question is enabled */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName, boolean settingEnabled) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, settingEnabled); } /** * Checks if the given setting is subject to Enhanced Confirmation Mode restrictions for this * package. Marks the preference as disabled if so. * TODO b/390196024: remove this and update all callers to use the "settingEnabled" version * @param settingIdentifier The key identifying the setting * @param packageName the package to check the settingIdentifier for */ */ public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, public void checkEcmRestrictionAndSetDisabled(@NonNull String settingIdentifier, @NonNull String packageName) { @NonNull String packageName) { mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName); mHelper.checkEcmRestrictionAndSetDisabled(settingIdentifier, packageName, false); } } @Override @Override Loading