androidforeground-servicezoom-sdk

App using 3rd party SDK (Zoom Meeting SDK) has been rejected due to Foreground service permissions


I am using the Meeting SDK (v5.17.1.18530) to create a custom UI app.

The app is built targeting SDK 34 (Android 14), so Google needs specific information about how the app uses foreground services.

Google rejected the latest app update because I need to provide more information about the foreground service.

Violation: Permissions for Foreground Services: Functionality is not initiated by or perceptible to the user

Details: We found that one or more of the declared use cases is not compliant with how foreground service permission 2 is allowed to be used. Specifically, the user is not made aware of functionality requiring permission when active.

Use of FGS is not perceptible to the user when performing Media Playback - Media Playback, Media Projection - Media and Content Projection and Streaming functionality.

Google is asking me for a video that shows how my application uses the following features in the foreground service.

android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK

I have tried to remove FOREGROUND_SERVICE_MEDIA_PROJECTION and FOREGROUND_SERVICE_MEDIA_PLAYBACK from my app manifest but in this case my app crashes on Android 14 due to SecurityException starting FGS with type mediaPlayback. It happens at the start of the Zoom meeting.

Fatal Exception: java.lang.RuntimeException Unable to create service com.zipow.videobox.share.ScreenShareServiceForSDK: java.lang.SecurityException: Starting FGS with type mediaPlayback callerApp=ProcessRecord{d0c5093 11843:my.app/u0a416} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK]

with the following callstack:

Fatal Exception: java.lang.RuntimeException: Unable to create service com.zipow.videobox.share.ScreenShareServiceForSDK: java.lang.SecurityException: Starting FGS with type mediaPlayback callerApp=ProcessRecord{d0c5093 11843:my.app/u0a416} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK] at android.app.ActivityThread.handleCreateService(ActivityThread.java:5111) at android.app.ActivityThread.-$$Nest$mhandleCreateService() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2506) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8893) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Zoom support says that the SDK is using them for screen sharing functionality:

FOREGROUND_SERVICE_MEDIA_PLAYBACK: Allow the capability to share audio while screen sharing

FOREGROUND_SERVICE_MEDIA_PROJECTION: Allow the capability to project the screen while screen sharing

Unfortunately I do not find any way to configure the Zoom sdk for starting the Zoom meeting foreground service without the SERVICE_MEDIA_PROJECTION and MEDIA_PLAYBACK types.

Google asks me a video of my app using capability to share audio while screen sharing and a video of my app using capability to project the screen while screen sharing. These videos are required to publish an application targeting SDK 34.

The issue is that my application does not implement (use) screen sharing feature of the Zoom Meeting SDK, so I cannot provide a video showing how my application uses it in the foreground service.

How can I prevent the Zoom Meeting SDK (or any other 3rd party libraries) from launching foreground services that use FOREGROUND_SERVICE_MEDIA_PLAYBACK or FOREGROUND_SERVICE_MEDIA_PROJECTION?

How can I handle this kind of situations with 3rd party libraries?

Any advice? Any workaround?


Solution

  • Starting from Zoom SDK 6.0.2 the foregroundServiceType can be specified in the app manifest and the SDK will honor this setting. It does not work for older SDK.

    <service
        android:name="com.zipow.videobox.share.ScreenShareServiceForSDK"
        android:exported="false"
        android:foregroundServiceType="microphone|connectedDevice"
        tools:replace="android:foregroundServiceType"
        android:label="Zoom"/>
    

    By default Zoom SDK uses the following foreground service features:

    FOREGROUND_SERVICE_MEDIA_PROJECTION

    FOREGROUND_SERVICE_MEDIA_PLAYBACK

    FOREGROUND_SERVICE_MICROPHONE

    FOREGROUND_SERVICE_PHONE_CALL

    FOREGROUND_SERVICE_CONNECTED_DEVICE

    But since my app does not use all the features, I can remove some of them from the app manifest.

    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" tools:node="remove" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" tools:node="remove" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" tools:node="remove" />
    

    Leave only the features that are actually used:

    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
    

    This allows me to provide all the necessary videos and information during the app review for app publishing.