Skip to content

Instantly share code, notes, and snippets.

@strazzere
Last active September 13, 2017 06:07
Show Gist options
  • Save strazzere/b3e04ba63d4f566924cadbd5b8a51efc to your computer and use it in GitHub Desktop.
Save strazzere/b3e04ba63d4f566924cadbd5b8a51efc to your computer and use it in GitHub Desktop.
LocationRequest
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
package com.google.android.gms.location;
import android.os.*;
import com.google.android.gms.common.internal.ReflectedParcelable;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.zzz;
// Referenced classes of package com.google.android.gms.location:
// zzk
public final class LocationRequest extends AbstractSafeParcelable
implements ReflectedParcelable
{
public static LocationRequest create()
{
return new LocationRequest();
}
public LocationRequest()
{
mVersionCode = 1;
mPriority = 102;
akm = 0x36ee80L;
akn = 0x927c0L;
VT = false;
ajR = 0xffffffffL;
ako = 0x7fffffff;
akp = 0.0F;
akq = 0L;
}
public LocationRequest setPriority(int i)
{
setPriorityPrivate(i);
mPriority = i;
return this;
}
public int getPriority()
{
return mPriority;
}
public LocationRequest setInterval(long l)
{
zzau(l);
akm = l;
if(!VT)
akn = (long)((double)akm / 6D);
return this;
}
public long getInterval()
{
return akm;
}
public LocationRequest setMaxWaitTime(long l)
{
zzau(l);
akq = l;
return this;
}
public long getMaxWaitTime()
{
long l = akq;
if(l < akm)
l = akm;
return l;
}
public LocationRequest setFastestInterval(long l)
{
zzau(l);
VT = true;
akn = l;
return this;
}
public long getFastestInterval()
{
return akn;
}
public LocationRequest setExpirationDuration(long l)
{
long l1 = SystemClock.elapsedRealtime();
if(l > 0xffffffffL - l1)
ajR = 0xffffffffL;
else
ajR = l + l1;
if(ajR < 0L)
ajR = 0L;
return this;
}
public LocationRequest setExpirationTime(long l)
{
ajR = l;
if(ajR < 0L)
ajR = 0L;
return this;
}
public long getExpirationTime()
{
return ajR;
}
public LocationRequest setNumUpdates(int i)
{
if(i <= 0)
{
throw new IllegalArgumentException((new StringBuilder(31)).append("invalid numUpdates: ").append(i).toString());
} else
{
ako = i;
return this;
}
}
public int getNumUpdates()
{
return ako;
}
public LocationRequest setSmallestDisplacement(float f)
{
zze(f);
akp = f;
return this;
}
public float getSmallestDisplacement()
{
return akp;
}
private static void zzau(long l)
{
if(l < 0L)
throw new IllegalArgumentException((new StringBuilder(38)).append("invalid interval: ").append(l).toString());
else
return;
}
private static void setPriorityPrivate(int i)
{
switch(i)
{
case 101: // 'e'
case 103: // 'g'
default:
throw new IllegalArgumentException((new StringBuilder(28)).append("invalid quality: ").append(i).toString());
case 100: // 'd'
case 102: // 'f'
case 104: // 'h'
case 105: // 'i'
return;
}
}
private static void zze(float f)
{
if(f < 0.0F)
throw new IllegalArgumentException((new StringBuilder(37)).append("invalid displacement: ").append(f).toString());
else
return;
}
LocationRequest(int i, int j, long l, long l1, boolean flag,
long l2, int k, float f, long l3)
{
mVersionCode = i;
mPriority = j;
akm = l;
akn = l1;
VT = flag;
ajR = l2;
ako = k;
akp = f;
akq = l3;
}
public void writeToParcel(Parcel parcel, int i)
{
zzk.zza(this, parcel, i);
}
public static String zzur(int i)
{
switch(i)
{
case 100: // 'd'
return "PRIORITY_HIGH_ACCURACY";
case 102: // 'f'
return "PRIORITY_BALANCED_POWER_ACCURACY";
case 104: // 'h'
return "PRIORITY_LOW_POWER";
case 105: // 'i'
return "PRIORITY_NO_POWER";
case 101: // 'e'
case 103: // 'g'
default:
return "???";
}
}
public String toString()
{
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.append("Request[").append(zzur(mPriority));
if(mPriority != 105)
{
stringbuilder.append(" requested=");
stringbuilder.append(akm).append("ms");
}
stringbuilder.append(" fastest=");
stringbuilder.append(akn).append("ms");
if(akq > akm)
{
stringbuilder.append(" maxWait=");
stringbuilder.append(akq).append("ms");
}
if(ajR != 0xffffffffL)
{
long l = ajR - SystemClock.elapsedRealtime();
stringbuilder.append(" expireIn=");
stringbuilder.append(l).append("ms");
}
if(ako != 0x7fffffff)
stringbuilder.append(" num=").append(ako);
stringbuilder.append(']');
return stringbuilder.toString();
}
public int hashCode()
{
return zzz.hashCode(new Object[] {
Integer.valueOf(mPriority), Long.valueOf(akm), Long.valueOf(akn), Boolean.valueOf(VT), Long.valueOf(ajR), Integer.valueOf(ako), Float.valueOf(akp)
});
}
public boolean equals(Object obj)
{
if(this == obj)
return true;
if(!(obj instanceof LocationRequest))
{
return false;
} else
{
LocationRequest locationrequest = (LocationRequest)obj;
return mPriority == locationrequest.mPriority && akm == locationrequest.akm && akn == locationrequest.akn && VT == locationrequest.VT && ajR == locationrequest.ajR && ako == locationrequest.ako && akp == locationrequest.akp;
}
}
int getVersionCode()
{
return mVersionCode;
}
public static final int PRIORITY_HIGH_ACCURACY = 100;
public static final int PRIORITY_BALANCED_POWER_ACCURACY = 102;
public static final int PRIORITY_LOW_POWER = 104;
public static final int PRIORITY_NO_POWER = 105;
private final int mVersionCode;
int mPriority;
long akm;
long akn;
boolean VT;
long ajR;
int ako;
float akp;
long akq;
public static final android.os.Parcelable.Creator CREATOR = new zzk();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment