Skip to content

Screen sharing make the application crash on API 35+ #9153

Description

@bmarty

Steps to reproduce

Using a device/emulator running Android API 35 or more

  1. Start a call
  2. Someone else joins the call
  3. Start screen sharing
  4. Depending on the OS you may have to select an application to start sharing

Outcome

What did you expect?

Screen is shared in the call

What happened instead?

Application crashes with Thread: main, Exception: java.lang.RuntimeException: Unable to start service im.vector.app.features.call.webrtc.ScreenCaptureAndroidService@596bfe2 with null: java.lang.SecurityException: Starting FGS with type mediaProjection callerApp=ProcessRecord{3867e02 21066:im.vector.app.debug/u0a233} targetSDK=35 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION] any of the permissions allOf=false [android.permission.CAPTURE_VIDEO_OUTPUT, android:project_media]

Related rageshake: https://github.com/element-hq/element-android-rageshakes/issues/99632
https://github.com/element-hq/element-android-rageshakes/issues?q=is%3Aissue%20state%3Aopen%20ScreenCaptureAndroidService

Resource: https://developer.android.com/about/versions/14/changes/fgs-types-required#media-projection

Your phone model

Emu with API 35

Operating system version

API 35

Application version and app store

latest develop

Homeserver

Any

Will you send logs?

Yes

Are you willing to provide a PR?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MajorSeverely degrades major functionality or product features, with no satisfactory workaroundT-DefectSomething isn't working: bugs, crashes, hangs and other reported problemsZ-Crash

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions