(cherry picked from commit 1de7b5e9b7)
Co-authored-by: Rahim Rahman <rahim.rahman@mattermost.com>
This commit is contained in:
parent
48b80ef09f
commit
21c7628da1
2 changed files with 13 additions and 1 deletions
|
|
@ -21,6 +21,7 @@
|
|||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
|
||||
|
||||
<!-- Request legacy Bluetooth permissions on older devices. -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH"
|
||||
|
|
@ -116,5 +117,15 @@
|
|||
android:foregroundServiceType="microphone"
|
||||
android:exported="false"
|
||||
/>
|
||||
|
||||
<!-- Android 14 requires the correct Foreground Service (FGS) type for RNShare -->
|
||||
<service
|
||||
android:name="androidx.work.impl.foreground.SystemForegroundService"
|
||||
android:foregroundServiceType="dataSync"
|
||||
android:exported="false"
|
||||
android:stopWithTask="false"
|
||||
tools:node="merge"
|
||||
/>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.mattermost.rnshare
|
||||
|
||||
import android.content.pm.ServiceInfo
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.core.app.NotificationCompat
|
||||
|
|
@ -147,7 +148,7 @@ class ShareWorker(context: Context, workerParameters: WorkerParameters) : Worker
|
|||
.setSmallIcon(applicationContext.resources.getIdentifier("ic_notification", "mipmap", applicationContext.packageName))
|
||||
.setOngoing(true)
|
||||
.build()
|
||||
return ForegroundInfo(1, notification)
|
||||
return ForegroundInfo(1, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue