Skip to content

fix: catch IllegalStateException from enterPictureInPictureMode - #435

Merged
akaboshinit merged 1 commit into
feat/picture-in-picturefrom
fix/catch-pip-illegal-state-exception
Sep 9, 2026
Merged

akaboshinit merged 1 commit into
feat/picture-in-picturefrom
fix/catch-pip-illegal-state-exception

Conversation

@akaboshinit

Copy link
Copy Markdown
Collaborator

概要

#432 (feat/picture-in-picture) をベースに、Android の Activity.enterPictureInPictureMode が投げる IllegalStateException を catch する修正です。

背景

一部の OEM ビルド (例: Samsung Android 9 + TalkBack 有効) では、FEATURE_PICTURE_IN_PICTURE がサポートありと報告されるにもかかわらず、システムサービス側で PiP が拒否され IllegalStateException が throw されクラッシュする。

変更内容

  • VideoPlayer.java: enterPictureInPictureMode を try/catch で囲み、IllegalStateException 時は false を返す
  • VideoPlayerTest.java: システムが PiP を拒否した場合に false が返ることを検証するテストを追加 (@Config(sdk = 28))

@akaboshinit
akaboshinit merged commit 1442f7b into feat/picture-in-picture Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant