Scoped Storage 対応#480
Merged
TakayukiHoshi1984 merged 14 commits intoDeviceConnect:masterfrom Dec 20, 2019
Merged
Conversation
SupportLibraryをAndroidXLibraryに変更
最終的にはリバートすること。
Android 10 以降、MediaStore で共有されるメディアは FileInputStream で直接的に取得することができなくなったため、ContentResolver#openInputStream を経由して取得するように変更した。
This reverts commit 269ffe8.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Scoped Storage の制限により Android 10 端末上で期待通りに動作しなくなる部分について修正しました。
修正箇所
dConnectDevicePluginSDK
FileProvider に対して external-location が指定された場合の参照先
Android 9 以前: Environment#getExternalPublicStorage()
Android 10 以降: Context#getExternalFilesDir(null)
dConnectDemoLib
デモアプリのインストール先の親フォルダ
Android 9 以前: Environment#getExternalPublicStorage() 内に作成したサブフォルダ
Android 10 以降: Context#getExternalFilesDir(null)
dConnectManager
Webサーバーのドキュメントルート
Android 9 以前: Environment#getExternalPublicStorage() 内に作成したサブフォルダ
Android 10 以降: Context#getExternalFilesDir(null)
dConnectDeviceHost
写真と動画の保存方法
Android 10 以降は、撮影した写真と動画を MediaStore に保存する際、ContentResolver 経由で取得したストリームにデータを書き込みます。
動画サムネイルの保存方法
Android 10 以降は、動画サムネイルの MediaStore への保存が非推奨となるため、Host プラグインのアプリ固有フォルダ内に保存するようにします。
サムネイルを参照したい場合は、動画ファイル名 + .jpg という名前でアクセス可能とします。
(例)example-video.mp4.jpg
dConnectDeviceTheta
写真の保存方法
Android 10 以降は、撮影した写真を MediaStore に保存する際、ContentResolver 経由で保存します。
dConnectDeviceChromeCast
動画の取得方法
MediaPlayer プロファイルで再生する動画を MediaStore から読み込む際、ContentResolver 経由で取得します。