# Implement 6-bar signal and more accurate 4-bar signal.



## Dr. Hax (Sep 24, 2011)

CREDIT TO EVERVOLV FOR THIS MOD!

He made the 6-bar signal strength mod, but what I've done is taken the java file and make the RSSI bars more accurate. Specifically I changed it to be:


```
<br />
} else {<br />
		    if (asu <= 2 || asu == 99) level = SIXBAR_SIGNAL_STRENGTH_NONE_OR_UNKNOWN;<br />
		    else if (asu >= 21) level = SIXBAR_SIGNAL_STRENGTH_SIX;<br />
		    else if (asu >= 18) level = SIXBAR_SIGNAL_STRENGTH_FIVE;<br />
		    else if (asu >= 16)  level = SIXBAR_SIGNAL_STRENGTH_FOUR;<br />
		    else if (asu >= 12)  level = SIXBAR_SIGNAL_STRENGTH_THREE;<br />
		    else if (asu >= 8)  level = SIXBAR_SIGNAL_STRENGTH_TWO;<br />
		    else level = SIXBAR_SIGNAL_STRENGTH_ONE;<br />
```
That basically means:
anything worse than > -97dBm: 1 bar
-97dBm: 2 bars
-89dBm: 3 bars
-81dBm: 4 bars
-77dBm: 5 bars
-71dBm: 6 bars

it used to be:
anything worse than > -105dBm: 1 bar
-105dBm: 2 bars
-101dBm: 3 bars
-97dBm: 4 bars
-93dBm: 5 bars
-89dBm: 6 bars

As you can see from there, I've changed it so that it ACCURATELY displays RSSI. Not that I blame Evervolv







He probably just used values close to stock to simply make a 6-bar mod to begin with, which is fantastic for us.

Could someone at least point me in the right direction as to how to implement this mod? I cannot seem to find the "signalstrength.java" file in Android, actually, I can't find a single java file period! I want to implement it without losing the toggle widgets and battery percent (codename android ROM)

I hope I've at least helped a mod developer in the right direction to implement something like this, and I'll post a response below for accurate 4-bar signal


----------



## Dr. Hax (Sep 24, 2011)

```
<br />
/*<br />
* Copyright © 2009 Qualcomm Innovation Center, Inc.  All Rights Reserved.<br />
* Copyright © 2009 The Android Open Source Project<br />
*<br />
* Licensed under the Apache License, Version 2.0 (the "License");<br />
* you may not use this file except in compliance with the License.<br />
* You may obtain a copy of the License at<br />
*<br />
*	  [URL=http://www.apache.or...ses/LICENSE-2]http://www.apache.or...ses/LICENSE-2[/URL].0<br />
*<br />
* Unless required by applicable law or agreed to in writing, software<br />
* distributed under the License is distributed on an "AS IS" BASIS,<br />
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br />
* See the License for the specific language governing permissions and<br />
* limitations under the License.<br />
*/<br />
package android.telephony;<br />
import android.os.Bundle;<br />
import android.os.Parcel;<br />
import android.os.Parcelable;<br />
import android.util.Log;<br />
/**<br />
* Contains phone signal strength related information.<br />
*/<br />
public class SignalStrength implements Parcelable {<br />
    private static final String LOG_TAG = "SignalStrength";<br />
    private static final boolean DBG = false;<br />
    /** @hide */<br />
    public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0;<br />
    /** @hide */<br />
    public static final int SIGNAL_STRENGTH_POOR = 1;<br />
    /** @hide */<br />
    public static final int SIGNAL_STRENGTH_MODERATE = 2;<br />
    /** @hide */<br />
    public static final int SIGNAL_STRENGTH_GOOD = 3;<br />
    /** @hide */<br />
    public static final int SIGNAL_STRENGTH_GREAT = 4;<br />
    /** @hide */<br />
    public static final int NUM_SIGNAL_STRENGTH_BINS = 5;<br />
    /** @hide */<br />
    public static final String[] SIGNAL_STRENGTH_NAMES = {<br />
	    "none", "poor", "moderate", "good", "great"<br />
    };<br />
    private int mGsmSignalStrength; // Valid values are (0-31, 99) as defined in TS 27.007 8.5<br />
    private int mGsmBitErrorRate;   // bit error rate (0-7, 99) as defined in TS 27.007 8.5<br />
    private int mCdmaDbm;   // This value is the RSSI value<br />
    private int mCdmaEcio;  // This value is the Ec/Io<br />
    private int mEvdoDbm;   // This value is the EVDO RSSI value<br />
    private int mEvdoEcio;  // This value is the EVDO Ec/Io<br />
    private int mEvdoSnr;   // Valid values are 0-8.  8 is the highest signal to noise ratio<br />
    private int mLteSignalStrength;<br />
    private int mLteRsrp;<br />
    private int mLteRsrq;<br />
    private int mLteRssnr;<br />
    private int mLteCqi;<br />
    private boolean isGsm; // This value is set by the ServiceStateTracker onSignalStrengthResult<br />
    /**<br />
	 * Create a new SignalStrength from a intent notifier Bundle<br />
	 *<br />
	 * This method is used by PhoneStateIntentReceiver and maybe by<br />
	 * external applications.<br />
	 *<br />
	 * @param m Bundle from intent notifier<br />
	 * @return newly created SignalStrength<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public static SignalStrength newFromBundle(Bundle m) {<br />
	    SignalStrength ret;<br />
	    ret = new SignalStrength();<br />
	    ret.setFromNotifierBundle(m);<br />
	    return ret;<br />
    }<br />
    /**<br />
	 * Empty constructor<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public SignalStrength() {<br />
	    mGsmSignalStrength = 99;<br />
	    mGsmBitErrorRate = -1;<br />
	    mCdmaDbm = -1;<br />
	    mCdmaEcio = -1;<br />
	    mEvdoDbm = -1;<br />
	    mEvdoEcio = -1;<br />
	    mEvdoSnr = -1;<br />
	    mLteSignalStrength = -1;<br />
	    mLteRsrp = -1;<br />
	    mLteRsrq = -1;<br />
	    mLteRssnr = -1;<br />
	    mLteCqi = -1;<br />
	    isGsm = true;<br />
    }<br />
    /**<br />
	 * Constructor<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public SignalStrength(int gsmSignalStrength, int gsmBitErrorRate,<br />
		    int cdmaDbm, int cdmaEcio,<br />
		    int evdoDbm, int evdoEcio, int evdoSnr,<br />
		    int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,<br />
		    boolean gsm) {<br />
	    mGsmSignalStrength = gsmSignalStrength;<br />
	    mGsmBitErrorRate = gsmBitErrorRate;<br />
	    mCdmaDbm = cdmaDbm;<br />
	    mCdmaEcio = cdmaEcio;<br />
	    mEvdoDbm = evdoDbm;<br />
	    mEvdoEcio = evdoEcio;<br />
	    mEvdoSnr = evdoSnr;<br />
	    mLteSignalStrength = lteSignalStrength;<br />
	    mLteRsrp = lteRsrp;<br />
	    mLteRsrq = lteRsrq;<br />
	    mLteRssnr = lteRssnr;<br />
	    mLteCqi = lteCqi;<br />
	    isGsm = gsm;<br />
    }<br />
    /**<br />
	 * Constructor<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public SignalStrength(int gsmSignalStrength, int gsmBitErrorRate,<br />
		    int cdmaDbm, int cdmaEcio,<br />
		    int evdoDbm, int evdoEcio, int evdoSnr,<br />
		    boolean gsm) {<br />
	    this(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,<br />
			    evdoDbm, evdoEcio, evdoSnr, -1, -1, -1, -1, -1, gsm);<br />
    }<br />
    /**<br />
	 * Copy constructors<br />
	 *<br />
	 * @param s Source SignalStrength<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public SignalStrength(SignalStrength s) {<br />
	    copyFrom(s);<br />
    }<br />
    /**<br />
	 * @hide<br />
	 */<br />
    protected void copyFrom(SignalStrength s) {<br />
	    mGsmSignalStrength = s.mGsmSignalStrength;<br />
	    mGsmBitErrorRate = s.mGsmBitErrorRate;<br />
	    mCdmaDbm = s.mCdmaDbm;<br />
	    mCdmaEcio = s.mCdmaEcio;<br />
	    mEvdoDbm = s.mEvdoDbm;<br />
	    mEvdoEcio = s.mEvdoEcio;<br />
	    mEvdoSnr = s.mEvdoSnr;<br />
	    mLteSignalStrength = s.mLteSignalStrength;<br />
	    mLteRsrp = s.mLteRsrp;<br />
	    mLteRsrq = s.mLteRsrq;<br />
	    mLteRssnr = s.mLteRssnr;<br />
	    mLteCqi = s.mLteCqi;<br />
	    isGsm = s.isGsm;<br />
    }<br />
    /**<br />
	 * Construct a SignalStrength object from the given parcel.<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public SignalStrength(Parcel in) {<br />
	    mGsmSignalStrength = in.readInt();<br />
	    mGsmBitErrorRate = in.readInt();<br />
	    mCdmaDbm = in.readInt();<br />
	    mCdmaEcio = in.readInt();<br />
	    mEvdoDbm = in.readInt();<br />
	    mEvdoEcio = in.readInt();<br />
	    mEvdoSnr = in.readInt();<br />
	    mLteSignalStrength = in.readInt();<br />
	    mLteRsrp = in.readInt();<br />
	    mLteRsrq = in.readInt();<br />
	    mLteRssnr = in.readInt();<br />
	    mLteCqi = in.readInt();<br />
	    isGsm = (in.readInt() != 0);<br />
    }<br />
    /**<br />
	 * {@link Parcelable#writeToParcel}<br />
	 */<br />
    public void writeToParcel(Parcel out, int flags) {<br />
	    out.writeInt(mGsmSignalStrength);<br />
	    out.writeInt(mGsmBitErrorRate);<br />
	    out.writeInt(mCdmaDbm);<br />
	    out.writeInt(mCdmaEcio);<br />
	    out.writeInt(mEvdoDbm);<br />
	    out.writeInt(mEvdoEcio);<br />
	    out.writeInt(mEvdoSnr);<br />
	    out.writeInt(mLteSignalStrength);<br />
	    out.writeInt(mLteRsrp);<br />
	    out.writeInt(mLteRsrq);<br />
	    out.writeInt(mLteRssnr);<br />
	    out.writeInt(mLteCqi);<br />
	    out.writeInt(isGsm ? 1 : 0);<br />
    }<br />
    /**<br />
	 * {@link Parcelable#describeContents}<br />
	 */<br />
    public int describeContents() {<br />
	    return 0;<br />
    }<br />
    /**<br />
	 * {@link Parcelable.Creator}<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public static final Parcelable.Creator<SignalStrength> CREATOR = new Parcelable.Creator() {<br />
	    public SignalStrength createFromParcel(Parcel in) {<br />
		    return new SignalStrength(in);<br />
	    }<br />
	    public SignalStrength[] newArray(int size) {<br />
		    return new SignalStrength[size];<br />
	    }<br />
    };<br />
    /**<br />
	 * Get the GSM Signal Strength, valid values are (0-31, 99) as defined in TS 27.007 8.5<br />
	 */<br />
    public int getGsmSignalStrength() {<br />
	    return this.mGsmSignalStrength;<br />
    }<br />
    /**<br />
	 * Get the GSM bit error rate (0-7, 99) as defined in TS 27.007 8.5<br />
	 */<br />
    public int getGsmBitErrorRate() {<br />
	    return this.mGsmBitErrorRate;<br />
    }<br />
    /**<br />
	 * Get the CDMA RSSI value in dBm<br />
	 */<br />
    public int getCdmaDbm() {<br />
	    return this.mCdmaDbm;<br />
    }<br />
    /**<br />
	 * Get the CDMA Ec/Io value in dB*10<br />
	 */<br />
    public int getCdmaEcio() {<br />
	    return this.mCdmaEcio;<br />
    }<br />
    /**<br />
	 * Get the EVDO RSSI value in dBm<br />
	 */<br />
    public int getEvdoDbm() {<br />
	    return this.mEvdoDbm;<br />
    }<br />
    /**<br />
	 * Get the EVDO Ec/Io value in dB*10<br />
	 */<br />
    public int getEvdoEcio() {<br />
	    return this.mEvdoEcio;<br />
    }<br />
    /**<br />
	 * Get the signal to noise ratio. Valid values are 0-8. 8 is the highest.<br />
	 */<br />
    public int getEvdoSnr() {<br />
	    return this.mEvdoSnr;<br />
    }<br />
    /**<br />
	 * Get signal level as an int from 0..4<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getLevel() {<br />
	    int level;<br />
	    if (isGsm) {<br />
		    if ((mLteSignalStrength == -1)<br />
				    && (mLteRsrp == -1)<br />
				    && (mLteRsrq == -1)<br />
				    && (mLteRssnr == -1)<br />
				    && (mLteCqi == -1)) {<br />
			    level = getGsmLevel();<br />
		    } else {<br />
			    level = getLteLevel();<br />
		    }<br />
	    } else {<br />
		    int cdmaLevel = getCdmaLevel();<br />
		    int evdoLevel = getEvdoLevel();<br />
		    if (evdoLevel == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {<br />
			    /* We don't know evdo, use cdma */<br />
			    level = getCdmaLevel();<br />
		    } else if (cdmaLevel == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {<br />
			    /* We don't know cdma, use evdo */<br />
			    level = getEvdoLevel();<br />
		    } else {<br />
			    /* We know both, use the lowest level */<br />
			    level = cdmaLevel < evdoLevel ? cdmaLevel : evdoLevel;<br />
		    }<br />
	    }<br />
	    if (DBG) log("getLevel=" + level);<br />
	    return level;<br />
    }<br />
    /**<br />
	 * Get the signal level as an asu value between 0..31, 99 is unknown<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getAsuLevel() {<br />
	    int asuLevel;<br />
	    if (isGsm) {<br />
		    if ((mLteSignalStrength == -1)<br />
				    && (mLteRsrp == -1)<br />
				    && (mLteRsrq == -1)<br />
				    && (mLteRssnr == -1)<br />
				    && (mLteCqi == -1)) {<br />
			    asuLevel = getGsmAsuLevel();<br />
		    } else {<br />
			    asuLevel = getLteAsuLevel();<br />
		    }<br />
	    } else {<br />
		    int cdmaAsuLevel = getCdmaAsuLevel();<br />
		    int evdoAsuLevel = getEvdoAsuLevel();<br />
		    if (evdoAsuLevel == 0) {<br />
			    /* We don't know evdo use, cdma */<br />
			    asuLevel = cdmaAsuLevel;<br />
		    } else if (cdmaAsuLevel == 0) {<br />
			    /* We don't know cdma use, evdo */<br />
			    asuLevel = evdoAsuLevel;<br />
		    } else {<br />
			    /* We know both, use the lowest level */<br />
			    asuLevel = cdmaAsuLevel < evdoAsuLevel ? cdmaAsuLevel : evdoAsuLevel;<br />
		    }<br />
	    }<br />
	    if (DBG) log("getAsuLevel=" + asuLevel);<br />
	    return asuLevel;<br />
    }<br />
    /**<br />
	 * Get the signal strength as dBm<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getDbm() {<br />
	    int dBm;<br />
	    if(isGsm()) {<br />
		    if ((mLteSignalStrength == -1)<br />
				    && (mLteRsrp == -1)<br />
				    && (mLteRsrq == -1)<br />
				    && (mLteRssnr == -1)<br />
				    && (mLteCqi == -1)) {<br />
			    dBm = getGsmDbm();<br />
		    } else {<br />
			    dBm = getLteDbm();<br />
		    }<br />
	    } else {<br />
		    dBm = getCdmaDbm();<br />
	    }<br />
	    if (DBG) log("getDbm=" + dBm);<br />
	    return dBm;<br />
    }<br />
    /**<br />
	 * Get Gsm signal strength as dBm<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getGsmDbm() {<br />
	    int dBm;<br />
	    int gsmSignalStrength = getGsmSignalStrength();<br />
	    int asu = (gsmSignalStrength == 99 ? -1 : gsmSignalStrength);<br />
	    if (asu != -1) {<br />
		    dBm = -113 + (2 * asu);<br />
	    } else {<br />
		    dBm = -1;<br />
	    }<br />
	    if (DBG) log("getGsmDbm=" + dBm);<br />
	    return dBm;<br />
    }<br />
    /**<br />
	 * Get gsm as level 0..4<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getGsmLevel() {<br />
	    int level;<br />
	    // ASU ranges from 0 to 31 - TS 27.007 Sec 8.5<br />
	    // asu = 0 (-113dB or less) is very weak<br />
	    // signal, its better to show 0 bars to the user in such cases.<br />
	    // asu = 99 is a special case, where the signal strength is unknown.<br />
	    int asu = getGsmSignalStrength();<br />
	    if (asu <= 2 || asu == 99) level = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;<br />
	    else if (asu >= 21) level = SIGNAL_STRENGTH_GREAT;<br />
	    else if (asu >= 18)  level = SIGNAL_STRENGTH_GOOD;<br />
	    else if (asu >= 16)  level = SIGNAL_STRENGTH_MODERATE;<br />
	    else level = SIGNAL_STRENGTH_POOR;<br />
	    if (DBG) log("getGsmLevel=" + level);<br />
	    return level;<br />
    }<br />
    /**<br />
	 * Get the gsm signal level as an asu value between 0..31, 99 is unknown<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getGsmAsuLevel() {<br />
	    // ASU ranges from 0 to 31 - TS 27.007 Sec 8.5<br />
	    // asu = 0 (-113dB or less) is very weak<br />
	    // signal, its better to show 0 bars to the user in such cases.<br />
	    // asu = 99 is a special case, where the signal strength is unknown.<br />
	    int level = getGsmSignalStrength();<br />
	    if (DBG) log("getGsmAsuLevel=" + level);<br />
	    return level;<br />
    }<br />
    /**<br />
	 * Get cdma as level 0..4<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getCdmaLevel() {<br />
	    final int cdmaDbm = getCdmaDbm();<br />
	    final int cdmaEcio = getCdmaEcio();<br />
	    int levelDbm;<br />
	    int levelEcio;<br />
	    if (cdmaDbm >= -71) levelDbm = SIGNAL_STRENGTH_GREAT;<br />
	    else if (cdmaDbm >= -77) levelDbm = SIGNAL_STRENGTH_GOOD;<br />
	    else if (cdmaDbm >= -81) levelDbm = SIGNAL_STRENGTH_MODERATE;<br />
	    else if (cdmaDbm >= -97) levelDbm = SIGNAL_STRENGTH_POOR;<br />
	    else levelDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;<br />
	    // Ec/Io are in dB*10<br />
	    if (cdmaEcio >= -90) levelEcio = SIGNAL_STRENGTH_GREAT;<br />
	    else if (cdmaEcio >= -110) levelEcio = SIGNAL_STRENGTH_GOOD;<br />
	    else if (cdmaEcio >= -130) levelEcio = SIGNAL_STRENGTH_MODERATE;<br />
	    else if (cdmaEcio >= -150) levelEcio = SIGNAL_STRENGTH_POOR;<br />
	    else levelEcio = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;<br />
	    int level = (levelDbm < levelEcio) ? levelDbm : levelEcio;<br />
	    if (DBG) log("getCdmaLevel=" + level);<br />
	    return level;<br />
    }<br />
    /**<br />
	 * Get the cdma signal level as an asu value between 0..31, 99 is unknown<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getCdmaAsuLevel() {<br />
	    final int cdmaDbm = getCdmaDbm();<br />
	    final int cdmaEcio = getCdmaEcio();<br />
	    int cdmaAsuLevel;<br />
	    int ecioAsuLevel;<br />
	    if (cdmaDbm >= -75) cdmaAsuLevel = 16;<br />
	    else if (cdmaDbm >= -82) cdmaAsuLevel = 8;<br />
	    else if (cdmaDbm >= -90) cdmaAsuLevel = 4;<br />
	    else if (cdmaDbm >= -95) cdmaAsuLevel = 2;<br />
	    else if (cdmaDbm >= -100) cdmaAsuLevel = 1;<br />
	    else cdmaAsuLevel = 99;<br />
	    // Ec/Io are in dB*10<br />
	    if (cdmaEcio >= -90) ecioAsuLevel = 16;<br />
	    else if (cdmaEcio >= -100) ecioAsuLevel = 8;<br />
	    else if (cdmaEcio >= -115) ecioAsuLevel = 4;<br />
	    else if (cdmaEcio >= -130) ecioAsuLevel = 2;<br />
	    else if (cdmaEcio >= -150) ecioAsuLevel = 1;<br />
	    else ecioAsuLevel = 99;<br />
	    int level = (cdmaAsuLevel < ecioAsuLevel) ? cdmaAsuLevel : ecioAsuLevel;<br />
	    if (DBG) log("getCdmaAsuLevel=" + level);<br />
	    return level;<br />
    }<br />
    /**<br />
	 * Get Evdo as level 0..4<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getEvdoLevel() {<br />
	    int evdoDbm = getEvdoDbm();<br />
	    int evdoSnr = getEvdoSnr();<br />
	    int levelEvdoDbm;<br />
	    int levelEvdoSnr;<br />
	    if (evdoDbm >= -71) levelEvdoDbm = SIGNAL_STRENGTH_GREAT;<br />
	    else if (evdoDbm >= -77) levelEvdoDbm = SIGNAL_STRENGTH_GOOD;<br />
	    else if (evdoDbm >= -89) levelEvdoDbm = SIGNAL_STRENGTH_MODERATE;<br />
	    else if (evdoDbm >= -97) levelEvdoDbm = SIGNAL_STRENGTH_POOR;<br />
	    else levelEvdoDbm = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;<br />
	    if (evdoSnr >= 7) levelEvdoSnr = SIGNAL_STRENGTH_GREAT;<br />
	    else if (evdoSnr >= 5) levelEvdoSnr = SIGNAL_STRENGTH_GOOD;<br />
	    else if (evdoSnr >= 3) levelEvdoSnr = SIGNAL_STRENGTH_MODERATE;<br />
	    else if (evdoSnr >= 1) levelEvdoSnr = SIGNAL_STRENGTH_POOR;<br />
	    else levelEvdoSnr = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;<br />
	    int level = (levelEvdoDbm < levelEvdoSnr) ? levelEvdoDbm : levelEvdoSnr;<br />
	    if (DBG) log("getEvdoLevel=" + level);<br />
	    return level;<br />
    }<br />
    /**<br />
	 * Get the evdo signal level as an asu value between 0..31, 99 is unknown<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getEvdoAsuLevel() {<br />
	    int evdoDbm = getEvdoDbm();<br />
	    int evdoSnr = getEvdoSnr();<br />
	    int levelEvdoDbm;<br />
	    int levelEvdoSnr;<br />
	    if (evdoDbm >= -65) levelEvdoDbm = 16;<br />
	    else if (evdoDbm >= -75) levelEvdoDbm = 8;<br />
	    else if (evdoDbm >= -85) levelEvdoDbm = 4;<br />
	    else if (evdoDbm >= -95) levelEvdoDbm = 2;<br />
	    else if (evdoDbm >= -105) levelEvdoDbm = 1;<br />
	    else levelEvdoDbm = 99;<br />
	    if (evdoSnr >= 7) levelEvdoSnr = 16;<br />
	    else if (evdoSnr >= 6) levelEvdoSnr = 8;<br />
	    else if (evdoSnr >= 5) levelEvdoSnr = 4;<br />
	    else if (evdoSnr >= 3) levelEvdoSnr = 2;<br />
	    else if (evdoSnr >= 1) levelEvdoSnr = 1;<br />
	    else levelEvdoSnr = 99;<br />
	    int level = (levelEvdoDbm < levelEvdoSnr) ? levelEvdoDbm : levelEvdoSnr;<br />
	    if (DBG) log("getEvdoAsuLevel=" + level);<br />
	    return level;<br />
    }<br />
    /**<br />
	 * Get LTE as dBm<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getLteDbm() {<br />
	    return mLteRsrp;<br />
    }<br />
    /**<br />
	 * Get LTE as level 0..4<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getLteLevel() {<br />
	    int levelLteRsrp = 0;<br />
	    if (mLteRsrp == -1) levelLteRsrp = 0;<br />
	    else if (mLteRsrp >= -71) levelLteRsrp = SIGNAL_STRENGTH_GREAT;<br />
	    else if (mLteRsrp >= -77) levelLteRsrp = SIGNAL_STRENGTH_GOOD;<br />
	    else if (mLteRsrp >= -89) levelLteRsrp = SIGNAL_STRENGTH_MODERATE;<br />
	    else if (mLteRsrp >= -97) levelLteRsrp = SIGNAL_STRENGTH_POOR;<br />
	    else levelLteRsrp = 0;<br />
	    if (DBG) log("Lte level: "+levelLteRsrp);<br />
	    return levelLteRsrp;<br />
    }<br />
    /**<br />
	 * Get the LTE signal level as an asu value between 0..97, 99 is unknown<br />
	 * Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69<br />
	 *<br />
	 * @hide<br />
	 */<br />
    public int getLteAsuLevel() {<br />
	    int lteAsuLevel = 99;<br />
	    int lteDbm = getLteDbm();<br />
	    if (lteDbm <= -140) lteAsuLevel = 0;<br />
	    else if (lteDbm >= -43) lteAsuLevel = 97;<br />
	    else lteAsuLevel = lteDbm + 140;<br />
	    if (DBG) log("Lte Asu level: "+lteAsuLevel);<br />
	    return lteAsuLevel;<br />
    }<br />
    /**<br />
	 * @return true if this is for GSM<br />
	 */<br />
    public boolean isGsm() {<br />
	    return this.isGsm;<br />
    }<br />
    /**<br />
	 * @return hash code<br />
	 */<br />
    @Override<br />
    public int hashCode() {<br />
	    int primeNum = 31;<br />
	    return ((mGsmSignalStrength * primeNum)<br />
			    + (mGsmBitErrorRate * primeNum)<br />
			    + (mCdmaDbm * primeNum) + (mCdmaEcio * primeNum)<br />
			    + (mEvdoDbm * primeNum) + (mEvdoEcio * primeNum) + (mEvdoSnr * primeNum)<br />
			    + (mLteSignalStrength * primeNum) + (mLteRsrp * primeNum)<br />
			    + (mLteRsrq * primeNum) + (mLteRssnr * primeNum) + (mLteCqi * primeNum)<br />
			    + (isGsm ? 1 : 0));<br />
    }<br />
    /**<br />
	 * @return true if the signal strengths are the same<br />
	 */<br />
    @Override<br />
    public boolean equals (Object o) {<br />
	    SignalStrength s;<br />
	    try {<br />
		    s = (SignalStrength) o;<br />
	    } catch (ClassCastException ex) {<br />
		    return false;<br />
	    }<br />
	    if (o == null) {<br />
		    return false;<br />
	    }<br />
	    return (mGsmSignalStrength == s.mGsmSignalStrength<br />
			    && mGsmBitErrorRate == s.mGsmBitErrorRate<br />
			    && mCdmaDbm == s.mCdmaDbm<br />
			    && mCdmaEcio == s.mCdmaEcio<br />
			    && mEvdoDbm == s.mEvdoDbm<br />
			    && mEvdoEcio == s.mEvdoEcio<br />
			    && mEvdoSnr == s.mEvdoSnr<br />
			    && mLteSignalStrength == s.mLteSignalStrength<br />
			    && mLteRsrp == s.mLteRsrp<br />
			    && mLteRsrq == s.mLteRsrq<br />
			    && mLteRssnr == s.mLteRssnr<br />
			    && mLteCqi == s.mLteCqi<br />
			    && isGsm == s.isGsm);<br />
    }<br />
    /**<br />
	 * @return string representation.<br />
	 */<br />
    @Override<br />
    public String toString() {<br />
	    return ("SignalStrength:"<br />
			    + " " + mGsmSignalStrength<br />
			    + " " + mGsmBitErrorRate<br />
			    + " " + mCdmaDbm<br />
			    + " " + mCdmaEcio<br />
			    + " " + mEvdoDbm<br />
			    + " " + mEvdoEcio<br />
			    + " " + mEvdoSnr<br />
			    + " " + mLteSignalStrength<br />
			    + " " + mLteRsrp<br />
			    + " " + mLteRsrq<br />
			    + " " + mLteRssnr<br />
			    + " " + mLteCqi<br />
			    + " " + (isGsm ? "gsm|lte" : "cdma"));<br />
    }<br />
    /**<br />
	 * Set SignalStrength based on intent notifier map<br />
	 *<br />
	 * @param m intent notifier map<br />
	 * @hide<br />
	 */<br />
    private void setFromNotifierBundle(Bundle m) {<br />
	    mGsmSignalStrength = m.getInt("GsmSignalStrength");<br />
	    mGsmBitErrorRate = m.getInt("GsmBitErrorRate");<br />
	    mCdmaDbm = m.getInt("CdmaDbm");<br />
	    mCdmaEcio = m.getInt("CdmaEcio");<br />
	    mEvdoDbm = m.getInt("EvdoDbm");<br />
	    mEvdoEcio = m.getInt("EvdoEcio");<br />
	    mEvdoSnr = m.getInt("EvdoSnr");<br />
	    mLteSignalStrength = m.getInt("LteSignalStrength");<br />
	    mLteRsrp = m.getInt("LteRsrp");<br />
	    mLteRsrq = m.getInt("LteRsrq");<br />
	    mLteRssnr = m.getInt("LteRssnr");<br />
	    mLteCqi = m.getInt("LteCqi");<br />
	    isGsm = m.getBoolean("isGsm");<br />
    }<br />
    /**<br />
	 * Set intent notifier Bundle based on SignalStrength<br />
	 *<br />
	 * @param m intent notifier Bundle<br />
	 * @hide<br />
	 */<br />
    public void fillInNotifierBundle(Bundle m) {<br />
	    m.putInt("GsmSignalStrength", mGsmSignalStrength);<br />
	    m.putInt("GsmBitErrorRate", mGsmBitErrorRate);<br />
	    m.putInt("CdmaDbm", mCdmaDbm);<br />
	    m.putInt("CdmaEcio", mCdmaEcio);<br />
	    m.putInt("EvdoDbm", mEvdoDbm);<br />
	    m.putInt("EvdoEcio", mEvdoEcio);<br />
	    m.putInt("EvdoSnr", mEvdoSnr);<br />
	    m.putInt("LteSignalStrength", mLteSignalStrength);<br />
	    m.putInt("LteRsrp", mLteRsrp);<br />
	    m.putInt("LteRsrq", mLteRsrq);<br />
	    m.putInt("LteRssnr", mLteRssnr);<br />
	    m.putInt("LteCqi", mLteCqi);<br />
	    m.putBoolean("isGsm", Boolean.valueOf(isGsm));<br />
    }<br />
    /**<br />
	 * log<br />
	 */<br />
    private static void log(String s) {<br />
	    Log.w(LOG_TAG, s);<br />
    }<br />
}<br />
```


----------



## JJHunter (Nov 29, 2011)

Using the code feature in the forums might be a good idea...just sayin.


```
<br />
Paste code here<br />
```


----------



## Dr. Hax (Sep 24, 2011)

JJHunter said:


> Using the code feature in the forums might be a good idea...just sayin.


Ashankyou


----------



## samsuck (Jul 5, 2011)

Umm, I have a request.

Can you change it so that it reflect your 1X coverage? Or at least you 3G coverage like on most verizon phones?

I think Thunderbolt uses the 3G coverage and side by side next to the Nexus it has 4 bars compared to the 2 on my Nexus (I know there is no signal issue, it's just that the Gnex uses LTE DBM , if i switch to 3g mode on the Nexus, I get all bars)


----------



## Zaphod-Beeblebrox (Jun 21, 2011)

Screw the Code tag .. how about using pastebin?


----------



## RamAir02 (Nov 17, 2011)

Sorry for my ignorance, but is this a flashable? If not, is it a file that can be edited with Root Explorer? Will this work with any 4.0.2/4.0.3 ROMs? Thanks!


----------



## sonicxml (Oct 1, 2011)

RamAir02 said:


> Sorry for my ignorance, but is this a flashable? If not, is it a file that can be edited with Root Explorer? Will this work with any 4.0.2/4.0.3 ROMs? Thanks!


I'm pretty sure this would be something you implement in the source code - as in the stuff you would find on your rom developers github.You cannot just flash this as it wouldn't work


----------



## Schoat333 (Jun 14, 2011)

What kind of lte signal does everyone else see for lte? This mod would mean I would only see 2 bars at the most? (lte signal here is usually between -90 and -100dbm) Right now, at -92, I see three.


----------



## Snow02 (Jun 14, 2011)

Are any of you actually seeing better than a -75 dBm signal? I have a tower practically in my backyard and it never gets better than that.


----------



## Serenity_FF (Jun 7, 2011)

I wanna say that at work I get high 50's to low 60's but not sure.... when I go into tomorrow I'll check it out and post a screenshot of what I get


----------



## Snow02 (Jun 14, 2011)

Serenity_FF said:


> I wanna say that at work I get high 50's to low 60's but not sure.... when I go into tomorrow I'll check it out and post a screenshot of what I get


Please do. Thanks.


----------



## spiccolli (Jan 12, 2012)

Snow02 said:


> Are any of you actually seeing better than a -75 dBm signal? I have a tower practically in my backyard and it never gets better than that.


Same here, so close i prolly have a tumor - also @ 16 asu fwiw


----------



## samsuck (Jul 5, 2011)

Snow02 said:


> Are any of you actually seeing better than a -75 dBm signal? I have a tower practically in my backyard and it never gets better than that.


Switch to 3G mode, I guarantee it drops. 
Better yet, turn off data and then it will show you true DBM for voice coverage.


----------



## Schoat333 (Jun 14, 2011)

samsuck said:


> Switch to 3G mode, I guarantee it drops.
> Better yet, turn off data and then it will show you true DBM for voice coverage.


That defeats the purpose tho. I want to see what my lte signal is, not CDMA. I make very few phone calls, so data signal is much more important to me.


----------



## Snow02 (Jun 14, 2011)

samsuck said:


> Switch to 3G mode, I guarantee it drops.
> Better yet, turn off data and then it will show you true DBM for voice coverage.


Guarantee, huh?


----------



## Smootee (Nov 23, 2011)

Snow02 said:


> Guarantee, huh?


I believe that right there is what we call "faced".

Sent from my Galaxy Nexus using Tapatalk


----------



## Dr. Hax (Sep 24, 2011)

Snow02 said:


> Are any of you actually seeing better than a -75 dBm signal? I have a tower practically in my backyard and it never gets better than that.


Duuude I wish I could have an LTE tower in my backyard.
And I only went to dBm to make it simpler. I believe it uses ASU to calculate actual signal.


----------



## Snow02 (Jun 14, 2011)

Dr. Hax said:


> Duuude I wish I could have an LTE tower in my backyard.
> And I only went to dBm to make it simpler. I believe it uses ASU to calculate actual signal.


Not according to the asu standard formula. That would give me a signal strength of -15 dBm at it's best







Asu on android is related to, but not directly indicative of, signal strength.

Sorry for the thread hijack...


----------



## pmoradi2002 (Jan 7, 2012)

Amidoingitrite?

Sent from my Galaxy Nexus using NOMNOMNOMNOM


----------

