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

Commit d8c36b58 authored by Zimuzo Ezeozue's avatar Zimuzo Ezeozue Committed by Android (Google) Code Review
Browse files

Merge "Remove dead isolated storage code from StorageManagerService"

parents 0a76b18f 7ac598f2
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -101,8 +101,6 @@ public final class Sm {
            runFstrim();
        } else if ("set-virtual-disk".equals(op)) {
            runSetVirtualDisk();
        } else if ("set-isolated-storage".equals(op)) {
            runIsolatedStorage();
        } else if ("start-checkpoint".equals(op)) {
            runStartCheckpoint();
        } else if ("supports-checkpoint".equals(op)) {
@@ -286,28 +284,6 @@ public final class Sm {
                StorageManager.DEBUG_VIRTUAL_DISK);
    }

    public void runIsolatedStorage() throws RemoteException {
        final int value;
        final int mask = StorageManager.DEBUG_ISOLATED_STORAGE_FORCE_ON
                | StorageManager.DEBUG_ISOLATED_STORAGE_FORCE_OFF;
        switch (nextArg()) {
            case "on":
            case "true":
                value = StorageManager.DEBUG_ISOLATED_STORAGE_FORCE_ON;
                break;
            case "off":
                value = StorageManager.DEBUG_ISOLATED_STORAGE_FORCE_OFF;
                break;
            case "default":
            case "false":
                value = 0;
                break;
            default:
                return;
        }
        mSm.setDebugFlags(value, mask);
    }

    public void runIdleMaint() throws RemoteException {
        final boolean im_run = "run".equals(nextArg());
        if (im_run) {
@@ -367,8 +343,6 @@ public final class Sm {
        System.err.println("");
        System.err.println("       sm set-emulate-fbe [true|false]");
        System.err.println("");
        System.err.println("       sm set-isolated-storage [on|off|default]");
        System.err.println("");
        System.err.println("       sm start-checkpoint <num-retries>");
        System.err.println("");
        System.err.println("       sm supports-checkpoint");
+1 −2
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.UserHandle;
import android.os.storage.StorageManager;
import android.system.Int32Ref;
import android.text.TextUtils;
import android.util.EventLog;
@@ -110,7 +109,7 @@ public abstract class ContentResolver implements ContentInterface {
     *
     * @hide
     */
    public static final boolean DEPRECATE_DATA_COLUMNS = StorageManager.hasIsolatedStorage();
    public static final boolean DEPRECATE_DATA_COLUMNS = true;

    /**
     * Special filesystem path prefix which indicates that a path should be
+2 −13
Original line number Diff line number Diff line
@@ -156,10 +156,6 @@ public class StorageManager {
    /** {@hide} */
    public static final String PROP_VIRTUAL_DISK = "persist.sys.virtual_disk";
    /** {@hide} */
    public static final String PROP_ISOLATED_STORAGE = "persist.sys.isolated_storage";
    /** {@hide} */
    public static final String PROP_ISOLATED_STORAGE_SNAPSHOT = "sys.isolated_storage_snapshot";
    /** {@hide} */
    public static final String PROP_FORCED_SCOPED_STORAGE_WHITELIST =
            "forced_scoped_storage_whitelist";

@@ -263,10 +259,6 @@ public class StorageManager {
    public static final int DEBUG_SDCARDFS_FORCE_OFF = 1 << 4;
    /** {@hide} */
    public static final int DEBUG_VIRTUAL_DISK = 1 << 5;
    /** {@hide} */
    public static final int DEBUG_ISOLATED_STORAGE_FORCE_ON = 1 << 6;
    /** {@hide} */
    public static final int DEBUG_ISOLATED_STORAGE_FORCE_OFF = 1 << 7;

    /** {@hide} */
    public static final int FLAG_STORAGE_DE = IInstalld.FLAG_STORAGE_DE;
@@ -1695,16 +1687,13 @@ public class StorageManager {

    /**
     * Return if the currently booted device has the "isolated storage" feature
     * flag enabled. This will eventually be fully enabled in the final
     * {@link android.os.Build.VERSION_CODES#Q} release.
     * flag enabled.
     *
     * @hide
     */
    @SystemApi
    public static boolean hasIsolatedStorage() {
        // Prefer to use snapshot for current boot when available
        return SystemProperties.getBoolean(PROP_ISOLATED_STORAGE_SNAPSHOT,
                SystemProperties.getBoolean(PROP_ISOLATED_STORAGE, true));
        return false;
    }

    /**
+1 −43
Original line number Diff line number Diff line
@@ -28,50 +28,8 @@ import java.util.Set;
 * @hide Only for use within the system server.
 */
public abstract class StorageManagerInternal {

    /**
     * Policy that influences how external storage is mounted and reported.
     */
    public interface ExternalStorageMountPolicy {
        /**
         * Gets the external storage mount mode for the given uid.
         *
         * @param uid The UID for which to determine mount mode.
         * @param packageName The package in the UID for making the call.
         * @return The mount mode.
         *
         * @see com.android.internal.os.Zygote#MOUNT_EXTERNAL_NONE
         * @see com.android.internal.os.Zygote#MOUNT_EXTERNAL_DEFAULT
         * @see com.android.internal.os.Zygote#MOUNT_EXTERNAL_READ
         * @see com.android.internal.os.Zygote#MOUNT_EXTERNAL_WRITE
         */
        public int getMountMode(int uid, String packageName);

        /**
         * Gets whether external storage should be reported to the given UID.
         *
         * @param uid The UID for which to determine whether it has external storage.
         * @param packageName The package in the UID for making the call.
         * @return Weather to report external storage.
         * @return True to report the state of external storage, false to
         *     report it as unmounted.
         */
        public boolean hasExternalStorage(int uid, String packageName);
    }

    /**
     * Adds a policy for determining how external storage is mounted and reported.
     * The mount mode is the most conservative result from querying all registered
     * policies. Similarly, the reported state is the most conservative result from
     * querying all registered policies.
     *
     * @param policy The policy to add.
     */
    public abstract void addExternalStoragePolicy(ExternalStorageMountPolicy policy);

    /**
     * Gets the mount mode to use for a given UID as determined by consultin all
     * policies.
     * Gets the mount mode to use for a given UID
     *
     * @param uid The UID for which to get mount mode.
     * @param packageName The package in the UID for making the call.
+0 −5
Original line number Diff line number Diff line
@@ -13415,11 +13415,6 @@ public final class Settings {
        public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
                "max_sound_trigger_detection_service_ops_per_day";
        /** {@hide} */
        public static final String ISOLATED_STORAGE_LOCAL = "isolated_storage_local";
        /** {@hide} */
        public static final String ISOLATED_STORAGE_REMOTE = "isolated_storage_remote";
        /**
         * Indicates whether aware is available in the current location.
         * @hide
Loading