Skip to content

Commit 4164da2

Browse files
jscott1989pfmaggi
authored andcommitted
No public description
PiperOrigin-RevId: 629381078
1 parent e4d2666 commit 4164da2

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/main/java/com/afwsamples/testdpc/policy/UserRestriction.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
import static android.os.UserManager.DISALLOW_SHARE_INTO_MANAGED_PROFILE;
7373
import static android.os.UserManager.DISALLOW_SHARE_LOCATION;
7474
import static android.os.UserManager.DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI;
75+
import static android.os.UserManager.DISALLOW_SIM_GLOBALLY;
7576
import static android.os.UserManager.DISALLOW_SMS;
7677
import static android.os.UserManager.DISALLOW_SYSTEM_ERROR_DIALOGS;
7778
import static android.os.UserManager.DISALLOW_ULTRA_WIDEBAND_RADIO;
@@ -219,6 +220,7 @@ public UserRestriction(String key, int titleResId, String permission) {
219220
DISALLOW_CONFIG_LOCALE, R.string.disallow_config_locale, MANAGE_DEVICE_POLICY_LOCALE),
220221
new UserRestriction(DISALLOW_ULTRA_WIDEBAND_RADIO, R.string.disallow_ultra_wideband_radio),
221222
new UserRestriction(DISALLOW_ASSIST_CONTENT, R.string.disallow_assist_content),
223+
new UserRestriction(DISALLOW_SIM_GLOBALLY, R.string.disallow_sim_globally),
222224
};
223225

224226
/**
@@ -371,6 +373,8 @@ public UserRestriction(String key, int titleResId, String permission) {
371373
DISALLOW_CELLULAR_2G, DISALLOW_CONFIG_DEFAULT_APPS, DISALLOW_ULTRA_WIDEBAND_RADIO,
372374
};
373375

376+
public static String[] VIC_PLUS_RESTRICTIONS = {DISALLOW_SIM_GLOBALLY};
377+
374378
public static String[] VIC_PLUS_PARENT_RESTRICTIONS = {
375379
DISALLOW_CONFIG_BRIGHTNESS, DISALLOW_CONFIG_SCREEN_TIMEOUT, DISALLOW_ASSIST_CONTENT
376380
};

src/main/java/com/afwsamples/testdpc/policy/UserRestrictionsDisplayFragment.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ private void constrainPreferences() {
169169
DpcPreferenceBase pref = (DpcPreferenceBase) findPreference(restriction);
170170
pref.setMinSdkVersion(VERSION_CODES.UPSIDE_DOWN_CAKE);
171171
}
172+
for (String restriction : UserRestriction.VIC_PLUS_RESTRICTIONS) {
173+
DpcPreferenceBase pref = (DpcPreferenceBase) findPreference(restriction);
174+
pref.setMinSdkVersion(VERSION_CODES.VANILLA_ICE_CREAM);
175+
}
172176
for (String restriction : UserRestriction.PRIMARY_USER_ONLY_RESTRICTIONS) {
173177
DpcPreferenceBase pref = (DpcPreferenceBase) findPreference(restriction);
174178
pref.setUserConstraint(DpcPreferenceHelper.USER_PRIMARY_USER);

src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@
546546
<string name="disallow_config_locale">Disallow config locale</string>
547547
<string name="disallow_ultra_wideband_radio">Disallow ultra wideband radio</string>
548548
<string name="disallow_assist_content">Disallow assist content</string>
549+
<string name="disallow_sim_globally">Disallow sim globally</string>
549550
<string name="user_restriction_error_msg">Operation not allowed</string>
550551

551552
<!-- Strings for select app -->

0 commit comments

Comments
 (0)