Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microphone doesn't work on Samsung Fold when it is folded or user is in the background #1207

Open
Miara opened this issue Oct 17, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Miara
Copy link

Miara commented Oct 17, 2024

Describe the bug

  • The microphone stops working when you fold the Samsung Fold during a call, but when you unfold the Fold it works again. However, when you start a call with the Fold folded, the microphone works, but when you unfold and fold it, it stops working.
  • When the user goes to the background during a call, the microphone stops working, but when they return to the application, it works again. In this case - it always happens regardless of whether the Fold is folded or not.

These bugs appear also in Messenger, but on Whatsapp/Telegram it works properly.

I got report that it also appears on Samsung Note 20. It seems to appear only on devices with Android 13 and 14 in the background. Perhaps microphone service type could solve the issue?

I saw that in this PR: #1200 - you added such service, but only for audio (right?). In PR description it is said that CallService type was changed, but in changes I don't see CallService type has changed. Maybe it would be the solution for the problem mentioned above

SDK version

  • 1.0.16

To Reproduce
Steps to reproduce the behavior: actually described above ☝️

Expected behavior
Microphone should work even in the background or folded device.

Device:

  • Vendor and model: Samsung Fold 6
  • Android version: 14
@Miara Miara added the bug Something isn't working label Oct 17, 2024
@Miara
Copy link
Author

Miara commented Oct 21, 2024

The issue appears also on Samsung Flip

@aleksandar-apostolov
Copy link
Collaborator

Hey @Miara thanks for the report.

You can test the theory if the type would work by using the service defined for live streaming host. Its types are "microphone|camera".

To do so you need to provide a CallServiceConfig to the builder like so:

val callServiceConfig = livestreamCallServiceConfig()
val newCallServiceConfig = callServiceConfig.copy(
    callServicePerType = mapOf(
        Pair("ALL_CALL_TYPES", callServiceConfig.callServicePerType.getValue("livestream")),
    ),
)

Supply the newCallServiceConfig to the builder and you would get a service type of microphone|camera.

Let me know if this works. If yes, we will supply a proper default config for this type.

@Miara
Copy link
Author

Miara commented Oct 23, 2024

@aleksandar-apostolov I tried, but I have such error - I'm not sure where the problem is:

 Caused by: java.lang.IllegalArgumentException: foregroundServiceType 0x00000800 is not a subset of foregroundServiceType attribute 0x000000C0 in service element of manifest file
                                                    	at android.os.Parcel.createExceptionOrNull(Parcel.java:3061)
                                                    	at android.os.Parcel.createException(Parcel.java:3041)
                                                    	at android.os.Parcel.readException(Parcel.java:3024)
                                                    	at android.os.Parcel.readException(Parcel.java:2966)
                                                    	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6761)
                                                    	at android.app.Service.startForeground(Service.java:862)
                                                    	at androidx.core.app.ServiceCompat$Api34Impl.startForeground(ServiceCompat.java:241)
                                                    	at androidx.core.app.ServiceCompat.startForeground(ServiceCompat.java:172)
                                                    	at io.getstream.video.android.core.utils.AndroidUtilsKt.startForegroundWithServiceType(AndroidUtils.kt:196)
                                                    	at io.getstream.video.android.core.notifications.internal.service.CallService.maybePromoteToForegroundService(CallService.kt:360)
                                                    	at io.getstream.video.android.core.notifications.internal.service.CallService.onStartCommand(CallService.kt:234)
                                                    	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4821)
                                                    	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0) 
                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2289) 
                                                    	at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                    	at android.os.Looper.loopOnce(Looper.java:205) 
                                                    	at android.os.Looper.loop(Looper.java:294) 
                                                    	at android.app.ActivityThread.main(ActivityThread.java:8177) 
                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) 
                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) 
                                                    Caused by: android.os.RemoteException: Remote stack trace:
                                                    	at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:2053)
                                                    	at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:1679)
                                                    	at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:13281)
                                                    	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3385)
                                                    	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2720)
                                                    	```

@github-actions github-actions bot removed the waiting for response Further information is requested label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants