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

Commit ac3be9a2 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

File paths to system partition are okay-ish.

Unless SELinux blocks it, all apps have identical access to files
included on the system partition.  Since there are a handful of
useful files stored there, like ringtones and license files, carve
out an exception to allow file:///system/ style paths.

Note that StrictMode isn't a security mechanism, which is why we're
not concerned about resolving canonical paths.

Bug: 26895798
Change-Id: If0b659d30c4e51377edcf01445392759d1e4962e
parent 493e4a35
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -231,12 +231,7 @@ public class NotificationManager
        if (notification.sound != null) {
            notification.sound = notification.sound.getCanonicalUri();
            if (StrictMode.vmFileUriExposureEnabled()) {
                //notification.sound.checkFileUriExposed("Notification.sound");
                if ("file".equals(notification.sound.getScheme())) {
                    Log.w(TAG, "notify: warning: file:// Uri exposed through Notification.sound: "
                                + notification.sound,
                        new Throwable());
                }
                notification.sound.checkFileUriExposed("Notification.sound");
            }
        }
        fixLegacySmallIcon(notification, pkg);
+1 −1
Original line number Diff line number Diff line
@@ -2342,7 +2342,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
     * @hide
     */
    public void checkFileUriExposed(String location) {
        if ("file".equals(getScheme())) {
        if ("file".equals(getScheme()) && !getPath().startsWith("/system/")) {
            StrictMode.onFileUriExposed(this, location);
        }
    }