From 158ecf40167b2510540e92de2fc2d3e65f7c895e Mon Sep 17 00:00:00 2001 From: AishwaryaShinde07 <145684607+AishwaryaShinde07@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:50:33 -0500 Subject: [PATCH] Revert "#2 Merging this if statement with the enclosing one" --- .../opentracks/services/TrackRecordingService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/dennisguse/opentracks/services/TrackRecordingService.java b/src/main/java/de/dennisguse/opentracks/services/TrackRecordingService.java index e471a9144..f6c6c9115 100644 --- a/src/main/java/de/dennisguse/opentracks/services/TrackRecordingService.java +++ b/src/main/java/de/dennisguse/opentracks/services/TrackRecordingService.java @@ -223,10 +223,10 @@ private synchronized void startSensors() { wakeLock = SystemUtils.acquireWakeLock(this, wakeLock); trackPointCreator.start(this, handler); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && !PermissionRequester.RECORDING.hasPermission(this)) { - + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + if (!PermissionRequester.RECORDING.hasPermission(this)) { throw new RuntimeException("Android14: Please grant permissions LOCATION and NEARBY DEVICES (manually)"); - + } } ServiceCompat.startForeground(this, TrackRecordingServiceNotificationManager.NOTIFICATION_ID, notificationManager.setGPSonlyStarted(this), ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION + ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE);