Apps shouldn't be disabling StrictMode checks.

Since Android N we've helpfully guided apps towards using content://
Uris when sharing data, but some obstinate apps have tried bypassing
these helpful checks.  Since we're finally changing the storage model
in Android R, we really to communicate strongly that apps must be
using content://, and these methods should not be used.

Bug: 156336269
Test: manual
Change-Id: Id8707ecb51f3a24747b4c84d86c70591fb5f7ffc
This commit is contained in:
Jeff Sharkey
2020-05-28 15:34:09 -06:00
parent 7912eb5ef8
commit 14e961870a

View File

@@ -1451,7 +1451,7 @@ public final class StrictMode {
*
* @hide
*/
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q, publicAlternatives = "Apps must always use {@code content://} Uris when sharing data")
public static void enableDeathOnFileUriExposure() {
sVmPolicy =
new VmPolicy(
@@ -1469,7 +1469,7 @@ public final class StrictMode {
*
* @hide
*/
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q, publicAlternatives = "Apps must always use {@code content://} Uris when sharing data")
public static void disableDeathOnFileUriExposure() {
sVmPolicy =
new VmPolicy(