Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9322002 authored by Camillus Cai's avatar Camillus Cai Committed by Android (Google) Code Review
Browse files

Merge "Clarify that FileUriExposedException is not a security boundary" into main

parents 505f7c12 372b0fec
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -19,14 +19,19 @@ package android.os;
import android.content.Intent;

/**
 * The exception that is thrown when an application exposes a {@code file://}
 * {@link android.net.Uri} to another app.
 * The exception that may be thrown when an application exposes a
 * {@code file://} {@link android.net.Uri} to another app.
 * <p>
 * This exposure is discouraged since the receiving app may not have access to
 * the shared path. For example, the receiving app may not have requested the
 * {@link android.Manifest.permission#READ_EXTERNAL_STORAGE} runtime permission,
 * or the platform may be sharing the {@link android.net.Uri} across user
 * profile boundaries.
 * This exception is a diagnostic tool for developers to identify situations
 * where {@code file://} Uris are being exposed. It is not always thrown when a
 * {@code file://} Uri is exposed, so it must not be relied on for security
 * purposes on any SDK version.
 * <p>
 * {@code file://} Uri exposure is discouraged since the receiving app may not
 * have access to the shared path. For example, the receiving app may not have
 * requested the {@link android.Manifest.permission#READ_EXTERNAL_STORAGE}
 * runtime permission, or the platform may be sharing the
 * {@link android.net.Uri} across user profile boundaries.
 * <p>
 * Instead, apps should use {@code content://} Uris so the platform can extend
 * temporary permission for the receiving app to access the resource.