Skip to content

Commit 211a1a1

Browse files
committed
Support Private DNS User restriction
Allow application of the DISALLOW_CONFIG_PRIVATE_DNS user restriction. Bug: 112982691 Test: Manual, set the user restriction and verified the settings cannot be changed. Change-Id: Id2738ff16f1fa485655705bb84a61222a2054b99
1 parent 7e7228c commit 211a1a1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public class UserRestriction {
5555
public static final String DISALLOW_PRINTING= "no_printing";
5656
public static final String DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY =
5757
"no_install_unknown_sources_globally";
58+
public static final String DISALLOW_CONFIG_PRIVATE_DNS =
59+
"disallow_config_private_dns";
5860

5961
public String key;
6062
public int titleResId;
@@ -206,6 +208,9 @@ public UserRestriction(String key, int titleResId) {
206208
new UserRestriction(
207209
DISALLOW_PRINTING,
208210
R.string.disallow_printing),
211+
new UserRestriction(
212+
DISALLOW_CONFIG_PRIVATE_DNS,
213+
R.string.disallow_config_private_dns),
209214
};
210215

211216
/**
@@ -234,7 +239,8 @@ public UserRestriction(String key, int titleResId) {
234239
DISALLOW_SMS,
235240
DISALLOW_UNMUTE_MICROPHONE,
236241
DISALLOW_USB_FILE_TRANSFER,
237-
DISALLOW_AIRPLANE_MODE
242+
DISALLOW_AIRPLANE_MODE,
243+
DISALLOW_CONFIG_PRIVATE_DNS,
238244
};
239245

240246
/**
@@ -305,5 +311,6 @@ public UserRestriction(String key, int titleResId) {
305311

306312
public static String[] QT_PLUS_RESTRICTIONS = {
307313
DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY,
314+
DISALLOW_CONFIG_PRIVATE_DNS,
308315
};
309316
}

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@
466466
<string name="disallow_ambient_display">Disallow ambient display</string>
467467
<string name="disallow_share_into_work_profile">Disallow sharing data into the profile</string>
468468
<string name="disallow_printing">Disallow printing</string>
469+
<string name="disallow_config_private_dns">Disallow config Private DNS</string>
469470
<string name="user_restriction_error_msg">Operation not allowed</string>
470471

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

0 commit comments

Comments
 (0)