summaryrefslogtreecommitdiff
path: root/packages/SettingsLib/src
diff options
context:
space:
mode:
authorMattias Nilsson <mattias.nilsson@sony.com>2020-01-24 17:49:49 +0100
committerSooraj Sasindran <sasindran@google.com>2020-08-10 11:01:13 -0700
commit789432b5d1a9071afee5eff4dae60a3ae3797d8b (patch)
treeec53ff10d155625b9d77702f607dd37bb86546ae /packages/SettingsLib/src
parent2a98e05f9a8bd9820c87f525e556b15d42ab7a4b (diff)
Move config_inflateSignalStrength to CC
Sim based customizations should not be resources because of two reasons: 1. The MCC/MNC value in AssetManager for Dual sim devices is undefined 2. There is no support for MVNOs. For dual sim devices there is only one value for MCC/MNC in AssetManager and that value is updated from multiple places without deciding if it should be the default voice sim card, the default data sim card or whatnot. This means that when frameworks is trying to decide what resource to use there is no guarantee that the resource that arrives is for the particular subscription we are asking for. MVNOs cannot be separated through only MCC/MNC but need more parameters like service provider, imsi, GID1 etc. MVNO support is available in CarrierConfig. When we now have support for ADCP updates of customizations and start using carrier id this is better placed in CarrierConfig, we then get support for MVNOs at the same time. Bug: 148483577 Test: Customize for sim card x and not for sim card y, insert both sim cards in a dual sim device and see the difference. Merged-In: I067d55b9ae5e1346dd3b3cd50a0097b05b100055 Change-Id: I067d55b9ae5e1346dd3b3cd50a0097b05b100055
Diffstat (limited to 'packages/SettingsLib/src')
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java b/packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java
index 246f2ceac87c..e1174fa05ea5 100644
--- a/packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java
+++ b/packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java
@@ -17,7 +17,8 @@
package com.android.settingslib.net;
import android.content.Context;
-import android.telephony.SubscriptionManager;
+import android.os.PersistableBundle;
+import android.telephony.CarrierConfigManager;
/**
* Utilities for dealing with signal strength.
@@ -28,7 +29,13 @@ public class SignalStrengthUtil {
* bar for the subscription with the given id
*/
public static boolean shouldInflateSignalStrength(Context context, int subscriptionId) {
- return SubscriptionManager.getResourcesForSubId(context, subscriptionId)
- .getBoolean(com.android.internal.R.bool.config_inflateSignalStrength);
+ final CarrierConfigManager carrierConfigMgr =
+ context.getSystemService(CarrierConfigManager.class);
+ PersistableBundle bundle = null;
+ if (carrierConfigMgr != null) {
+ bundle = carrierConfigMgr.getConfigForSubId(subscriptionId);
+ }
+ return (bundle != null && bundle.getBoolean(
+ CarrierConfigManager.KEY_INFLATE_SIGNAL_STRENGTH_BOOL, false));
}
}