Skip to content

Commit

Permalink
Handle more exception types
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Apr 3, 2024
1 parent b183b72 commit eed578c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId 'org.traccar.client'
minSdkVersion 19
targetSdkVersion 34
versionCode 84
versionName '7.3'
versionCode 85
versionName '7.4'
multiDexEnabled true
}
namespace 'org.traccar.client'
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/org/traccar/client/TrackingService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package org.traccar.client

import android.Manifest
import android.annotation.SuppressLint
import android.app.ForegroundServiceStartNotAllowedException
import android.app.Notification
import android.app.PendingIntent
import android.app.Service
Expand All @@ -32,6 +33,7 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.ServiceCompat
import androidx.core.content.ContextCompat
import androidx.preference.PreferenceManager
import java.lang.RuntimeException

class TrackingService : Service() {

Expand All @@ -56,7 +58,7 @@ class TrackingService : Service() {
trackingController = TrackingController(this)
trackingController?.start()
}
} catch (e: SecurityException) {
} catch (e: RuntimeException) {
Log.w(TAG, e)
sharedPreferences.edit().putBoolean(MainFragment.KEY_STATUS, false).apply()
stopSelf()
Expand Down

0 comments on commit eed578c

Please sign in to comment.