diff options
author | Jeff Sharkey <jsharkey@android.com> | 2016-04-07 11:05:33 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2016-04-07 11:30:55 -0600 |
commit | 33dd156ed0ed839c5e77beb116f6f1a9566416e3 (patch) | |
tree | 422df35c64e0ee561b5495db795680e935e4a163 /cmds/sm | |
parent | 5dab713ff0c28ff264d5b26dd1a97bc37eee2d55 (diff) |
Give users and devices control over sdcardfs.
Instead of relying only on kernel support for sdcardfs, give each
device the ability to quickly toggle between sdcardfs and FUSE. Also
add the ability to users to explicitly enable/disable the behavior
for testing and debugging purposes.
Bug: 27991427
Change-Id: Ia57f12f6ead888ab85101004bdd8c8003537b116
Diffstat (limited to 'cmds/sm')
-rw-r--r-- | cmds/sm/src/com/android/commands/sm/Sm.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java index 0e674c864137..d527ad73b787 100644 --- a/cmds/sm/src/com/android/commands/sm/Sm.java +++ b/cmds/sm/src/com/android/commands/sm/Sm.java @@ -74,6 +74,8 @@ public final class Sm { runGetPrimaryStorageUuid(); } else if ("set-force-adoptable".equals(op)) { runSetForceAdoptable(); + } else if ("set-sdcardfs".equals(op)) { + runSetSdcardfs(); } else if ("partition".equals(op)) { runPartition(); } else if ("mount".equals(op)) { @@ -141,6 +143,22 @@ public final class Sm { StorageManager.DEBUG_FORCE_ADOPTABLE); } + public void runSetSdcardfs() throws RemoteException { + final int mask = StorageManager.DEBUG_SDCARDFS_FORCE_ON + | StorageManager.DEBUG_SDCARDFS_FORCE_OFF; + switch (nextArg()) { + case "on": + mSm.setDebugFlags(StorageManager.DEBUG_SDCARDFS_FORCE_ON, mask); + break; + case "off": + mSm.setDebugFlags(StorageManager.DEBUG_SDCARDFS_FORCE_OFF, mask); + break; + case "default": + mSm.setDebugFlags(0, mask); + break; + } + } + public void runSetEmulateFbe() throws RemoteException { final boolean emulateFbe = Boolean.parseBoolean(nextArg()); mSm.setDebugFlags(emulateFbe ? StorageManager.DEBUG_EMULATE_FBE : 0, |