Private DNS: Do not apply user restriction to system

Do not apply the user restriction for changing the Private DNS settings
to the system caller.
That will fix a bug where the DevicePolicyManager API for setting the
values of Private DNS-related settings would not apply.

Bug: 120416121
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testPrivateDnsPolicy
Change-Id: I26618a91224ac06e23ab86e96bc9b59d5325d3a0
This commit is contained in:
Eran Messeri
2019-02-07 15:19:23 +00:00
parent 31e6a70ca1
commit c28f98a7e8

View File

@@ -743,6 +743,9 @@ public class UserRestrictionsUtils {
case android.provider.Settings.Global.PRIVATE_DNS_MODE:
case android.provider.Settings.Global.PRIVATE_DNS_SPECIFIER:
if (callingUid == Process.SYSTEM_UID) {
return false;
}
restriction = UserManager.DISALLOW_CONFIG_PRIVATE_DNS;
break;
default: