Skip to content

Commit 26ee159

Browse files
author
Rubin Xu
committed
Set correct SDK level for new user restrictions
Mark DISALLOW_CAMERA_TOGGLE and DISALLOW_MICROPHONE_TOGGLE as supported on S and above only. Bug: 184927615 Test: manual Change-Id: Ib6101a723f2285daa8307963b04afee07a1055c3
1 parent ac7efff commit 26ee159

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,4 +379,9 @@ public UserRestriction(String key, int titleResId) {
379379
DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY,
380380
DISALLOW_CONFIG_PRIVATE_DNS,
381381
};
382+
383+
public static String[] SC_PLUS_RESTRICTIONS = {
384+
DISALLOW_MICROPHONE_TOGGLE,
385+
DISALLOW_CAMERA_TOGGLE,
386+
};
382387
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ private void constrainPreferences() {
146146
DpcPreferenceBase pref = (DpcPreferenceBase) findPreference(restriction);
147147
pref.setMinSdkVersion(VERSION_CODES.Q);
148148
}
149+
for (String restriction: UserRestriction.SC_PLUS_RESTRICTIONS) {
150+
DpcPreferenceBase pref = (DpcPreferenceBase) findPreference(restriction);
151+
pref.setMinSdkVersion(VERSION_CODES.S);
152+
}
149153
for (String restriction : UserRestriction.PRIMARY_USER_ONLY_RESTRICTIONS) {
150154
DpcPreferenceBase pref = (DpcPreferenceBase) findPreference(restriction);
151155
pref.setUserConstraint(DpcPreferenceHelper.USER_PRIMARY_USER);

0 commit comments

Comments
 (0)