diff options
author | LuK1337 <priv.luk@gmail.com> | 2015-11-06 21:12:43 +0100 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-11-07 01:35:36 -0800 |
commit | db94a5f9a94701c2cf1e9ca11b858d76f56ac74f (patch) | |
tree | 94b7f735597d2b2c5062524e14ef93311bff434f /packages/SettingsProvider | |
parent | 0e6722b79a093e7e8bad756149a78bd3e45df366 (diff) | |
download | frameworks_base-db94a5f9a94701c2cf1e9ca11b858d76f56ac74f.zip frameworks_base-db94a5f9a94701c2cf1e9ca11b858d76f56ac74f.tar.gz frameworks_base-db94a5f9a94701c2cf1e9ca11b858d76f56ac74f.tar.bz2 |
DatabaseHelper: Add back ro.telephony.default_network
commit 71f7d9966a2cf56c310233bf44814f13d0661431
Author: Lin Ma <lma@cyngn.com>
Date: Wed Mar 25 17:44:52 2015 -0700
Fix ro.telephony.default_network setting parsing
* The code that parses ro.telephony.default_network is broken,
instead of reading numbers separate by comma, it reads the first
number and replicates it for other slots. Settings like "8,1" will
be written to the db as "8,8"
Conflicts:
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
Change-Id: I6b77000e00ada02ec89b09c752a9b337a6a8182b
commit 23a9f51caf09642783ff004db9fd5f168fcab14d
Author: kaiyiz <kaiyiz@codeaurora.org>
Date: Sat Aug 16 15:54:57 2014 +0800
Regional: Customize features for regional package
-Customize default Date&Time display format.
-Customize mock and Dock on or off for carrier.
-Customize accessibility on or off for carrier.
-Customize default input method.
-Customize default enable data roaming or not.
-Customize default enable mobile data or not.
-Customize default network.
commit 43f55e5953bb974abdb07bdee2d88db3402c87f4
Author: Sandeep Gutta <sangutta@codeaurora.org>
Date: Fri Aug 1 08:18:37 2014 +0530
Telephony(MSIM): Add support for MultiSim.
--> Subscription specific for Mobile data, roaming and usage
- Provide database flags as per subscription for both Mobile
data and Data roaming options.
--> Add sub based API for getAllCellInfo in TelephonyManager.
--> Use Dds subId to get Sim state, roaming state in NetworkPolicyService.
Change-Id: I6ee5d2a22e44fe7d0d68a41af0481ddbbbe21c3f
commit d6bcfd1cd081b9fe553976a0191a814b929c583e
Author: Wink Saville <wink@google.com>
Date: Wed Jun 8 12:18:07 2011 -0700
Fix default preferred network.
Also, for xoom-cdma-lte devices CdmaLteServiceStateTracker#getOtasp
returns OTASP_NOT_NEEDED.
Some cleanup.
Bug: 4531115
Change-Id: I24b160062eda625ff5c3471399b9e83ae0d2869a
Change-Id: I0d3a5dcf7b063ef3fdc8234304c116d56afa5e38
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index b0831dc..2377241 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -41,6 +41,7 @@ import android.os.UserHandle; import android.provider.Settings; import android.provider.Settings.Global; import android.provider.Settings.Secure; +import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; @@ -2708,13 +2709,37 @@ class DatabaseHelper extends SQLiteOpenHelper { // Set the preferred network mode to target desired value or Default // value defined in RILConstants - int type; - type = RILConstants.PREFERRED_NETWORK_MODE; - loadSetting(stmt, Settings.Global.PREFERRED_NETWORK_MODE, type); + int phoneCount = TelephonyManager.getDefault().getPhoneCount(); + final String defVal = SystemProperties.get("ro.telephony.default_network", ""); + final String[] defNetworkSettings = defVal.split(","); + final String[] networkSettings = new String[phoneCount]; + boolean error = defNetworkSettings.length != phoneCount; + + for (int i = 0; i < phoneCount; i++) { + if (i < defNetworkSettings.length) { + try { + networkSettings[i] = String.valueOf( + Integer.parseInt(defNetworkSettings[i])); + } catch (NumberFormatException ex) { + networkSettings[i] = String.valueOf(RILConstants.PREFERRED_NETWORK_MODE); + error = true; + } + } else { + networkSettings[i] = String.valueOf(RILConstants.PREFERRED_NETWORK_MODE); + error = true; + } + } + + if (error) { + Log.w(TAG, "Invalid ro.telephony.default_network: " + defVal); + } + + loadSetting(stmt, Settings.Global.PREFERRED_NETWORK_MODE, TextUtils.join(",", + networkSettings)); // Set the preferred cdma subscription source to target desired value or default // value defined in CdmaSubscriptionSourceManager - type = SystemProperties.getInt("ro.telephony.default_cdma_sub", + int type = SystemProperties.getInt("ro.telephony.default_cdma_sub", CdmaSubscriptionSourceManager.PREFERRED_CDMA_SUBSCRIPTION); loadSetting(stmt, Settings.Global.CDMA_SUBSCRIPTION_MODE, type); |