Created
September 14, 2013 08:01
-
-
Save yareally/6559794 to your computer and use it in GitHub Desktop.
ugly decompiled signalstrength class from a hwu8185 that keeps crashing my signal app. Damn cheap ass devices ignore the proper way to do toString() for the API.
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]; | |
} | |
}; | |
private static int INVALID = 0; | |
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 mGsmEcio; | |
private int mGsmRssi; | |
private int mGsmSignalStrength; | |
private boolean mIsGsm; | |
private int mLteCqi; | |
private int mLteRsrp; | |
private int mLteRsrq; | |
private int mLteRssi; | |
private int mLteSnr; | |
public SignalStrength() | |
{ | |
this(99, -1, -1, -1, -1, -1, -1, 99, INVALID, INVALID, INVALID, INVALID, true); | |
} | |
public SignalStrength(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, int paramInt11, int paramInt12, boolean paramBoolean) | |
{ | |
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.mLteSnr = paramInt11; | |
this.mLteCqi = paramInt12; | |
this.mIsGsm = paramBoolean; | |
} | |
public SignalStrength(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, int paramInt11, int paramInt12, boolean paramBoolean, int paramInt13, int paramInt14) | |
{ | |
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.mLteSnr = paramInt11; | |
this.mLteCqi = paramInt12; | |
this.mIsGsm = paramBoolean; | |
this.mGsmRssi = paramInt13; | |
this.mGsmEcio = paramInt14; | |
} | |
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, INVALID, INVALID, INVALID, INVALID, paramBoolean); | |
} | |
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(); | |
this.mLteSnr = paramParcel.readInt(); | |
this.mLteCqi = paramParcel.readInt(); | |
if (paramParcel.readInt() != 0); | |
for (boolean bool = true; ; bool = false) | |
{ | |
this.mIsGsm = bool; | |
this.mGsmRssi = paramParcel.readInt(); | |
this.mGsmEcio = paramParcel.readInt(); | |
return; | |
} | |
} | |
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.mLteSnr = paramBundle.getInt("LteSnr"); | |
this.mLteCqi = paramBundle.getInt("LteCqi"); | |
this.mIsGsm = paramBundle.getBoolean("isGsm"); | |
this.mGsmRssi = paramBundle.getInt("GsmRssi"); | |
this.mGsmEcio = paramBundle.getInt("GsmEcio"); | |
} | |
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.mLteSnr = paramSignalStrength.mLteSnr; | |
this.mLteCqi = paramSignalStrength.mLteCqi; | |
this.mIsGsm = paramSignalStrength.mIsGsm; | |
this.mGsmRssi = paramSignalStrength.mGsmRssi; | |
this.mGsmEcio = paramSignalStrength.mGsmEcio; | |
} | |
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.mLteSnr == localSignalStrength.mLteSnr) && (this.mLteCqi == localSignalStrength.mLteCqi) && (this.mIsGsm == localSignalStrength.mIsGsm) && (this.mGsmRssi == localSignalStrength.mGsmRssi) && (this.mGsmEcio == localSignalStrength.mGsmEcio); | |
} | |
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.putInt("LteSnr", this.mLteSnr); | |
paramBundle.putInt("LteCqi", this.mLteCqi); | |
paramBundle.putBoolean("isGsm", Boolean.valueOf(this.mIsGsm).booleanValue()); | |
paramBundle.putInt("GsmRssi", this.mGsmRssi); | |
paramBundle.putInt("GsmEcio", this.mGsmEcio); | |
} | |
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 getGsmEcio() | |
{ | |
return this.mGsmEcio; | |
} | |
public int getGsmRssi() | |
{ | |
return this.mGsmRssi; | |
} | |
public int getGsmSignalStrength() | |
{ | |
return this.mGsmSignalStrength; | |
} | |
public int getLteCqi() | |
{ | |
return this.mLteCqi; | |
} | |
public int getLteRsrp() | |
{ | |
return this.mLteRsrp; | |
} | |
public int getLteRsrq() | |
{ | |
return this.mLteRsrq; | |
} | |
public int getLteRssi() | |
{ | |
return this.mLteRssi; | |
} | |
public int getLteSnr() | |
{ | |
return this.mLteSnr; | |
} | |
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 + this.mGsmRssi + this.mGsmEcio + this.mLteSnr + this.mLteCqi; | |
if (this.mIsGsm); | |
for (int j = 1; ; j = 0) | |
return i + j; | |
} | |
public boolean isGsm() | |
{ | |
return this.mIsGsm; | |
} | |
public void setGsm(boolean paramBoolean) | |
{ | |
this.mIsGsm = paramBoolean; | |
} | |
public String toString() | |
{ | |
StringBuilder localStringBuilder = 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(" ").append(this.mLteSnr).append(" ").append(this.mLteCqi).append(".").append(this.mGsmRssi).append(".").append(this.mGsmEcio).append(" "); | |
if (this.mIsGsm); | |
for (String str = "gsm"; ; str = "cdma") | |
return str; | |
} | |
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); | |
paramParcel.writeInt(this.mLteSnr); | |
paramParcel.writeInt(this.mLteCqi); | |
if (this.mIsGsm); | |
for (int i = 1; ; i = 0) | |
{ | |
paramParcel.writeInt(i); | |
paramParcel.writeInt(this.mGsmRssi); | |
paramParcel.writeInt(this.mGsmEcio); | |
return; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment