mastodon.juggler.jp は、数々の独立したMastodonサーバーのうちのひとつです。サーバーに登録してFediverseのコミュニティに加わってみませんか。
日本語で楽しめるMastodonサーバを提供しています。

サーバーの情報

63
人のアクティブユーザー

Android 14 だと mediaProjection.createVirtualDisplay で例外が出る。
java.lang.SecurityException: Don't re-use the resultData to retrieve the same projection instance, and don't use a token that has timed out. Don't take multiple captures by invoking MediaProjection#createVirtualDisplay multiple times on the same instance.
stackoverflow.com/questions/76
明らかに制限が増えてて操作感が悪くなりそう

Stack OverflowReusing media projection Intent on Android 14I have an Android screen recording app. In my app the user can start a screen recording directly in the app, as well as via a button in a notification (bound to a foreground service). To start a

さらに
java.lang.SecurityException:
Starting FGS with type mediaProjection
callerApp=ProcessRecord{7fd65d0 17027:jp.juggler.screenshotbutton/u0a225}
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]

とか。

- foregroundServiceType が mediaProjection のサービスを開始するには CAPTURE_VIDEO_OUTPUT 権限が必要。
- CAPTURE_VIDEO_OUTPUT 権限の取得は通常の実行時権限要求ではなく、mediaProjectionManager.createScreenCaptureIntent() を使った確認UIを割と頻繁に呼び出す必要がある。

tateisu​ :force::r_9a:

サービスが何かの理由で失われたから少し後に再起動しよう…と思っても権限だったりScreenCaptureIntentの返すトークンだったりが不足して不可能な感じ。