Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71fa17cf authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Steve Kondik
Browse files

SignalStrength: Allow for custom signal buckets in LTE

STRICT levels are too low, LENIENT levels are too high. Let us
use something in between...

Change-Id: I134774ed471e1805eac95cfbf8af957378fd8293
parent d1e6240b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2307,6 +2307,7 @@
          when evaluating RSRP for LTE antenna bar display
           0. Strict threshold
           1. Lenient threshold
           2. Custom threshold
    -->
    <integer name="config_LTE_RSRP_threshold_type">1</integer>

@@ -2543,4 +2544,15 @@
    <string name="config_rat_2g" translatable="false">2G</string>
    <string name="config_rat_3g" translatable="false">3G</string>
    <string name="config_rat_4g" translatable="false">4G</string>

    <!-- When config_LTE_RSRP_threshold_type is set to "custom" -->
    <integer-array name="config_LTE_RSRP_custom_levels">
        <item>-140</item>
        <item>-128</item>
        <item>-118</item>
        <item>-108</item>
        <item>-98</item>
        <item>-44</item>
    </integer-array>

</resources>
+1 −0
Original line number Diff line number Diff line
@@ -2233,6 +2233,7 @@

  <!-- From SignalStrength -->
  <java-symbol type="integer" name="config_LTE_RSRP_threshold_type" />
  <java-symbol type="array"   name="config_LTE_RSRP_custom_levels" />

  <java-symbol type="string" name="android_system_label" />
  <java-symbol type="string" name="system_error_wipe_data" />
+4 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public class SignalStrength implements Parcelable {
    public static final int INVALID = 0x7FFFFFFF;

    private static final int RSRP_THRESH_TYPE_STRICT = 0;
    private static final int RSRP_THRESH_TYPE_CUSTOM = 2;
    private static final int[] RSRP_THRESH_STRICT = new int[] {-140, -115, -105, -95, -85, -44};
    private static final int[] RSRP_THRESH_LENIENT = new int[] {-140, -128, -118, -108, -98, -44};

@@ -811,6 +812,9 @@ public class SignalStrength implements Parcelable {
        int[] threshRsrp;
        if (rsrpThreshType == RSRP_THRESH_TYPE_STRICT) {
            threshRsrp = RSRP_THRESH_STRICT;
        } else if (rsrpThreshType == RSRP_THRESH_TYPE_CUSTOM) {
            threshRsrp = Resources.getSystem().getIntArray(com.android.internal.R.array.
                    config_LTE_RSRP_custom_levels);
        } else {
            threshRsrp = RSRP_THRESH_LENIENT;
        }