From b5e89c6debca90be92bf5bc2e0e79d109de6d08f Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 1 Apr 2016 23:20:31 -0600 Subject: Support direct-boot tests. Add shell commands to check on current FBE status and system ready status. Mark variables without first-class locking as volatile. Fix bug where UI automation would crash while device was locked by marking it as forced direct-boot aware. Bug: 26498834 Change-Id: Ib4dfb9350925e5413f93a09baacf84c62f2ba0ea --- cmds/sm/src/com/android/commands/sm/Sm.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cmds/sm/src') diff --git a/cmds/sm/src/com/android/commands/sm/Sm.java b/cmds/sm/src/com/android/commands/sm/Sm.java index b208e438f171..0e674c864137 100644 --- a/cmds/sm/src/com/android/commands/sm/Sm.java +++ b/cmds/sm/src/com/android/commands/sm/Sm.java @@ -88,6 +88,8 @@ public final class Sm { runForget(); } else if ("set-emulate-fbe".equals(op)) { runSetEmulateFbe(); + } else if ("get-fbe-mode".equals(op)) { + runGetFbeMode(); } else { throw new IllegalArgumentException(); } @@ -145,6 +147,16 @@ public final class Sm { StorageManager.DEBUG_EMULATE_FBE); } + public void runGetFbeMode() { + if (StorageManager.isFileEncryptedNativeOnly()) { + System.out.println("native"); + } else if (StorageManager.isFileEncryptedEmulatedOnly()) { + System.out.println("emulated"); + } else { + System.out.println("none"); + } + } + public void runPartition() throws RemoteException { final String diskId = nextArg(); final String type = nextArg(); -- cgit v1.2.3-59-g8ed1b