File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ Licensed to the Apache Software Foundation (ASF) under one
3838import android .app .NotificationChannel ;
3939import android .net .wifi .WifiManager ;
4040import android .net .wifi .WifiManager .WifiLock ;
41+ import android .Manifest ;
4142
4243import org .json .JSONObject ;
4344
@@ -131,8 +132,10 @@ private void keepAwake()
131132 boolean isSilent = settings .optBoolean ("silent" , false );
132133
133134 if (!isSilent ) {
134- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q )
135- startForeground (NOTIFICATION_ID , makeNotification (), android .permission .FOREGROUND_SERVICE_REMOTE_MESSAGING );
135+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
136+ String permission = Manifest .permission .FOREGROUND_SERVICE_REMOTE_MESSAGING ;
137+ startForeground (NOTIFICATION_ID , makeNotification (), permission );
138+ }
136139 else
137140 startForeground (NOTIFICATION_ID , makeNotification ());
138141 }
You can’t perform that action at this time.
0 commit comments