Commit aca61c15 by Maurits van Beusekom Committed by GitHub

Merge pull request #236 from ened/fix/235

Resolve ServiceManager issue for Android 4.4+ to <Pie
parents d4e35128 4b16c483
...@@ -80,7 +80,7 @@ final class ServiceManager { ...@@ -80,7 +80,7 @@ final class ServiceManager {
return locationManager.isLocationEnabled(); return locationManager.isLocationEnabled();
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return isLocationServiceEnablePrePie(context); return isLocationServiceEnabledKitKat(context);
} else { } else {
return isLocationServiceEnablePreKitKat(context); return isLocationServiceEnablePreKitKat(context);
} }
...@@ -89,10 +89,11 @@ final class ServiceManager { ...@@ -89,10 +89,11 @@ final class ServiceManager {
// Suppress deprecation warnings since it's purpose is to support to be backwards compatible with // Suppress deprecation warnings since it's purpose is to support to be backwards compatible with
// pre Pie versions of Android. // pre Pie versions of Android.
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
private static boolean isLocationServiceEnablePrePie(Context context) private static boolean isLocationServiceEnabledKitKat(Context context)
{ {
if (VERSION.SDK_INT < VERSION_CODES.P) if (Build.VERSION.SDK_INT < VERSION_CODES.KITKAT) {
return false; return false;
}
final int locationMode; final int locationMode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment