26 lines
857 B
Java
26 lines
857 B
Java
package com.yanzhenjie.permission.checker;
|
|
|
|
import android.content.Context;
|
|
import android.location.LocationManager;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes2.dex */
|
|
class LocationFineTest implements PermissionTest {
|
|
private Context a;
|
|
|
|
LocationFineTest(Context context) {
|
|
this.a = context;
|
|
}
|
|
|
|
@Override // com.yanzhenjie.permission.checker.PermissionTest
|
|
public boolean a() throws Throwable {
|
|
List<String> providers = ((LocationManager) this.a.getSystemService("location")).getProviders(true);
|
|
boolean contains = providers.contains("gps");
|
|
boolean contains2 = providers.contains("passive");
|
|
if (contains || contains2 || !this.a.getPackageManager().hasSystemFeature("android.hardware.location.gps")) {
|
|
return true;
|
|
}
|
|
return !r0.isProviderEnabled("gps");
|
|
}
|
|
}
|