File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
java/com/platypii/baseline Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 8
8
<uses-permission android : name =" android.permission.BLUETOOTH_ADMIN" android : maxSdkVersion =" 30" />
9
9
<uses-permission android : name =" android.permission.BLUETOOTH_CONNECT" />
10
10
<uses-permission android : name =" android.permission.BLUETOOTH_SCAN" />
11
+ <uses-permission android : name =" android.permission.POST_NOTIFICATIONS" />
11
12
<uses-permission android : name =" android.permission.FOREGROUND_SERVICE" />
13
+ <uses-permission android : name =" android.permission.FOREGROUND_SERVICE_LOCATION" />
12
14
<uses-permission android : name =" android.permission.INTERNET" />
13
15
<uses-permission android : name =" android.permission.USE_CREDENTIALS" />
14
16
<uses-permission android : name =" android.permission.WAKE_LOCK" />
Original file line number Diff line number Diff line change 3
3
import android .app .Notification ;
4
4
import android .app .Service ;
5
5
import android .content .Intent ;
6
+ import android .content .pm .ServiceInfo ;
7
+ import android .os .Build ;
6
8
import android .os .IBinder ;
7
9
import android .util .Log ;
8
10
import androidx .annotation .Nullable ;
@@ -58,7 +60,11 @@ private void updateNotification() {
58
60
// Show notification
59
61
Log .i (TAG , "Showing notification" );
60
62
final Notification notification = Notifications .getNotification (this , logging , audible );
61
- startForeground (Notifications .notificationId , notification );
63
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
64
+ startForeground (Notifications .notificationId , notification , ServiceInfo .FOREGROUND_SERVICE_TYPE_LOCATION );
65
+ } else {
66
+ startForeground (Notifications .notificationId , notification );
67
+ }
62
68
} else {
63
69
// Stop service
64
70
Log .i (TAG , "Stopping foreground service" );
You can’t perform that action at this time.
0 commit comments