diff --git a/src/main/java/com/marianhello/bgloc/provider/AbstractLocationProvider.java b/src/main/java/com/marianhello/bgloc/provider/AbstractLocationProvider.java index 97a636b8..6bb520d9 100644 --- a/src/main/java/com/marianhello/bgloc/provider/AbstractLocationProvider.java +++ b/src/main/java/com/marianhello/bgloc/provider/AbstractLocationProvider.java @@ -15,6 +15,7 @@ import android.content.IntentFilter; import android.location.Location; import android.media.AudioManager; +import android.os.Build; import android.provider.Settings; import android.widget.Toast; @@ -155,7 +156,8 @@ protected void showDebugToast (String text) { } public Boolean hasMockLocationsEnabled() { - return Settings.Secure.getString(mContext.getContentResolver(), android.provider.Settings.Secure.ALLOW_MOCK_LOCATION).equals("1"); + return Build.VERSION.SDK_INT < Build.VERSION_CODES.M && + Settings.Secure.getString(mContext.getContentResolver(), android.provider.Settings.Secure.ALLOW_MOCK_LOCATION).equals("1"); } /**