From 14e961870a18f2fda768906fb14d900df2036346 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 28 May 2020 15:34:09 -0600 Subject: [PATCH] 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 --- core/java/android/os/StrictMode.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java index 02b822a99f2ad..57561af0e2f83 100644 --- a/core/java/android/os/StrictMode.java +++ b/core/java/android/os/StrictMode.java @@ -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(