diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-05-15 13:45:00 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2015-05-15 14:15:35 -0700 |
commit | 4c099d0c49c8366efd3c26854465b3ceef49b627 (patch) | |
tree | 525ec22eff76fe90e003918fe22603ea60a9905b /cmds/sm/src/com/android | |
parent | 9756d75ec28844f5ca30fda786a117c1a0ee88da (diff) | |
download | frameworks_base-4c099d0c49c8366efd3c26854465b3ceef49b627.zip frameworks_base-4c099d0c49c8366efd3c26854465b3ceef49b627.tar.gz frameworks_base-4c099d0c49c8366efd3c26854465b3ceef49b627.tar.bz2 |
Command to change force adoptable state.
Since user builds can't setprop, add an explicit "sm" verb to change
the force adoptable state.
Bug: 21191915
Change-Id: I719d9b18c1a98c97442a5ddb1cc5512e8e4d3d3f
Diffstat (limited to 'cmds/sm/src/com/android')
-rw-r--r-- | cmds/sm/src/com/android/commands/sm/Sm.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java index 4a8cf08..0dad4dc 100644 --- a/cmds/sm/src/com/android/commands/sm/Sm.java +++ b/cmds/sm/src/com/android/commands/sm/Sm.java @@ -71,6 +71,8 @@ public final class Sm { runHasAdoptable(); } else if ("get-primary-storage-uuid".equals(op)) { runGetPrimaryStorageUuid(); + } else if ("set-force-adoptable".equals(op)) { + runSetForceAdoptable(); } else if ("partition".equals(op)) { runPartition(); } else if ("mount".equals(op)) { @@ -116,14 +118,19 @@ public final class Sm { } public void runHasAdoptable() { - System.out.println(SystemProperties.getBoolean(StorageManager.PROP_HAS_ADOPTABLE, false) - || SystemProperties.getBoolean(StorageManager.PROP_FORCE_ADOPTABLE, false)); + System.out.println(SystemProperties.getBoolean(StorageManager.PROP_HAS_ADOPTABLE, false)); } public void runGetPrimaryStorageUuid() throws RemoteException { System.out.println(mSm.getPrimaryStorageUuid()); } + public void runSetForceAdoptable() throws RemoteException { + final boolean forceAdoptable = Boolean.parseBoolean(nextArg()); + mSm.setDebugFlags(forceAdoptable ? StorageManager.DEBUG_FORCE_ADOPTABLE : 0, + StorageManager.DEBUG_FORCE_ADOPTABLE); + } + public void runPartition() throws RemoteException { final String diskId = nextArg(); final String type = nextArg(); @@ -177,6 +184,7 @@ public final class Sm { System.err.println(" sm list-volumes [public|private|emulated|all]"); System.err.println(" sm has-adoptable"); System.err.println(" sm get-primary-storage-uuid"); + System.err.println(" sm set-force-adoptable [true|false]"); System.err.println(""); System.err.println(" sm partition DISK [public|private|mixed] [ratio]"); System.err.println(" sm mount VOLUME"); |