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

Commit 4b28ae54 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "StatusBar: Customize signal level for LTE"

parents bc486610 dedcf338
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -140,5 +140,6 @@
        <item>0</item>
        <item>0</item>
    </integer-array>
    <bool name="config_showRsrpSignalLevelforLTE ">false</bool>
</resources>
+7 −0
Original line number Diff line number Diff line
@@ -618,6 +618,13 @@ public class MSimNetworkController extends NetworkController {
                            + " instead of level= " + mMSimSignalStrength[subscription].getLevel());
                } else {
                    mLastSignalLevel = iconLevel = mMSimSignalStrength[subscription].getLevel();
                    if (mShowRsrpSignalLevelforLTE ) {
                        if (mServiceState.getDataNetworkType() ==
                                TelephonyManager.NETWORK_TYPE_LTE) {
                            mLastSignalLevel = iconLevel =
                                    mSignalStrength.getAlternateLteLevel();
                        }
                    }
                }

                mMSimPhoneSignalIconId[subscription] =
+10 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
    boolean mShowAtLeastThreeGees = false;
    boolean mAlwaysShowCdmaRssi = false;
    boolean mShow4GforLTE = false;
    boolean mShowRsrpSignalLevelforLTE = false;

    private String mCarrierText = "";

@@ -207,6 +208,8 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
                com.android.internal.R.bool.config_alwaysUseCdmaRssi);
        mShow4GforLTE = mContext.getResources().getBoolean(
                R.bool.config_show4GForLTE);
        mShowRsrpSignalLevelforLTE = mContext.getResources().getBoolean(
                R.bool.config_showRsrpSignalLevelforLTE);
        // set up the default wifi icon, used when no radios have ever appeared
        updateWifiIcons();
        updateWimaxIcons();
@@ -682,6 +685,13 @@ public class NetworkController extends BroadcastReceiver implements DemoMode {
                            + " instead of level=" + mSignalStrength.getLevel());
                } else {
                    mLastSignalLevel = iconLevel = mSignalStrength.getLevel();
                    if (mShowRsrpSignalLevelforLTE ) {
                        if (mServiceState.getDataNetworkType() ==
                                TelephonyManager.NETWORK_TYPE_LTE) {
                            mLastSignalLevel = iconLevel =
                                    mSignalStrength.getAlternateLteLevel();
                        }
                    }
                }

                mPhoneSignalIconId = TelephonyIcons.getSignalStrengthIcon(mInetCondition,
+18 −0
Original line number Diff line number Diff line
@@ -773,6 +773,24 @@ public class SignalStrength implements Parcelable {
        return mLteRsrp;
    }

    /**
     * Get LTE as level 0..4
     *
     * @hide
     */
    public int getAlternateLteLevel() {
        int rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;

        if (mLteRsrp > -44) rsrpIconLevel = -1;
        else if (mLteRsrp >= -97) rsrpIconLevel = SIGNAL_STRENGTH_GREAT;
        else if (mLteRsrp >= -105) rsrpIconLevel = SIGNAL_STRENGTH_GOOD;
        else if (mLteRsrp >= -113) rsrpIconLevel = SIGNAL_STRENGTH_MODERATE;
        else if (mLteRsrp >= -120) rsrpIconLevel = SIGNAL_STRENGTH_POOR;
        else if (mLteRsrp >= -140) rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;

        return rsrpIconLevel;
    }

    /**
     * Get LTE as level 0..4
     *