Skip to content

Commit 9c5b49d

Browse files
committed
v3.1.0 add ACCESS_BACKGROUND_LOCATION
It is necessary to launch service on boot
1 parent 239aaf8 commit 9c5b49d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

gps-android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ publishing {
5959
create<MavenPublication>("Release") {
6060
groupId = "solutions.s4y.gps"
6161
artifactId = "gps-sdk-android"
62-
version = "3.0.1"
62+
version = "3.1.0"
6363

6464
pom {
6565
packaging = "aar"

gps-android/src/main/AndroidManifest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3-
3+
<!-- SDK34 requires for FGS during boot-->
4+
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
45
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
56
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
67
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
78
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
89
<uses-permission android:name="android.permission.INTERNET" />
10+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
911
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
10-
<!-- Should be added to the app's manifest file
12+
<!-- Should be added to the app's manifest file because not apps require it
1113
<uses-permission android:name="android.permission.QUICKBOOT_POWERON" />
1214
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
1315
-->

gps-android/src/main/java/s4y/gps/sdk/android/BootReceiver.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ class BootReceiver : BroadcastReceiver() {
88
override fun onReceive(context: Context, intent: Intent) {
99
if (Intent.ACTION_BOOT_COMPLETED == intent.action || "android.permission.QUICKBOOT_POWERON" == intent.action) {
1010
if (GPSPreferences.keepAlive(context)) {
11-
val startIntent = Intent(context, GPSUpdatesForegroundService::class.java)
1211
// it is assumed service will be configured in Application.onCreate
13-
startIntent.action = GPSUpdatesForegroundService.ACTION_START
14-
context.startService(startIntent)
12+
GPSUpdatesForegroundService.start(context)
1513
}
1614
}
1715
}

0 commit comments

Comments
 (0)