blob: be07474cbf31778c5b43da9d61af6073d4e0c669 [file] [log] [blame]
Jon Westa34208a2018-08-22 10:49:04 -04001From eee4d12d38bdbdab39abcd9c280eda864fd26855 Mon Sep 17 00:00:00 2001
2From: jhenrique09 <jhenrique09.mcz@hotmail.com>
3Date: Sat, 11 Aug 2018 13:40:00 -0400
4Subject: [PATCH] Revert "Revert "Remove getIntWithSubId in TelephonyManager.""
5
6This reverts commit e788decb1b366a9df9683d86314ea4cf22a10d74.
7---
8 .../android/telephony/TelephonyManager.java | 39 -------------------
9 1 file changed, 39 deletions(-)
10
11diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
12index 10dc43ae539..487490c194b 100644
13--- a/telephony/java/android/telephony/TelephonyManager.java
14+++ b/telephony/java/android/telephony/TelephonyManager.java
15@@ -6629,45 +6629,6 @@ public class TelephonyManager {
16 return false;
17 }
18
19- /**
20- * This function retrieves value for setting "name+subId", and if that is not found
21- * retrieves value for setting "name", and if that is not found throws
22- * SettingNotFoundException
23- *
24- * @hide
25- */
26- public static int getIntWithSubId(ContentResolver cr, String name, int subId)
27- throws SettingNotFoundException {
28- try {
29- return Settings.Global.getInt(cr, name + subId);
30- } catch (SettingNotFoundException e) {
31- try {
32- int val = Settings.Global.getInt(cr, name);
33- Settings.Global.putInt(cr, name + subId, val);
34-
35- /* We are now moving from 'setting' to 'setting+subId', and using the value stored
36- * for 'setting' as default. Reset the default (since it may have a user set
37- * value). */
38- int default_val = val;
39- if (name.equals(Settings.Global.MOBILE_DATA)) {
40- default_val = "true".equalsIgnoreCase(
41- SystemProperties.get("ro.com.android.mobiledata", "true")) ? 1 : 0;
42- } else if (name.equals(Settings.Global.DATA_ROAMING)) {
43- default_val = "true".equalsIgnoreCase(
44- SystemProperties.get("ro.com.android.dataroaming", "false")) ? 1 : 0;
45- }
46-
47- if (default_val != val) {
48- Settings.Global.putInt(cr, name, default_val);
49- }
50-
51- return val;
52- } catch (SettingNotFoundException exc) {
53- throw new SettingNotFoundException(name);
54- }
55- }
56- }
57-
58 /**
59 * Returns the IMS Registration Status for a particular Subscription ID.
60 *
61--
622.17.1
63