Skip to content

Commit

Permalink
Merging this if statement with the enclosing one
Browse files Browse the repository at this point in the history
This will decrease the nesting of the code and improve its readability.
  • Loading branch information
AishwaryaShinde07 committed Feb 13, 2024
1 parent f3f9ad2 commit 411747e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,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) {
if (!PermissionRequester.RECORDING.hasPermission(this)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && !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);
Expand Down

0 comments on commit 411747e

Please sign in to comment.