Skip to content

Commit

Permalink
chore: no longer using foreground service microphone
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremynorman89 committed Aug 22, 2024
1 parent f9ea914 commit 1539324
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 1 addition & 2 deletions pil/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<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.BLUETOOTH"
android:maxSdkVersion="30" />
Expand All @@ -37,7 +36,7 @@

<service
android:name=".service.VoIPService"
android:foregroundServiceType="phoneCall|microphone"
android:foregroundServiceType="phoneCall"
android:exported="false" />

<receiver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@ internal class VoIPService : CoreService(), PILEventListener {

private fun showForegroundNotification(notification: Notification, id: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
val types = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
FOREGROUND_SERVICE_TYPE_MICROPHONE or FOREGROUND_SERVICE_TYPE_PHONE_CALL
} else {
FOREGROUND_SERVICE_TYPE_PHONE_CALL
}

startForeground(id, notification, types)
startForeground(id, notification, FOREGROUND_SERVICE_TYPE_PHONE_CALL)
} else {
startForeground(id, notification)
}
Expand Down

0 comments on commit 1539324

Please sign in to comment.