LogmeinRescue / Android-SDK

Rescue In-App Support Android SDK
http://secure.logmeinrescue.com/welcome/webhelp/EN/SDKa/MobileSDK/c_rasdk_overview.html
Other
5 stars 6 forks source link

Android 14 support for device screen streaming #72

Open cswagner opened 5 months ago

cswagner commented 5 months ago

When targeting Android 14 (targetSdkVersion set to 34), the recommended implementation for device screen streaming results in the following crash:

java.lang.SecurityException: Starting FGS with type mediaProjection callerApp=ProcessRecord{c5f4063 29453:some.package.name/u0a456} targetSDK=34 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] 

This crash occurs even when android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION is declared in the AndroidManifest.xml file.

Android 14 now requires that the android.permission.CAPTURE_VIDEO_OUTPUT permission be granted prior to starting the media projection foreground service (see here). The prompt for that permission is triggered by invoking createScreenCaptureIntent(), which is currently encapsulated in the devicescreenstreaming SDK. Without a way to know whether the user granted/denied the permission, it's unclear when it's safe to start the media projection foreground service.

Could the following be updated to support device screen streaming on Android 14:

tbalogh commented 5 months ago

Hi @cswagner ,

Thank you for bringing this to our attention. We are planning to release a new version that fixes this issue until end of May.

Best, Tamas

cswagner commented 4 months ago

Hi @tbalogh, now that we're into June I just wanted to check in on the timeline for this. Thanks!

ctmarfil commented 3 months ago

@tbalogh , any updates on the timeline? Thanks

tbalogh commented 3 months ago

Hi @ctmarfil @cswagner .

We are planning to release the fix of this next week.

tamasgyongyosi commented 2 months ago

Hi @cswagner

We had released the 3.9.9 version from Rescue SDK. Please check the documentation here to implement your ForegroundService to support Android 14. If you have any questions, please let us know.

cswagner commented 2 months ago

Thanks for the update, @tamasgyongyosi. We'll try integrating v3.9.9 and let you know if we run into any issues.