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

Commit 10ec9d8a authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Method to determine isolated storage mode.

Mostly designed for use by tests, but start using it elsewhere in OS
for consistency.

Bug: 119713234
Test: manual
Change-Id: I803671fd84547b75337bebf00c2fa2bdaf0f72e7
parent 9ba4a5ce
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -943,6 +943,10 @@ package android.os.health {

package android.os.storage {

  public class StorageManager {
    method public static boolean hasIsolatedStorage();
  }

  public final class StorageVolume implements android.os.Parcelable {
    method public java.lang.String getPath();
  }
+1 −2
Original line number Diff line number Diff line
@@ -97,8 +97,7 @@ public abstract class ContentResolver {
     *
     * @hide
     */
    public static final boolean DEPRECATE_DATA_COLUMNS = SystemProperties
            .getBoolean(StorageManager.PROP_ISOLATED_STORAGE, false);
    public static final boolean DEPRECATE_DATA_COLUMNS = StorageManager.hasIsolatedStorage();

    /**
     * Special filesystem path prefix which indicates that a path should be
+1 −1
Original line number Diff line number Diff line
@@ -2517,7 +2517,7 @@ public class PackageParser {
        // If the storage model feature flag is disabled, we need to fiddle
        // around with permission definitions to return us to pre-Q behavior.
        // STOPSHIP(b/112545973): remove once feature enabled by default
        if (!SystemProperties.getBoolean(StorageManager.PROP_ISOLATED_STORAGE, false)) {
        if (!StorageManager.hasIsolatedStorage()) {
            if ("android".equals(pkg.packageName)) {
                final ArraySet<String> newGroups = new ArraySet<>();
                newGroups.add(android.Manifest.permission_group.MEDIA_AURAL);
+7 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.SdkConstant;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.annotation.WorkerThread;
import android.app.Activity;
@@ -1533,6 +1534,12 @@ public class StorageManager {
        return SystemProperties.getBoolean(PROP_HAS_ADOPTABLE, false);
    }

    /** {@hide} */
    @TestApi
    public static boolean hasIsolatedStorage() {
        return SystemProperties.getBoolean(PROP_ISOLATED_STORAGE, false);
    }

    /**
     * @deprecated disabled now that FUSE has been replaced by sdcardfs
     * @hide
+1 −1
Original line number Diff line number Diff line
@@ -934,7 +934,7 @@ public class SystemConfig {
        // If the storage model feature flag is disabled, we need to fiddle
        // around with permission definitions to return us to pre-Q behavior.
        // STOPSHIP(b/112545973): remove once feature enabled by default
        if (!SystemProperties.getBoolean(StorageManager.PROP_ISOLATED_STORAGE, false)) {
        if (!StorageManager.hasIsolatedStorage()) {
            if (newPermissions.contains(android.Manifest.permission.READ_MEDIA_AUDIO) ||
                    newPermissions.contains(android.Manifest.permission.READ_MEDIA_VIDEO) ||
                    newPermissions.contains(android.Manifest.permission.READ_MEDIA_IMAGES)) {
Loading