fix: use microphone foreground service type instead of phoneCall
phoneCall type requires MANAGE_OWN_CALLS on SDK 34+, which needs the app to be a default dialer. microphone type only requires RECORD_AUDIO which is already granted via runtime permission. https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
<!-- Audio/Video Playback -->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
||||
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
||||
|
||||
<!-- Phone calls -->
|
||||
@@ -228,7 +228,7 @@
|
||||
|
||||
<service
|
||||
android:name=".service.call.CallForegroundService"
|
||||
android:foregroundServiceType="phoneCall"
|
||||
android:foregroundServiceType="microphone"
|
||||
android:stopWithTask="true"
|
||||
android:exported="false" />
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ class CallForegroundService : Service() {
|
||||
NOTIFICATION_ID,
|
||||
notification,
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL
|
||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
|
||||
} else {
|
||||
0
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user