Description
Hi,
We removed the FOREGROUND_SERVICE_MEDIA_PROJECTION and FOREGROUND_SERVICE_MEDIA_PLAYBACK permissions from our app as directed in this post. After doing that we began to see two crashes in our app relating to the foreground service permissions. Their stack traces are below in the additional context section. We have been unable to reproduce them on our own thus far.
A few notes about our app:
-
We disable screen sharing using the
setHideShareButtonInMeetingToolbar
method. However user’s may still be in a zoom meeting where screen sharing is being used if the person sharing the screen is using the desktop zoom app. -
The exact XML changes we made were the same as what was described in the linked post but I’ll post them here as well for clarity
<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" />
<application
{some things here that don't need to show}
>
<service
android:name="com.zipow.videobox.share.ScreenShareServiceForSDK"
android:exported="false"
android:foregroundServiceType="microphone|connectedDevice"
tools:replace="android:foregroundServiceType"
android:label="Zoom"/>
</application>
Which Android Meeting SDK version?
6.1.1
Smartphone (please complete the following information):
- Device: Galaxy S23
- OS: Android 14
Additional context
Stack traces for the two crashes:
Fatal Exception: java.lang.RuntimeException: Unable to create service com.zipow.videobox.share.ScreenShareServiceForSDK: java.lang.IllegalArgumentException: foregroundServiceType 0x00000002 is not a subset of foregroundServiceType attribute 0x00000090 in service element of manifest file
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:8919)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Caused by java.lang.IllegalArgumentException: foregroundServiceType 0x00000002 is not a subset of foregroundServiceType attribute 0x00000090 in service element of manifest file
at android.os.Parcel.createExceptionOrNull(Parcel.java:3073)
at android.os.Parcel.createException(Parcel.java:3053)
at android.os.Parcel.readException(Parcel.java:3036)
at android.os.Parcel.readException(Parcel.java:2978)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7234)
at android.app.Service.startForeground(Service.java:862)
at us.zoom.proguard.dn$$ExternalSyntheticApiModelOutline0.m(D8$$SyntheticClass)
at us.zoom.sdk.SDKNotificationMgr.showConfNotificationForSDK(SDKNotificationMgr.java:128)
at us.zoom.sdk.SDKNotificationMgr.showConfNotificationForSDK(SDKNotificationMgr.java:4)
at com.zipow.videobox.share.ScreenShareServiceForSDK.onCreate(ScreenShareServiceForSDK.java:7)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:5098)
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:8919)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Fatal Exception: java.lang.RuntimeException: Unable to create service com.zipow.videobox.share.ScreenShareServiceForSDK: java.lang.SecurityException: Starting FGS with type microphone callerApp=ProcessRecord{64db24d 402:com.blank.event/u0a734} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_MICROPHONE] any of the permissions allOf=false [android.permission.CAPTURE_AUDIO_HOTWORD, android.permission.CAPTURE_AUDIO_OUTPUT, android.permission.CAPTURE_MEDIA_OUTPUT, android.permission.CAPTURE_TUNER_AUDIO_INPUT, android.permission.CAPTURE_VOICE_COMMUNICATION_OUTPUT, android.permission.RECORD_AUDIO] and the app must be in the eligible state/exemptions to access the foreground only permission
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:8919)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Caused by java.lang.SecurityException: Starting FGS with type microphone callerApp=ProcessRecord{64db24d 402:com.blank.event/u0a734} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_MICROPHONE] any of the permissions allOf=false [android.permission.CAPTURE_AUDIO_HOTWORD, android.permission.CAPTURE_AUDIO_OUTPUT, android.permission.CAPTURE_MEDIA_OUTPUT, android.permission.CAPTURE_TUNER_AUDIO_INPUT, android.permission.CAPTURE_VOICE_COMMUNICATION_OUTPUT, android.permission.RECORD_AUDIO] and the app must be in the eligible state/exemptions to access the foreground only permission
at android.os.Parcel.createExceptionOrNull(Parcel.java:3069)
at android.os.Parcel.createException(Parcel.java:3053)
at android.os.Parcel.readException(Parcel.java:3036)
at android.os.Parcel.readException(Parcel.java:2978)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7234)
at android.app.Service.startForeground(Service.java:862)
at us.zoom.proguard.dn$$ExternalSyntheticApiModelOutline0.m(D8$$SyntheticClass)
at us.zoom.sdk.SDKNotificationMgr.showConfNotificationForSDK(SDKNotificationMgr.java:128)
at us.zoom.sdk.SDKNotificationMgr.showConfNotificationForSDK(SDKNotificationMgr.java:4)
at com.zipow.videobox.share.ScreenShareServiceForSDK.onCreate(ScreenShareServiceForSDK.java:7)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:5098)
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:8919)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
@elaine.ku @donte.zoom @carson.zoom We would really appreciate any insight you might have on this. Thanks a lot!