diff options
author | Svetoslav <svetoslavganov@google.com> | 2014-10-01 17:10:00 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-01 17:10:00 +0000 |
commit | 047ab3b2e583dcaacb6b67fd0569bfa3ecb477c2 (patch) | |
tree | 36633e08a10fe1678ea218f6ac4faf06862f09e9 /core | |
parent | 551db03c6a700c2f7a269f77a2b688f3e5de8eaf (diff) | |
parent | cf0a337352a228302d44f9582673c7acdba329ca (diff) | |
download | frameworks_base-047ab3b2e583dcaacb6b67fd0569bfa3ecb477c2.zip frameworks_base-047ab3b2e583dcaacb6b67fd0569bfa3ecb477c2.tar.gz frameworks_base-047ab3b2e583dcaacb6b67fd0569bfa3ecb477c2.tar.bz2 |
am cf0a3373: am 344ffbc6: am 567c9788: am 44d4eeaa: Merge "Use default encryption password if an accessibility service is enabled." into lmp-dev
* commit 'cf0a337352a228302d44f9582673c7acdba329ca':
Use default encryption password if an accessibility service is enabled.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/AccessibilityManagerInternal.java | 31 | ||||
-rw-r--r-- | core/java/com/android/internal/widget/LockPatternUtils.java | 24 |
2 files changed, 55 insertions, 0 deletions
diff --git a/core/java/android/view/AccessibilityManagerInternal.java b/core/java/android/view/AccessibilityManagerInternal.java new file mode 100644 index 0000000..7bb2dc5 --- /dev/null +++ b/core/java/android/view/AccessibilityManagerInternal.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.view; + +/** + * Accessibility manager local system service interface. + * + * @hide Only for use within the system server. + */ +public abstract class AccessibilityManagerInternal { + + /** + * Queries if the accessibility manager service permits setting + * a non-default encryption password. + */ + public abstract boolean isNonDefaultEncryptionPasswordAllowed(); +} diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 16fa88e..2b7af4b 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -878,6 +878,30 @@ public class LockPatternUtils { } /** + * Gets whether the device is encrypted. + * + * @return Whether the device is encrypted. + */ + public static boolean isDeviceEncrypted() { + IMountService mountService = IMountService.Stub.asInterface( + ServiceManager.getService("mount")); + try { + return mountService.getEncryptionState() != IMountService.ENCRYPTION_STATE_NONE + && mountService.getPasswordType() != StorageManager.CRYPT_TYPE_DEFAULT; + } catch (RemoteException re) { + Log.e(TAG, "Error getting encryption state", re); + } + return true; + } + + /** + * Clears the encryption password. + */ + public void clearEncryptionPassword() { + updateEncryptionPassword(StorageManager.CRYPT_TYPE_DEFAULT, null); + } + + /** * Retrieves the quality mode we're in. * {@see DevicePolicyManager#getPasswordQuality(android.content.ComponentName)} * |