From de3a068af63abc0f4173d4c4b2d8530bae6dd203 Mon Sep 17 00:00:00 2001 From: Ricky Wai Date: Tue, 3 May 2016 14:50:03 +0100 Subject: [PATCH] Do not show exception stack trace when no child profile key Bug: 28396912 Change-Id: I48e3f3223d04a0ba3dd2d975901b0504ce0dd25f --- .../core/java/com/android/server/LockSettingsService.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java index c912b11250ddc..d644bab54f72d 100644 --- a/services/core/java/com/android/server/LockSettingsService.java +++ b/services/core/java/com/android/server/LockSettingsService.java @@ -896,15 +896,13 @@ public class LockSettingsService extends ILockSettings.Stub { // get credential from keystore when managed profile has unified lock try { savedCredential = getDecryptedPasswordForTiedProfile(userId); + } catch (FileNotFoundException e) { + Slog.i(TAG, "Child profile key not found"); } catch (UnrecoverableKeyException | InvalidKeyException | KeyStoreException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException | CertificateException | IOException e) { - if (e instanceof FileNotFoundException) { - Slog.i(TAG, "Child profile key not found"); - } else { - Slog.e(TAG, "Failed to decrypt child profile key", e); - } + Slog.e(TAG, "Failed to decrypt child profile key", e); } } else { if (currentHandle == null) {