diff options
author | Jeff Sharkey <jsharkey@android.com> | 2017-09-15 12:57:59 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2017-09-15 14:19:46 -0600 |
commit | b302c54f11d5468100c566fba8e70d8614490e1a (patch) | |
tree | a0394f6c96d2178734688c32ccab721700669fdc /cmds/sm/src | |
parent | 85786d7a3e3b6885c2efcb9eb098dd9dc4f6be02 (diff) |
Move long-running calls to async with listeners.
Now that we're using Binder, we can have callers provide explicit
listeners for every request instead of trying to squeeze them all
into unsolicited socket events.
Move benchmarking to be async to avoid blocking other commands for
up to several minutes. Remove post-trim benchmarking flag, since
benchmarking now requires a separate callback. Will bring back in
a future CL.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: adb shell sm fstrim
Bug: 62201209, 13758960
Change-Id: I26f76c66734ac2fd0f64713b8ab9828430499019
Diffstat (limited to 'cmds/sm/src')
-rw-r--r-- | cmds/sm/src/com/android/commands/sm/Sm.java | 14 |
1 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 658d662de5e1..a9a4118a8e98 100644 --- a/cmds/sm/src/com/android/commands/sm/Sm.java +++ b/cmds/sm/src/com/android/commands/sm/Sm.java @@ -16,6 +16,10 @@ package com.android.commands.sm; +import static android.os.storage.StorageManager.PROP_ADOPTABLE_FBE; +import static android.os.storage.StorageManager.PROP_HAS_ADOPTABLE; +import static android.os.storage.StorageManager.PROP_VIRTUAL_DISK; + import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; @@ -134,7 +138,15 @@ public final class Sm { } public void runHasAdoptable() { - System.out.println(SystemProperties.getBoolean(StorageManager.PROP_HAS_ADOPTABLE, false)); + final boolean hasHardware = SystemProperties.getBoolean(PROP_HAS_ADOPTABLE, false) + || SystemProperties.getBoolean(PROP_VIRTUAL_DISK, false); + final boolean hasSoftware; + if (StorageManager.isFileEncryptedNativeOnly()) { + hasSoftware = SystemProperties.getBoolean(PROP_ADOPTABLE_FBE, false); + } else { + hasSoftware = true; + } + System.out.println(hasHardware && hasSoftware); } public void runGetPrimaryStorageUuid() throws RemoteException { |