, , , , , ?
Notification, ,
setSound() NotificationCompat.Builder. Uri,
Android 7.0,
.
file: Uri, Android 7.0
targetSdkVersion 24 , Uri
file: Uri.
, content: Uri, , FileProvider,
... Android
.
.
: grantUriPermissions()
grantUriPermissions(),
Context. , ,
.
Nexus 6P (Android 6.0... ...) Nexus 9 (Android 7.0):
grantUriPermission("com.android.systemui", sound,
Intent.FLAG_GRANT_READ_URI_PERMISSION);
( sound - Uri, setSound())
Android,
.
:
android.resource, Uri setSound().
, ,
,
.
, , .
: ContentProvider
FileProvider —
. content: Uri,
- , exported
(, , ,
com.android.systemui, ).
,
my StreamProvider,
" ".
.
:
StrictMode,
VM (.. , )
file: Uri:
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().build());
VmPolicy
, , detectFileUriExposure().
file: Uri .
, Google file: Uri,
.
The Nuke: targetSdkVersion
file: Uri,
, a targetSdkVersion 24+. ,
" " Toast
.
: Android
NotificationManager grantUriPermissions()
, -
FLAG_GRANT_READ_URI_PERMISSION Uri,
Notification .
.