Created
November 29, 2013 13:21
-
-
Save yareally/7705608 to your computer and use it in GitHub Desktop.
SignalStrength.java pulled from a crappy LG Esteem (LG-MS910)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package android.telephony; | |
import android.os.Bundle; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.os.Parcelable.Creator; | |
public class SignalStrength | |
implements Parcelable | |
{ | |
public static final Parcelable.Creator<SignalStrength> CREATOR = new Parcelable.Creator() | |
{ | |
public SignalStrength createFromParcel(Parcel paramAnonymousParcel) | |
{ | |
return new SignalStrength(paramAnonymousParcel); | |
} | |
public SignalStrength[] newArray(int paramAnonymousInt) | |
{ | |
return new SignalStrength[paramAnonymousInt]; | |
} | |
}; | |
static final String LOG_TAG = "PHONE"; | |
private int mCdmaDbm; | |
private int mCdmaEcio; | |
private int mEvdoDbm; | |
private int mEvdoEcio; | |
private int mEvdoSnr; | |
private int mGsmBitErrorRate; | |
private int mGsmSignalStrength; | |
private boolean mIsCdma; | |
private boolean mIsGsm; | |
private boolean mIsLte; | |
private int mLteRsrp; | |
private int mLteRsrq; | |
private int mLteRssi; | |
public SignalStrength() | |
{ | |
this(99, -1, -1, -1, -1, -1, -1, true); | |
} | |
public SignalStrength(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) | |
{ | |
this.mGsmSignalStrength = paramInt1; | |
this.mGsmBitErrorRate = paramInt2; | |
this.mCdmaDbm = paramInt3; | |
this.mCdmaEcio = paramInt4; | |
this.mEvdoDbm = paramInt5; | |
this.mEvdoEcio = paramInt6; | |
this.mEvdoSnr = paramInt7; | |
this.mLteRssi = paramInt8; | |
this.mLteRsrp = paramInt9; | |
this.mLteRsrq = paramInt10; | |
this.mIsCdma = paramBoolean2; | |
this.mIsLte = paramBoolean3; | |
this.mIsGsm = paramBoolean1; | |
} | |
public SignalStrength(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, boolean paramBoolean) | |
{ | |
this(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, 99, -1, -1, paramBoolean, false, false); | |
} | |
public SignalStrength(Parcel paramParcel) | |
{ | |
this.mGsmSignalStrength = paramParcel.readInt(); | |
this.mGsmBitErrorRate = paramParcel.readInt(); | |
this.mCdmaDbm = paramParcel.readInt(); | |
this.mCdmaEcio = paramParcel.readInt(); | |
this.mEvdoDbm = paramParcel.readInt(); | |
this.mEvdoEcio = paramParcel.readInt(); | |
this.mEvdoSnr = paramParcel.readInt(); | |
this.mLteRssi = paramParcel.readInt(); | |
this.mLteRsrp = paramParcel.readInt(); | |
this.mLteRsrq = paramParcel.readInt(); | |
boolean bool1; | |
boolean bool2; | |
if (paramParcel.readInt() != 0) | |
{ | |
bool1 = true; | |
this.mIsGsm = bool1; | |
if (paramParcel.readInt() == 0) | |
break label134; | |
bool2 = true; | |
label107: this.mIsCdma = bool2; | |
if (paramParcel.readInt() == 0) | |
break label139; | |
} | |
label134: label139: for (boolean bool3 = true; ; bool3 = false) | |
{ | |
this.mIsLte = bool3; | |
return; | |
bool1 = false; | |
break; | |
bool2 = false; | |
break label107; | |
} | |
} | |
public SignalStrength(SignalStrength paramSignalStrength) | |
{ | |
copyFrom(paramSignalStrength); | |
} | |
private static boolean equalsHandlesNulls(Object paramObject1, Object paramObject2) | |
{ | |
if (paramObject1 == null) | |
return paramObject2 == null; | |
return paramObject1.equals(paramObject2); | |
} | |
public static SignalStrength newFromBundle(Bundle paramBundle) | |
{ | |
SignalStrength localSignalStrength = new SignalStrength(); | |
localSignalStrength.setFromNotifierBundle(paramBundle); | |
return localSignalStrength; | |
} | |
private void setFromNotifierBundle(Bundle paramBundle) | |
{ | |
this.mGsmSignalStrength = paramBundle.getInt("GsmSignalStrength"); | |
this.mGsmBitErrorRate = paramBundle.getInt("GsmBitErrorRate"); | |
this.mCdmaDbm = paramBundle.getInt("CdmaDbm"); | |
this.mCdmaEcio = paramBundle.getInt("CdmaEcio"); | |
this.mEvdoDbm = paramBundle.getInt("EvdoDbm"); | |
this.mEvdoEcio = paramBundle.getInt("EvdoEcio"); | |
this.mEvdoSnr = paramBundle.getInt("EvdoSnr"); | |
this.mLteRssi = paramBundle.getInt("LteRssi"); | |
this.mLteRsrp = paramBundle.getInt("LteRsrp"); | |
this.mLteRsrq = paramBundle.getInt("LteRsrq"); | |
this.mIsGsm = paramBundle.getBoolean("isGsm"); | |
this.mIsCdma = paramBundle.getBoolean("isCdma"); | |
this.mIsLte = paramBundle.getBoolean("isLte"); | |
} | |
protected void copyFrom(SignalStrength paramSignalStrength) | |
{ | |
this.mGsmSignalStrength = paramSignalStrength.mGsmSignalStrength; | |
this.mGsmBitErrorRate = paramSignalStrength.mGsmBitErrorRate; | |
this.mCdmaDbm = paramSignalStrength.mCdmaDbm; | |
this.mCdmaEcio = paramSignalStrength.mCdmaEcio; | |
this.mEvdoDbm = paramSignalStrength.mEvdoDbm; | |
this.mEvdoEcio = paramSignalStrength.mEvdoEcio; | |
this.mEvdoSnr = paramSignalStrength.mEvdoSnr; | |
this.mLteRssi = paramSignalStrength.mLteRssi; | |
this.mLteRsrp = paramSignalStrength.mLteRsrp; | |
this.mLteRsrq = paramSignalStrength.mLteRsrq; | |
this.mIsGsm = paramSignalStrength.mIsGsm; | |
this.mIsCdma = paramSignalStrength.mIsCdma; | |
this.mIsLte = paramSignalStrength.mIsLte; | |
} | |
public int describeContents() | |
{ | |
return 0; | |
} | |
public boolean equals(Object paramObject) | |
{ | |
SignalStrength localSignalStrength; | |
try | |
{ | |
localSignalStrength = (SignalStrength)paramObject; | |
if (paramObject == null) | |
return false; | |
} | |
catch (ClassCastException localClassCastException) | |
{ | |
return false; | |
} | |
return (this.mGsmSignalStrength == localSignalStrength.mGsmSignalStrength) && (this.mGsmBitErrorRate == localSignalStrength.mGsmBitErrorRate) && (this.mCdmaDbm == localSignalStrength.mCdmaDbm) && (this.mCdmaEcio == localSignalStrength.mCdmaEcio) && (this.mEvdoDbm == localSignalStrength.mEvdoDbm) && (this.mEvdoEcio == localSignalStrength.mEvdoEcio) && (this.mEvdoSnr == localSignalStrength.mEvdoSnr) && (this.mLteRssi == localSignalStrength.mLteRssi) && (this.mLteRsrp == localSignalStrength.mLteRsrp) && (this.mLteRsrq == localSignalStrength.mLteRsrq) && (this.mIsCdma == localSignalStrength.mIsCdma) && (this.mIsLte == localSignalStrength.mIsLte) && (this.mIsGsm == localSignalStrength.mIsGsm); | |
} | |
public void fillInNotifierBundle(Bundle paramBundle) | |
{ | |
paramBundle.putInt("GsmSignalStrength", this.mGsmSignalStrength); | |
paramBundle.putInt("GsmBitErrorRate", this.mGsmBitErrorRate); | |
paramBundle.putInt("CdmaDbm", this.mCdmaDbm); | |
paramBundle.putInt("CdmaEcio", this.mCdmaEcio); | |
paramBundle.putInt("EvdoDbm", this.mEvdoDbm); | |
paramBundle.putInt("EvdoEcio", this.mEvdoEcio); | |
paramBundle.putInt("EvdoSnr", this.mEvdoSnr); | |
paramBundle.putInt("LteRssi", this.mLteRssi); | |
paramBundle.putInt("LteRsrp", this.mLteRsrp); | |
paramBundle.putInt("LteRsrq", this.mLteRsrq); | |
paramBundle.putBoolean("isGsm", Boolean.valueOf(this.mIsGsm).booleanValue()); | |
paramBundle.putBoolean("isCdma", Boolean.valueOf(this.mIsCdma).booleanValue()); | |
paramBundle.putBoolean("isLte", Boolean.valueOf(this.mIsLte).booleanValue()); | |
} | |
public int getCdmaDbm() | |
{ | |
return this.mCdmaDbm; | |
} | |
public int getCdmaEcio() | |
{ | |
return this.mCdmaEcio; | |
} | |
public int getEvdoDbm() | |
{ | |
return this.mEvdoDbm; | |
} | |
public int getEvdoEcio() | |
{ | |
return this.mEvdoEcio; | |
} | |
public int getEvdoSnr() | |
{ | |
return this.mEvdoSnr; | |
} | |
public int getGsmBitErrorRate() | |
{ | |
return this.mGsmBitErrorRate; | |
} | |
public int getGsmSignalStrength() | |
{ | |
return this.mGsmSignalStrength; | |
} | |
public int getLteRsrp() | |
{ | |
return this.mLteRsrp; | |
} | |
public int getLteRsrq() | |
{ | |
return this.mLteRsrq; | |
} | |
public int getLteRssi() | |
{ | |
return this.mLteRssi; | |
} | |
public int hashCode() | |
{ | |
int i = 4660 * this.mGsmSignalStrength + this.mGsmBitErrorRate + this.mCdmaDbm + this.mCdmaEcio + this.mEvdoDbm + this.mEvdoEcio + this.mEvdoSnr + this.mLteRssi + this.mLteRsrp + this.mLteRsrq; | |
int j; | |
int m; | |
label77: int n; | |
if (this.mIsGsm) | |
{ | |
j = 1; | |
int k = i + j; | |
if (!this.mIsCdma) | |
break label104; | |
m = 1; | |
n = k + m; | |
if (!this.mIsLte) | |
break label110; | |
} | |
label104: label110: for (int i1 = 1; ; i1 = 0) | |
{ | |
return n + i1; | |
j = 0; | |
break; | |
m = 0; | |
break label77; | |
} | |
} | |
public boolean isCdma() | |
{ | |
return this.mIsCdma; | |
} | |
public boolean isGsm() | |
{ | |
return this.mIsGsm; | |
} | |
public boolean isLte() | |
{ | |
return this.mIsLte; | |
} | |
public String toString() | |
{ | |
StringBuilder localStringBuilder1 = new StringBuilder().append("SignalStrength: ").append(this.mGsmSignalStrength).append(" ").append(this.mGsmBitErrorRate).append(" ").append(this.mCdmaDbm).append(" ").append(this.mCdmaEcio).append(" ").append(this.mEvdoDbm).append(" ").append(this.mEvdoEcio).append(" ").append(this.mEvdoSnr).append(" ").append(this.mLteRssi).append(" ").append(this.mLteRsrp).append(" ").append(this.mLteRsrq).append(" "); | |
String str1; | |
String str2; | |
label165: StringBuilder localStringBuilder3; | |
if (this.mIsGsm) | |
{ | |
str1 = "gsm"; | |
StringBuilder localStringBuilder2 = localStringBuilder1.append(str1).append(" "); | |
if (!this.mIsCdma) | |
break label206; | |
str2 = "cdma"; | |
localStringBuilder3 = localStringBuilder2.append(str2).append(" "); | |
if (!this.mIsLte) | |
break label213; | |
} | |
label206: label213: for (String str3 = "lte"; ; str3 = "no lte") | |
{ | |
return str3; | |
str1 = "no gsm"; | |
break; | |
str2 = "no cdma"; | |
break label165; | |
} | |
} | |
public void writeToParcel(Parcel paramParcel, int paramInt) | |
{ | |
paramParcel.writeInt(this.mGsmSignalStrength); | |
paramParcel.writeInt(this.mGsmBitErrorRate); | |
paramParcel.writeInt(this.mCdmaDbm); | |
paramParcel.writeInt(this.mCdmaEcio); | |
paramParcel.writeInt(this.mEvdoDbm); | |
paramParcel.writeInt(this.mEvdoEcio); | |
paramParcel.writeInt(this.mEvdoSnr); | |
paramParcel.writeInt(this.mLteRssi); | |
paramParcel.writeInt(this.mLteRsrp); | |
paramParcel.writeInt(this.mLteRsrq); | |
int i; | |
int j; | |
if (this.mIsGsm) | |
{ | |
i = 1; | |
paramParcel.writeInt(i); | |
if (!this.mIsCdma) | |
break label132; | |
j = 1; | |
label104: paramParcel.writeInt(j); | |
if (!this.mIsLte) | |
break label138; | |
} | |
label132: label138: for (int k = 1; ; k = 0) | |
{ | |
paramParcel.writeInt(k); | |
return; | |
i = 0; | |
break; | |
j = 0; | |
break label104; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment