From c28f98a7e8f53c88cb5bea73c71b70eda177954f Mon Sep 17 00:00:00 2001 From: Eran Messeri Date: Thu, 7 Feb 2019 15:19:23 +0000 Subject: [PATCH] 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 --- .../core/java/com/android/server/pm/UserRestrictionsUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java index 8d64b810b4075..18e292feba30b 100644 --- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java +++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java @@ -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: