From 5a785168975f43a4c6b848342d4439ed1689b2fa Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 21 Mar 2016 13:02:06 -0600 Subject: [PATCH] Check "Secure start-up" before toggling emulation. To fully emulate FBE we need to avoid the Cryptkeeper bounce, so check to make sure user has disabled "Secure start-up" so vold can unlock early during boot. Bug: 27595501 Change-Id: Ic0d03f94982534381671e1039f14d1fd06bc0e4e --- services/core/java/com/android/server/MountService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index 65a22b9a29e94..ccca5baa798a3 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -1946,6 +1946,10 @@ class MountService extends IMountService.Stub throw new IllegalStateException( "Emulation not available on device with native FBE"); } + if (mLockPatternUtils.isCredentialRequiredToDecrypt(false)) { + throw new IllegalStateException( + "Emulation requires disabling 'Secure start-up' in Settings > Security"); + } final long token = Binder.clearCallingIdentity(); try {