Since targeting SDK 34 (Android 14), I’ve seen a few crashes on Android 14 (though small minority of Android 14 users):
java.lang.SecurityException: Starting FGS with type mediaProjection callerApp=ProcessRecord{44a8006 6938:com.foo/u0a6} 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]
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:7214)
at android.app.Service.startForeground(Service.java:775)
at com.foo.FooService.onStartCommand(FooService.java:28)
So far, only on Galaxy A13 & A72.
What could be causing this?