From b7e1e4a984f8260bca96afb993272a03c094109d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mieszko=20Wrzeszczy=C5=84ski?= Date: Sun, 13 Jan 2019 16:06:58 +0100 Subject: [PATCH] Fix 5.1 --- app/build.gradle | 2 +- .../uam/wmi/findmytutor/utils/MapUtils.java | 28 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7322975..6bd997a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,7 +10,7 @@ android { applicationId "com.uam.wmi.findmytutor" minSdkVersion 22 targetSdkVersion 27 - versionCode 65 + versionCode 66 versionName "1.0.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/com/uam/wmi/findmytutor/utils/MapUtils.java b/app/src/main/java/com/uam/wmi/findmytutor/utils/MapUtils.java index 0ff9d2b..f44ee42 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/utils/MapUtils.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/utils/MapUtils.java @@ -6,7 +6,6 @@ import android.content.Context; import android.content.Intent; import android.location.Location; import android.net.Uri; -import android.os.Build; import android.provider.Settings; import com.mapbox.mapboxsdk.camera.CameraPosition; @@ -92,21 +91,20 @@ public class MapUtils { public static void BatteryOptimizationsExceptionCheck(Context context) { if (shouldBatteryExclusionBeShown(getApplicationContext())) { PrefUtils.setBatteryExlusionInfoStatus(getApplicationContext(), false); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setTitle(R.string.batter_exclusions_title); - builder.setMessage(R.string.batter_exclusions_message) - .setPositiveButton(R.string.ok, (dialog, id) -> { - Intent intent = new Intent(); - intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); - Uri uri = Uri.fromParts("package", getApplicationContext().getPackageName(), null); - intent.setData(uri); - context.startActivity(intent); - }) - .setNegativeButton(R.string.cancel, (dialog, id) -> { - }).show(); - } + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setTitle(R.string.batter_exclusions_title); + builder.setMessage(R.string.batter_exclusions_message) + .setPositiveButton(R.string.ok, (dialog, id) -> { + Intent intent = new Intent(); + intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); + Uri uri = Uri.fromParts("package", getApplicationContext().getPackageName(), null); + intent.setData(uri); + context.startActivity(intent); + }) + .setNegativeButton(R.string.cancel, (dialog, id) -> { + + }).show(); } } -- 2.20.1