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

Commit 2fea6afc authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Adjust hasAdoptable() based on debug flags.

When a developer has requested "sm set-force-adoptable", adjust the
return value of hasAdoptable() to reflect it.  This ensures that we
run relevant CTS tests.

Bug: 141540368
Test: none
Change-Id: I483c0df1a574021eafcd1663d41a2f4097fe986a
parent 74ccee9f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1580,8 +1580,15 @@ public class StorageManager {

    /** {@hide} */
    public static boolean hasAdoptable() {
        switch (SystemProperties.get(PROP_ADOPTABLE)) {
            case "force_on":
                return true;
            case "force_off":
                return false;
            default:
                return SystemProperties.getBoolean(PROP_HAS_ADOPTABLE, false);
        }
    }

    /**
     * Return if the currently booted device has the "isolated storage" feature