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
This commit is contained in:
Jeff Sharkey
2019-10-01 14:09:18 -06:00
parent 74ccee9f23
commit 2fea6afc91

View File

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