Move config_inflateSignalStrength to CC am: f8c6f34832

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

Change-Id: I69456375e59c21d3ba56a6af8f934050fab8b615
This commit is contained in:
Mattias Nilsson
2020-08-11 00:21:25 +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;
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));
}
}

View File

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

View File

@@ -1085,6 +1085,15 @@ public class CarrierConfigManager {
public static final String KEY_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
* update
@@ -3914,6 +3923,7 @@ public class CarrierConfigManager {
sDefaults.putStringArray(KEY_CARRIER_VVM_PACKAGE_NAME_STRING_ARRAY, null);
sDefaults.putBoolean(KEY_SHOW_ICCID_IN_SIM_STATUS_BOOL, false);
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.putString(KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING, "");
sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING, "");