From 1e2b7318ba852c50554f3acd927b3bea0cdff445 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Wed, 28 Feb 2018 10:47:48 +0000 Subject: [PATCH] Use putIntForUser to turn off ambient display secure settings - Without forUser we'll be turning off ambient display in primary user instead Test: Use TestDPC to set DISALLOW_AMBIENT_DISPLAY in secondary users, ambient display is actually turned off Bug: 72487689 Change-Id: I11a7a5304fcc609ab37594ad5d28814c217bc7f5 --- .../server/pm/UserRestrictionsUtils.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java index 41570c48c4745..b5d83267d6091 100644 --- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java +++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java @@ -565,21 +565,21 @@ public class UserRestrictionsUtils { break; case UserManager.DISALLOW_AMBIENT_DISPLAY: if (newValue) { - android.provider.Settings.Secure.putString( + android.provider.Settings.Secure.putIntForUser( context.getContentResolver(), - Settings.Secure.DOZE_ENABLED, "0"); - android.provider.Settings.Secure.putString( + Settings.Secure.DOZE_ENABLED, 0, userId); + android.provider.Settings.Secure.putIntForUser( context.getContentResolver(), - Settings.Secure.DOZE_ALWAYS_ON, "0"); - android.provider.Settings.Secure.putString( + Settings.Secure.DOZE_ALWAYS_ON, 0, userId); + android.provider.Settings.Secure.putIntForUser( context.getContentResolver(), - Settings.Secure.DOZE_PULSE_ON_PICK_UP, "0"); - android.provider.Settings.Secure.putString( + Settings.Secure.DOZE_PULSE_ON_PICK_UP, 0, userId); + android.provider.Settings.Secure.putIntForUser( context.getContentResolver(), - Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, "0"); - android.provider.Settings.Secure.putString( + Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, 0, userId); + android.provider.Settings.Secure.putIntForUser( context.getContentResolver(), - Settings.Secure.DOZE_PULSE_ON_DOUBLE_TAP, "0"); + Settings.Secure.DOZE_PULSE_ON_DOUBLE_TAP, 0, userId); } break; case UserManager.DISALLOW_CONFIG_LOCATION: