Move config_inflateSignalStrength to CC am: b5299b5a20

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12285804

Change-Id: Ie989a65dc9ac2b4efd7926456e58dcce8fffea98
This commit is contained in:
Mattias Nilsson
2020-08-07 21:52:20 +00:00
committed by Automerger Merge Worker
3 changed files with 20 additions and 6 deletions

View File

@@ -17,7 +17,8 @@
package com.android.settingslib.net; package com.android.settingslib.net;
import android.content.Context; import android.content.Context;
import android.telephony.SubscriptionManager; import android.os.PersistableBundle;
import android.telephony.CarrierConfigManager;
/** /**
* Utilities for dealing with signal strength. * Utilities for dealing with signal strength.
@@ -28,7 +29,13 @@ public class SignalStrengthUtil {
* bar for the subscription with the given id * bar for the subscription with the given id
*/ */
public static boolean shouldInflateSignalStrength(Context context, int subscriptionId) { public static boolean shouldInflateSignalStrength(Context context, int subscriptionId) {
return SubscriptionManager.getResourcesForSubId(context, subscriptionId) final CarrierConfigManager carrierConfigMgr =
.getBoolean(com.android.internal.R.bool.config_inflateSignalStrength); 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));
} }
} }

View File

@@ -1191,7 +1191,6 @@ public class NetworkControllerImpl extends BroadcastReceiver
boolean show4gForLte = false; boolean show4gForLte = false;
boolean hideLtePlus = false; boolean hideLtePlus = false;
boolean hspaDataDistinguishable; boolean hspaDataDistinguishable;
boolean inflateSignalStrengths = false;
boolean alwaysShowDataRatIcon = false; boolean alwaysShowDataRatIcon = false;
static Config readConfig(Context context) { static Config readConfig(Context context) {
@@ -1203,8 +1202,6 @@ public class NetworkControllerImpl extends BroadcastReceiver
res.getBoolean(com.android.internal.R.bool.config_alwaysUseCdmaRssi); res.getBoolean(com.android.internal.R.bool.config_alwaysUseCdmaRssi);
config.hspaDataDistinguishable = config.hspaDataDistinguishable =
res.getBoolean(R.bool.config_hspa_data_distinguishable); res.getBoolean(R.bool.config_hspa_data_distinguishable);
config.inflateSignalStrengths = res.getBoolean(
com.android.internal.R.bool.config_inflateSignalStrength);
CarrierConfigManager configMgr = (CarrierConfigManager) CarrierConfigManager configMgr = (CarrierConfigManager)
context.getSystemService(Context.CARRIER_CONFIG_SERVICE); context.getSystemService(Context.CARRIER_CONFIG_SERVICE);

View File

@@ -1084,6 +1084,15 @@ public class CarrierConfigManager {
public static final String KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL = public static final String KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL =
"show_signal_strength_in_sim_status_bool"; "show_signal_strength_in_sim_status_bool";
/**
* Flag specifying if we should interpret all signal strength as one bar higher
* This is a replacement for the resource config_inflateSignalStrength
* The default value is false.
* @hide
*/
public static final String KEY_INFLATE_SIGNAL_STRENGTH_BOOL =
"inflate_signal_strength_bool";
/** /**
* Flag specifying whether an additional (client initiated) intent needs to be sent on System * Flag specifying whether an additional (client initiated) intent needs to be sent on System
* update * update
@@ -3999,6 +4008,7 @@ public class CarrierConfigManager {
sDefaults.putStringArray(KEY_CARRIER_VVM_PACKAGE_NAME_STRING_ARRAY, null); sDefaults.putStringArray(KEY_CARRIER_VVM_PACKAGE_NAME_STRING_ARRAY, null);
sDefaults.putBoolean(KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL, false); sDefaults.putBoolean(KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL, false);
sDefaults.putBoolean(KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL, true); sDefaults.putBoolean(KEY_SHOW_SIGNAL_STRENGTH_IN_SIM_STATUS_BOOL, true);
sDefaults.putBoolean(KEY_INFLATE_SIGNAL_STRENGTH_BOOL, false);
sDefaults.putBoolean(KEY_CI_ACTION_ON_SYS_UPDATE_BOOL, false); sDefaults.putBoolean(KEY_CI_ACTION_ON_SYS_UPDATE_BOOL, false);
sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING, ""); sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING, "");
sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING, ""); sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING, "");