Ver código fonte

fix(android) Keep microphone enabled when app is in background

factor2
Mayuki Arisaka 1 ano atrás
pai
commit
fee4151f83

+ 2
- 1
android/sdk/src/main/AndroidManifest.xml Ver arquivo

@@ -12,6 +12,7 @@
12 12
     <uses-permission android:name="android.permission.WAKE_LOCK" />
13 13
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
14 14
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
15
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
15 16
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
16 17
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
17 18
     <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
@@ -50,7 +51,7 @@
50 51
 
51 52
         <service
52 53
             android:name="org.jitsi.meet.sdk.JitsiMeetOngoingConferenceService"
53
-            android:foregroundServiceType="mediaPlayback" />
54
+            android:foregroundServiceType="mediaPlayback|microphone" />
54 55
 
55 56
         <provider
56 57
             android:name="com.reactnativecommunity.webview.RNCWebViewFileProvider"

+ 1
- 1
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetOngoingConferenceService.java Ver arquivo

@@ -133,7 +133,7 @@ public class JitsiMeetOngoingConferenceService extends Service
133 133
             JitsiMeetLogger.w(TAG + " Couldn't start service, notification is null");
134 134
         } else {
135 135
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
136
-                startForeground(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK);
136
+                startForeground(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK | ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE);
137 137
             } else {
138 138
                 startForeground(NOTIFICATION_ID, notification);
139 139
             }

Carregando…
Cancelar
Salvar