-->
<integer name="config_mobile_mtu">1358</integer>
- <!--Thresholds for LTE dbm in status bar-->
- <integer-array translatable="false" name="config_lteDbmThresholds">
- <item>-140</item> <!-- SIGNAL_STRENGTH_NONE_OR_UNKNOWN -->
- <item>-115</item> <!-- SIGNAL_STRENGTH_POOR -->
- <item>-105</item> <!-- SIGNAL_STRENGTH_MODERATE -->
- <item>-95</item> <!-- SIGNAL_STRENGTH_GOOD -->
- <item>-85</item> <!-- SIGNAL_STRENGTH_GREAT -->
- <item>-44</item>
- </integer-array>
-
<string translatable="false" name="prohibit_manual_network_selection_in_gobal_mode">true;BAE0000000000000</string>
</resources>
<bool name="config_auto_attach_data_on_creation">false</bool>
- <!--Thresholds for LTE dbm in status bar-->
- <integer-array translatable="false" name="config_lteDbmThresholds">
- <item>-140</item> <!-- SIGNAL_STRENGTH_NONE_OR_UNKNOWN -->
- <item>-115</item> <!-- SIGNAL_STRENGTH_POOR -->
- <item>-105</item> <!-- SIGNAL_STRENGTH_MODERATE -->
- <item>-95</item> <!-- SIGNAL_STRENGTH_GOOD -->
- <item>-85</item> <!-- SIGNAL_STRENGTH_GREAT -->
- <item>-44</item>
- </integer-array>
-
<string translatable="false" name="prohibit_manual_network_selection_in_gobal_mode">true</string>
<bool name="config_use_sim_language_file">true</bool>
<item>9</item>
</integer-array>
- <!--Thresholds for LTE dbm in status bar-->
- <integer-array translatable="false" name="config_lteDbmThresholds">
- <item>-140</item> <!-- SIGNAL_STRENGTH_NONE_OR_UNKNOWN -->
- <item>-120</item> <!-- SIGNAL_STRENGTH_POOR -->
- <item>-115</item> <!-- SIGNAL_STRENGTH_MODERATE -->
- <item>-100</item> <!-- SIGNAL_STRENGTH_GOOD -->
- <item>-90</item> <!-- SIGNAL_STRENGTH_GREAT -->
- <item>-44</item>
- </integer-array>
-
<!-- Configure mobile network MTU. Carrier specific value is set here.
-->
<integer name="config_mobile_mtu">1400</integer>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2017, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You my obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- These resources are around just to allow their values to be customized
- for different hardware and product builds. -->
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!--Thresholds for LTE dbm in status bar-->
- <integer-array translatable="false" name="config_lteDbmThresholds">
- <item>-140</item> <!-- SIGNAL_STRENGTH_NONE_OR_UNKNOWN -->
- <item>-120</item> <!-- SIGNAL_STRENGTH_POOR -->
- <item>-115</item> <!-- SIGNAL_STRENGTH_MODERATE -->
- <item>-100</item> <!-- SIGNAL_STRENGTH_GOOD -->
- <item>-90</item> <!-- SIGNAL_STRENGTH_GREAT -->
- <item>-44</item>
- </integer-array>
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2017, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You my obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- These resources are around just to allow their values to be customized
- for different hardware and product builds. -->
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!--Thresholds for LTE dbm in status bar-->
- <integer-array translatable="false" name="config_lteDbmThresholds">
- <item>-140</item> <!-- SIGNAL_STRENGTH_NONE_OR_UNKNOWN -->
- <item>-120</item> <!-- SIGNAL_STRENGTH_POOR -->
- <item>-115</item> <!-- SIGNAL_STRENGTH_MODERATE -->
- <item>-100</item> <!-- SIGNAL_STRENGTH_GOOD -->
- <item>-90</item> <!-- SIGNAL_STRENGTH_GREAT -->
- <item>-44</item>
- </integer-array>
-</resources>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2017, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You my obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- These resources are around just to allow their values to be customized
- for different hardware and product builds. -->
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!--Thresholds for LTE dbm in status bar-->
- <integer-array translatable="false" name="config_lteDbmThresholds">
- <item>-140</item> <!-- SIGNAL_STRENGTH_NONE_OR_UNKNOWN -->
- <item>-120</item> <!-- SIGNAL_STRENGTH_POOR -->
- <item>-115</item> <!-- SIGNAL_STRENGTH_MODERATE -->
- <item>-100</item> <!-- SIGNAL_STRENGTH_GOOD -->
- <item>-90</item> <!-- SIGNAL_STRENGTH_GREAT -->
- <item>-44</item>
- </integer-array>
-</resources>
<!-- Cascading submenus -->
<java-symbol type="dimen" name="cascading_menus_min_smallest_width" />
- <!-- From SignalStrength -->
- <java-symbol type="array" name="config_lteDbmThresholds" />
-
<java-symbol type="string" name="android_system_label" />
<java-symbol type="string" name="system_error_wipe_data" />
<java-symbol type="string" name="system_error_manufacturer" />
public static final String KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL =
"check_pricing_with_carrier_data_roaming_bool";
+ /**
+ * List of thresholds of RSRP for determining the display level of LTE signal bar.
+ * @hide
+ */
+ public static final String KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY =
+ "lte_rsrp_thresholds_int_array";
+
/** The default value for every variable. */
private final static PersistableBundle sDefaults;
sDefaults.putBoolean(KEY_ALWAYS_SHOW_DATA_RAT_ICON_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_CONFIG_APPLIED_BOOL, false);
sDefaults.putBoolean(KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL, false);
+ sDefaults.putIntArray(KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY,
+ new int[] {
+ -140, /* SIGNAL_STRENGTH_NONE_OR_UNKNOWN */
+ -128, /* SIGNAL_STRENGTH_POOR */
+ -118, /* SIGNAL_STRENGTH_MODERATE */
+ -108, /* SIGNAL_STRENGTH_GOOD */
+ -98, /* SIGNAL_STRENGTH_GREAT */
+ -44
+ });
}
/**
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.telephony.CarrierConfigManager;
import android.util.Log;
import android.content.res.Resources;
+import java.util.ArrayList;
+import java.util.Arrays;
+
/**
* Contains phone signal strength related information.
*/
//Use int max, as -1 is a valid value in signal strength
public static final int INVALID = 0x7FFFFFFF;
+ private static final int LTE_RSRP_THRESHOLDS_NUM = 6;
+
private int mGsmSignalStrength; // Valid values are (0-31, 99) as defined in TS 27.007 8.5
private int mGsmBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5
private int mCdmaDbm; // This value is the RSSI value
private boolean isGsm; // This value is set by the ServiceStateTracker onSignalStrengthResult
private boolean mUseOnlyRsrpForLteLevel; // Use only RSRP for the number of LTE signal bar.
+ // The threshold of LTE RSRP for determining the display level of LTE signal bar.
+ private int mLteRsrpThresholds[] = new int[LTE_RSRP_THRESHOLDS_NUM];
+
/**
* Create a new SignalStrength from a intent notifier Bundle
*
mTdScdmaRscp = INVALID;
isGsm = true;
mUseOnlyRsrpForLteLevel = false;
+ setLteRsrpThresholds(getDefaultLteRsrpThresholds());
}
/**
mTdScdmaRscp = INVALID;
isGsm = gsmFlag;
mUseOnlyRsrpForLteLevel = false;
+ setLteRsrpThresholds(getDefaultLteRsrpThresholds());
}
/**
mTdScdmaRscp = INVALID;
isGsm = gsm;
mUseOnlyRsrpForLteLevel = useOnlyRsrpForLteLevel;
+
+ setLteRsrpThresholds(getDefaultLteRsrpThresholds());
if (DBG) log("initialize: " + toString());
}
mTdScdmaRscp = s.mTdScdmaRscp;
isGsm = s.isGsm;
mUseOnlyRsrpForLteLevel = s.mUseOnlyRsrpForLteLevel;
+ setLteRsrpThresholds(s.mLteRsrpThresholds);
}
/**
mTdScdmaRscp = in.readInt();
isGsm = (in.readInt() != 0);
mUseOnlyRsrpForLteLevel = (in.readInt() != 0);
+ for (int i = 0; i < LTE_RSRP_THRESHOLDS_NUM; i++) {
+ mLteRsrpThresholds[i] = in.readInt();
+ }
}
/**
out.writeInt(mTdScdmaRscp);
out.writeInt(isGsm ? 1 : 0);
out.writeInt(mUseOnlyRsrpForLteLevel ? 1 : 0);
+ for (int i = 0; i < LTE_RSRP_THRESHOLDS_NUM; i++) {
+ out.writeInt(mLteRsrpThresholds[i]);
+ }
}
/**
}
/**
+ * Sets the threshold array for determining the display level of LTE signal bar.
+ *
+ * @param lteRsrpThresholds int array for determining the display level.
+ *
+ * @hide
+ */
+ public void setLteRsrpThresholds(int[] lteRsrpThresholds) {
+ if ((lteRsrpThresholds == null)
+ || (lteRsrpThresholds.length != LTE_RSRP_THRESHOLDS_NUM)) {
+ Log.wtf(LOG_TAG, "setLteRsrpThresholds - lteRsrpThresholds is invalid.");
+ return;
+ }
+ System.arraycopy(lteRsrpThresholds, 0, mLteRsrpThresholds, 0, LTE_RSRP_THRESHOLDS_NUM);
+ }
+
+ /**
* Get the GSM Signal Strength, valid values are (0-31, 99) as defined in TS
* 27.007 8.5
*/
*/
int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1;
- int[] threshRsrp = Resources.getSystem().getIntArray(
- com.android.internal.R.array.config_lteDbmThresholds);
- if (threshRsrp.length != 6) {
- Log.wtf(LOG_TAG, "getLteLevel - config_lteDbmThresholds has invalid num of elements."
- + " Cannot evaluate RSRP signal.");
- } else {
- if (mLteRsrp > threshRsrp[5]) {
- rsrpIconLevel = -1;
- } else if (mLteRsrp >= (threshRsrp[4] - mLteRsrpBoost)) {
- rsrpIconLevel = SIGNAL_STRENGTH_GREAT;
- } else if (mLteRsrp >= (threshRsrp[3] - mLteRsrpBoost)) {
- rsrpIconLevel = SIGNAL_STRENGTH_GOOD;
- } else if (mLteRsrp >= (threshRsrp[2] - mLteRsrpBoost)) {
- rsrpIconLevel = SIGNAL_STRENGTH_MODERATE;
- } else if (mLteRsrp >= (threshRsrp[1] - mLteRsrpBoost)) {
- rsrpIconLevel = SIGNAL_STRENGTH_POOR;
- } else if (mLteRsrp >= threshRsrp[0]) {
- rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
- }
+ if (mLteRsrp > mLteRsrpThresholds[5]) {
+ rsrpIconLevel = -1;
+ } else if (mLteRsrp >= (mLteRsrpThresholds[4] - mLteRsrpBoost)) {
+ rsrpIconLevel = SIGNAL_STRENGTH_GREAT;
+ } else if (mLteRsrp >= (mLteRsrpThresholds[3] - mLteRsrpBoost)) {
+ rsrpIconLevel = SIGNAL_STRENGTH_GOOD;
+ } else if (mLteRsrp >= (mLteRsrpThresholds[2] - mLteRsrpBoost)) {
+ rsrpIconLevel = SIGNAL_STRENGTH_MODERATE;
+ } else if (mLteRsrp >= (mLteRsrpThresholds[1] - mLteRsrpBoost)) {
+ rsrpIconLevel = SIGNAL_STRENGTH_POOR;
+ } else if (mLteRsrp >= mLteRsrpThresholds[0]) {
+ rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
}
if (useOnlyRsrpForLteLevel()) {
+ (mLteSignalStrength * primeNum) + (mLteRsrp * primeNum)
+ (mLteRsrq * primeNum) + (mLteRssnr * primeNum) + (mLteCqi * primeNum)
+ (mLteRsrpBoost * primeNum) + (mTdScdmaRscp * primeNum) + (isGsm ? 1 : 0)
- + (mUseOnlyRsrpForLteLevel ? 1 : 0));
+ + (mUseOnlyRsrpForLteLevel ? 1 : 0) + (Arrays.hashCode(mLteRsrpThresholds)));
}
/**
&& mLteRsrpBoost == s.mLteRsrpBoost
&& mTdScdmaRscp == s.mTdScdmaRscp
&& isGsm == s.isGsm
- && mUseOnlyRsrpForLteLevel == s.mUseOnlyRsrpForLteLevel);
+ && mUseOnlyRsrpForLteLevel == s.mUseOnlyRsrpForLteLevel
+ && Arrays.equals(mLteRsrpThresholds, s.mLteRsrpThresholds));
}
/**
+ " " + mTdScdmaRscp
+ " " + (isGsm ? "gsm|lte" : "cdma")
+ " " + (mUseOnlyRsrpForLteLevel ? "use_only_rsrp_for_lte_level" :
- "use_rsrp_and_rssnr_for_lte_level"));
+ "use_rsrp_and_rssnr_for_lte_level")
+ + " " + (Arrays.toString(mLteRsrpThresholds)));
}
/** Returns the signal strength related to GSM. */
mTdScdmaRscp = m.getInt("TdScdma");
isGsm = m.getBoolean("isGsm");
mUseOnlyRsrpForLteLevel = m.getBoolean("useOnlyRsrpForLteLevel");
+ ArrayList<Integer> lteRsrpThresholds = m.getIntegerArrayList("lteRsrpThresholds");
+ for (int i = 0; i < lteRsrpThresholds.size(); i++) {
+ mLteRsrpThresholds[i] = lteRsrpThresholds.get(i);
+ }
}
/**
m.putInt("TdScdma", mTdScdmaRscp);
m.putBoolean("isGsm", isGsm);
m.putBoolean("useOnlyRsrpForLteLevel", mUseOnlyRsrpForLteLevel);
+ ArrayList<Integer> lteRsrpThresholds = new ArrayList<Integer>();
+ for (int value : mLteRsrpThresholds) {
+ lteRsrpThresholds.add(value);
+ }
+ m.putIntegerArrayList("lteRsrpThresholds", lteRsrpThresholds);
+ }
+
+ /**
+ * Gets the default threshold array for determining the display level of LTE signal bar.
+ *
+ * @return int array for determining the display level.
+ */
+ private int[] getDefaultLteRsrpThresholds() {
+ return CarrierConfigManager.getDefaultConfig().getIntArray(
+ CarrierConfigManager.KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY);
}
/**