Loading core/java/android/content/Intent.java +26 −1 Original line number Diff line number Diff line Loading @@ -6761,6 +6761,12 @@ public class Intent implements Parcelable, Cloneable { * #putExtras(Bundle)} when the provided Bundle has not been unparceled. */ private static final int LOCAL_FLAG_UNFILTERED_EXTRAS = 1 << 3; /** * Local flag indicating this instance was created from a {@link Uri}. */ private static final int LOCAL_FLAG_FROM_URI = 1 << 4; // --------------------------------------------------------------------- // --------------------------------------------------------------------- // toUri() and parseUri() options. Loading Loading @@ -7173,6 +7179,16 @@ public class Intent implements Parcelable, Cloneable { * @see #toUri */ public static Intent parseUri(String uri, @UriFlags int flags) throws URISyntaxException { Intent intent = parseUriInternal(uri, flags); intent.mLocalFlags |= LOCAL_FLAG_FROM_URI; return intent; } /** * @see #parseUri(String, int) */ private static Intent parseUriInternal(String uri, @UriFlags int flags) throws URISyntaxException { int i = 0; try { final boolean androidApp = uri.startsWith("android-app:"); Loading Loading @@ -7392,7 +7408,9 @@ public class Intent implements Parcelable, Cloneable { } public static Intent getIntentOld(String uri) throws URISyntaxException { return getIntentOld(uri, 0); Intent intent = getIntentOld(uri, 0); intent.mLocalFlags |= LOCAL_FLAG_FROM_URI; return intent; } private static Intent getIntentOld(String uri, int flags) throws URISyntaxException { Loading Loading @@ -11353,6 +11371,13 @@ public class Intent implements Parcelable, Cloneable { StrictMode.onUnsafeIntentLaunch(this); } else if ((mLocalFlags & LOCAL_FLAG_UNFILTERED_EXTRAS) != 0) { StrictMode.onUnsafeIntentLaunch(this); } else if ((mLocalFlags & LOCAL_FLAG_FROM_URI) != 0 && !(mCategories != null && mCategories.contains(CATEGORY_BROWSABLE) && mComponent == null)) { // Since the docs for #URI_ALLOW_UNSAFE recommend setting the category to browsable // for an implicit Intent parsed from a URI a violation should be reported if these // conditions are not met. StrictMode.onUnsafeIntentLaunch(this); } } } Loading Loading
core/java/android/content/Intent.java +26 −1 Original line number Diff line number Diff line Loading @@ -6761,6 +6761,12 @@ public class Intent implements Parcelable, Cloneable { * #putExtras(Bundle)} when the provided Bundle has not been unparceled. */ private static final int LOCAL_FLAG_UNFILTERED_EXTRAS = 1 << 3; /** * Local flag indicating this instance was created from a {@link Uri}. */ private static final int LOCAL_FLAG_FROM_URI = 1 << 4; // --------------------------------------------------------------------- // --------------------------------------------------------------------- // toUri() and parseUri() options. Loading Loading @@ -7173,6 +7179,16 @@ public class Intent implements Parcelable, Cloneable { * @see #toUri */ public static Intent parseUri(String uri, @UriFlags int flags) throws URISyntaxException { Intent intent = parseUriInternal(uri, flags); intent.mLocalFlags |= LOCAL_FLAG_FROM_URI; return intent; } /** * @see #parseUri(String, int) */ private static Intent parseUriInternal(String uri, @UriFlags int flags) throws URISyntaxException { int i = 0; try { final boolean androidApp = uri.startsWith("android-app:"); Loading Loading @@ -7392,7 +7408,9 @@ public class Intent implements Parcelable, Cloneable { } public static Intent getIntentOld(String uri) throws URISyntaxException { return getIntentOld(uri, 0); Intent intent = getIntentOld(uri, 0); intent.mLocalFlags |= LOCAL_FLAG_FROM_URI; return intent; } private static Intent getIntentOld(String uri, int flags) throws URISyntaxException { Loading Loading @@ -11353,6 +11371,13 @@ public class Intent implements Parcelable, Cloneable { StrictMode.onUnsafeIntentLaunch(this); } else if ((mLocalFlags & LOCAL_FLAG_UNFILTERED_EXTRAS) != 0) { StrictMode.onUnsafeIntentLaunch(this); } else if ((mLocalFlags & LOCAL_FLAG_FROM_URI) != 0 && !(mCategories != null && mCategories.contains(CATEGORY_BROWSABLE) && mComponent == null)) { // Since the docs for #URI_ALLOW_UNSAFE recommend setting the category to browsable // for an implicit Intent parsed from a URI a violation should be reported if these // conditions are not met. StrictMode.onUnsafeIntentLaunch(this); } } } Loading