diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-05-13 13:54:30 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2015-05-13 13:54:35 -0700 |
commit | 0d838a0fad500a3c446df501d8aa7656c2c3a7a2 (patch) | |
tree | 6027ab0923e889c7ea4720a41fa5e977e1235539 | |
parent | f85ac77f0c2b923ff8d93a731d2a0107c4c57744 (diff) | |
download | frameworks_base-0d838a0fad500a3c446df501d8aa7656c2c3a7a2.zip frameworks_base-0d838a0fad500a3c446df501d8aa7656c2c3a7a2.tar.gz frameworks_base-0d838a0fad500a3c446df501d8aa7656c2c3a7a2.tar.bz2 |
Determine if we have adoptable disks.
Bug: 19993667
Change-Id: I9b21b05736c22d34ca22f5ad6e1a6ebec440cfb6
-rw-r--r-- | cmds/sm/src/com/android/commands/sm/Sm.java | 12 | ||||
-rw-r--r-- | core/java/android/os/storage/StorageManager.java | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java index 4d83610..4a8cf08 100644 --- a/cmds/sm/src/com/android/commands/sm/Sm.java +++ b/cmds/sm/src/com/android/commands/sm/Sm.java @@ -18,8 +18,10 @@ package com.android.commands.sm; import android.os.RemoteException; import android.os.ServiceManager; +import android.os.SystemProperties; import android.os.storage.DiskInfo; import android.os.storage.IMountService; +import android.os.storage.StorageManager; import android.os.storage.VolumeInfo; import android.util.Log; @@ -65,6 +67,8 @@ public final class Sm { runListDisks(); } else if ("list-volumes".equals(op)) { runListVolumes(); + } else if ("has-adoptable".equals(op)) { + runHasAdoptable(); } else if ("get-primary-storage-uuid".equals(op)) { runGetPrimaryStorageUuid(); } else if ("partition".equals(op)) { @@ -111,7 +115,12 @@ public final class Sm { } } - public void runGetPrimaryStorageUuid() throws RemoteException{ + public void runHasAdoptable() { + System.out.println(SystemProperties.getBoolean(StorageManager.PROP_HAS_ADOPTABLE, false) + || SystemProperties.getBoolean(StorageManager.PROP_FORCE_ADOPTABLE, false)); + } + + public void runGetPrimaryStorageUuid() throws RemoteException { System.out.println(mSm.getPrimaryStorageUuid()); } @@ -166,6 +175,7 @@ public final class Sm { private static int showUsage() { System.err.println("usage: sm list-disks"); 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(""); System.err.println(" sm partition DISK [public|private|mixed] [ratio]"); diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java index 3fdabee..8c0bbbf 100644 --- a/core/java/android/os/storage/StorageManager.java +++ b/core/java/android/os/storage/StorageManager.java @@ -73,6 +73,8 @@ public class StorageManager { /** {@hide} */ public static final String PROP_PRIMARY_PHYSICAL = "ro.vold.primary_physical"; /** {@hide} */ + public static final String PROP_HAS_ADOPTABLE = "vold.has_adoptable"; + /** {@hide} */ public static final String PROP_FORCE_ADOPTABLE = "persist.fw.force_adoptable"; /** {@hide} */ |