From 937eb58169001eeb3bc339b892fdba7cfe42269f Mon Sep 17 00:00:00 2001 From: Songchun Fan Date: Thu, 3 Sep 2020 16:29:24 -0700 Subject: [PATCH] [telephony] system_server should not call non forUser Settings.Secure.get* methods BUG: 166312046 Test: builds Change-Id: Ib30eb22c23c7fd60ff498845a4d1876de2bb7799 --- .../com/android/internal/telephony/CarrierAppUtils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/telephony/common/com/android/internal/telephony/CarrierAppUtils.java b/telephony/common/com/android/internal/telephony/CarrierAppUtils.java index d4308c4c30ade..cfc7ac176f897 100644 --- a/telephony/common/com/android/internal/telephony/CarrierAppUtils.java +++ b/telephony/common/com/android/internal/telephony/CarrierAppUtils.java @@ -157,7 +157,8 @@ public final class CarrierAppUtils { List enabledCarrierPackages = new ArrayList<>(); int carrierAppsHandledSdk = - Settings.Secure.getInt(contentResolver, Settings.Secure.CARRIER_APPS_HANDLED, 0); + Settings.Secure.getIntForUser(contentResolver, Settings.Secure.CARRIER_APPS_HANDLED, + 0, contentResolver.getUserId()); if (DEBUG) { Log.i(TAG, "Last execution SDK: " + carrierAppsHandledSdk); } @@ -309,8 +310,8 @@ public final class CarrierAppUtils { // Mark the execution so we do not disable apps again on this SDK version. if (!hasRunEver || !hasRunForSdk) { - Settings.Secure.putInt(contentResolver, Settings.Secure.CARRIER_APPS_HANDLED, - Build.VERSION.SDK_INT); + Settings.Secure.putIntForUser(contentResolver, Settings.Secure.CARRIER_APPS_HANDLED, + Build.VERSION.SDK_INT, contentResolver.getUserId()); } if (!enabledCarrierPackages.isEmpty()) {