summaryrefslogtreecommitdiff
path: root/core/java/android/app/KeyguardManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Forward port CM Screen Security settings (1/2)Michael Bestas2022-10-261-2/+4
| | | | | | | | | | | | | | | | | | | | | * Variable size pattern lockscreen * Toggle dots/error pattern visibility Change-Id: Ie109e82c1fb2fd96b07e977e1cd76ae3acb865ff Fix pattern visibility settings (1/2) Change-Id: Ic627953c5df854c442671a98b5da539b994da18b LockPatternUtils: Use the actual user id to set pattern size Ticket: CYNGNOS-2462 Change-Id: Ia68e26ec2dfc23317135d933bc25204c1380bb02 LockSettings: fix build Change-Id: Ic65b1a2af398faffb83776ee4013d47f79ab6619 Signed-off-by: Roman Birg <roman@cyngn.com>
* Adding null check to prevent NPELouis Chang2022-04-251-2/+4
| | | | | | | | | #createConfirmDeviceCredentialIntent returns null if the device is insecure. Bug: 229950204 Test: atest StartActivityAsUserTests Change-Id: I7de3e72d0677044e282952126612fc3e072d83fd
* Update javadoc and log message to avoid confusion.Xiaowen Lei2022-03-171-3/+11
| | | | | | | | | "visibility" is sometimes used to refer to (showing && !occluded). Therefore removing the term from the doc and logging. Bug: 216630470 Test: N/A Change-Id: I03b36c99f201fbb8be382a81f2046c3fed5fce13
* Register only one binder listener and keep a map of listener to executor.Xiaowen Lei2022-03-011-17/+19
| | | | | | | | | | | This optimizes the code by keeping only one remote connection. Also fixed a typo in WindowManagerService: "StateState" -> "State". Bug: 216630470 Bug: 220379118 Test: atest CtsWindowManagerDeviceTestCases:KeyguardTests Change-Id: I8abb64f750e91db7048279f5217b63d35959c3b6
* Add role guarded APIs for subscribing to keyguard locked state in ↵Xiaowen Lei2022-02-191-11/+73
| | | | | | | | | | | | | KeyguardManager. Bug: 216630470 CTS-Coverage-Bug: 220371902 Test: manual Test: atest CtsAppTestCases:KeyguardLockedStateApiTest Ignore-AOSP-First: (for packages/Shell/AndroidManifest.xml) Permission not yet publicly announced. Change-Id: I1f44ec6799b0f74791613389ce28aadf84c9fe5c
* KeyguardManager#isDeviceSecure()Xu Cao2022-02-101-2/+2
| | | | | | | | | KeyguardManager#isDeviceSecure() shall return false when called on a virtual display Bug: 210153811 Test: atest CtsVirtualDevicesTestCases:DefaultDisplayIsDeviceSecureTest CtsVirtualDevicesTestCases:StreamedAppBehaviorTest#isDeviceSecure_shouldReturnFalseOnVirtualDisplay Change-Id: I5149b08fde8d3a09e484ea965035bd5e7d2bff7b
* Make KeyguardManager.setLock API available to SUW on non auto variants.Dmitry Dementyev2022-01-281-1/+3
| | | | | | Test: manual Bug: 214464941 Change-Id: I697065f1ca03b4f6875d2a8a6640245740357162
* Add weak escrow token APIsErin Yan2022-01-121-6/+192
| | | | | | Bug: 206485383 Test: atest LockPatternUtilsTest WeakEscrowTokenTests Change-Id: I24cdf9af6c8f29db03ef214a1a0f8effad394264
* Add set/verify lock credentials testAPIs in KeygyardManagerkholoud mohamed2021-04-061-37/+93
| | | | | | | | | | | | | | | | | | | | Added the following testAPIs that are guarded by SET_AND_VERIFY_LOCKSCREEN_CREDENTIALS and ACCESS_KEYGUARD_SECURE_STORAGE permissions: * setLock * checkLockCredentials Also refactored methods out of LockPatternUtils to LockSettingsService to allow clearing the caller identity. Test: atest com.android.server.locksettings Test: atest LockscreenCredentialTest Test: atest PasswordComplexityTest after replacing usage of adb commands with the new testAPIs Bug: 182260585 Change-Id: Idc0432773c92ada9deb3e370526cb2ce219595dc Change-Id: I28cbe6093a56a231022c61a6821accf01d28cda6
* Properly expose LockTypes constants as systemAPIskholoud mohamed2021-03-221-18/+40
| | | | | | Test: N/A Bug: 182260585 Change-Id: Iaab2608eb206cd41b906dea728f2430efe0560c6
* Move activity related operations to ActivityClientControllerRiddle Hsu2021-01-271-22/+18
| | | | | | | | | | | Including dismissKeyguard, restartActivityProcessIfVisible and invalidateHomeTaskSnapshot. Bug: 174041144 Test: ActivityTaskManagerServiceTests Change-Id: I29b4f626baa2f3d6436e84e5364284fe42e5e7d1 (cherry picked from commit 5408d9af70db95ce3cb854f213c6635dc8ffce35)
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+1
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-1/+1
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+1
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* KeyguardManager set + validate lock API refinementJulius D'souza2020-02-201-9/+15
| | | | | | | | | | | | KeyguardManager#validateLockPasswordComplexity -> KeyguardManager#isValidLockPasswordComplexity parameter changes: boolean isPin -> int locktype Bug: 149298492 Test: TreeHugger Change-Id: Icc1ab6c3a0eb4637d7e6fb34f95b8a72ced50f98 Signed-off-by: Julius D'souza <jdsouza@google.com>
* KeyguardManager: add lock set and validation methodsJulius D'souza2020-01-241-2/+155
| | | | | | | | | | The new methods are specifically for non-handset devices and are guarded by SET_INITIAL_LOCK permission. Bug: 143612363 Test: TreeHugger Change-Id: Ifbe6a1b11f4849ec0ea9515ac7b018bb446799ea Signed-off-by: Julius D'souza <jdsouza@google.com>
* Merge "Add builder method to check DevicePolicyManager"Joshua Mccloskey2019-12-191-0/+32
|\
| * Add builder method to check DevicePolicyManagerjoshmccloskey2019-12-181-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a hidden method and BiometricService will enforce that 3rd party applications cannot use it. Fixes: 142966163 Test: Verified disabling fingerprint will not allow the user to unlock work apps with fingerprint. (But can use fingeprint within apps.) Test: Verified disabling face and/or iris on a fingerprint device will continue to allow the user to unlock work apps with fingerprint. Test: Verified disabling face on a face authentication device will not allow the user to unlock work apps with face authentication. (But can use face authentication within apps.) Test: Verified disabling fingerprint and/or iris on a face authentication device will continue to allow the user to unlock work apps with face authentication. Change-Id: I21ae00d0993d78a641cb8c5d8af2dd02be0b4a21
* | Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
|/ | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
* Removing old confirm device credential logicjoshmccloskey2019-10-031-6/+0
| | | | | | | Test: Verified that confirm device credential still works in the biometricpromptdemo app Bug: 140128468 Change-Id: I28fc3c0dc16677ad953284ffa9670d7abd34cd40
* Removing @Deprecated && @removed method from KeyguardManager.Kweku Adams2019-06-171-8/+0
| | | | | | | | The method was marked @removed in Oreo. Bug: 135214188 Test: atest android.app.cts.KeyguardManagerTest Change-Id: I4fad1b7262ff8f2c40d7e3c178699e64241a9bd6
* Fix createConfirmDeviceCredentialIntent documentationKevin Chyn2019-04-261-3/+2
| | | | | | | | Test: make -j56 docs Test: checked out/target/common/docs/offline-sdk/reference/android/app/KeyguardManager.html Fixes: 131419117 Change-Id: I8c9254a591677ccf2453bff7d517a641da2b0f32
* Merge "Updates isKeyguardSecure to take in a user id."Brad Stenning2019-03-191-1/+1
|\
| * Updates isKeyguardSecure to take in a user id.Brad Stenning2019-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Updates all the callers to pass in a user id. Implementation was broken when called by a singleton component (singleUser=true) with a foreground secondary user. It would return the keyguard state of user 0, rather than the foreground user. Fixes: 123375796 Test: atest CtsActivityManagerDeviceTestCases:KeyguardLockedTests with secondary user in the foreground Change-Id: Ieb7217f5e1dddb65f8987242e675c3dff0a80aab
* | Update BiometricPrompt API namingKevin Chyn2019-03-041-1/+1
|/ | | | | | | | Fixes: 126190552 Test: make -j56 update-api Test: make -j56 Change-Id: I1c0700106e46b8dbfb825df341a8196a33f8bc83
* Rename setEnableFallback to setAllowDeviceCredentialKevin Chyn2019-02-081-1/+1
| | | | | | | | | | Also adds BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL constant Fixes: 123725101 Test: Demo app Test: CtsVerifier Biometric Test Change-Id: Ib4d25438946c0ce476de8ef416d07e3c58152da9
* Deprecate CC and add BP#buildIntent()Kevin Chyn2019-01-251-4/+15
| | | | | | | | | | | | | | | | | To ensure future BP builder changes don't require a 1:1 addition to the CC API, we're deprecating CC and moving the API to BP. Since CDC is an activity, and BP can't receive onActivityResult from CDC, we need to have BiometricService launch CDC. CDC will return auth/reject results to BiometricService using a private protected aidl method, which can then forward the reuslt to BP/app. Bug: 111461540 Test: builds Test: demo app, receives correct callbacks Change-Id: I7111ca2842534a596302fe0eb7338fbfaca72eec
* Revert "Add plumbing for setRequireConfirmation to CC"Kevin Chyn2019-01-251-32/+1
| | | | | | | | This reverts commit d75a03b722cceee137c7834117569d7e36eeac73. Reason for revert: Adding functionality differently Change-Id: I90ac64c89566589797f1ad0bf69fefee3fbd04e1
* Add plumbing for setRequireConfirmation to CCKevin Chyn2019-01-231-1/+32
| | | | | | | Bug: 111461540 Test: Builds Change-Id: I3fdb93282ceea091a459d014759ba747892f1a8c
* Add a feature flag for secure lock screen.Lenka Trochtova2019-01-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Disable certain APIs which require secure lock screen if the device doesn't have the feature. Make sure one cannot set the password/PIN if there is no secure lock screen, because the password/PIN wouldn't be really used afterwards while the password strength checks would succeed, creating a false sense of security. Allow setting password strength requirements in DPM - test if the current password is sufficient will fail automatically if there is no secure lock screen. Bug: 111072170 Bug: 111071972 Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases Test: cts-tradefed run cts -m CtsAdminTestCases Test: frameworks/base/core/tests/utiltests/runtests.sh Test: adb shell am instrument -w -e class com.android.internal.widget.LockPatternUtilsTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner Test: atest SyntheticPasswordTests Test: atest LockSettingsServiceTests Test: atest LockSettingsShellCommandTest Test: atest DevicePolicyManagerTest (for servicestests) Change-Id: Ie46b0de6cb03c26dd05c05711c5c3b5e36a872df
* KeyguardDisableHandler: make properly user awareAdrian Roos2018-11-291-20/+20
| | | | | | | | | | | | | | | | | | | | | Also fixes an issue where the disable handler was not properly updated after adding a secure lockscreen. Also fixes an issue where the disable handler was not properly updated after the device policy changes for users other than USER_SYSTEM. Also prevents adding new privileged usages of the API. Also removes a workaround that prevented Keyguard from re-engaging if it timed out while the it was disabled. The workaround is no longer necessary because the in-call UI is now using the SHOW_WHEN_LOCKED API instead of disabling the keyguard. Change-Id: Ib2644252b3806de4cb09f03991d789b83e924a11 Fixes: 119322269 Test: atest KeyguardDisableHandlerTest CtsActivityManagerDeviceTestCases:KeyguardTests
* Add privileged API to control keyguard secure notificationsZimuzo2018-11-161-0/+42
| | | | | | | | | | | | I688e87cf09ad206f4f517a7be960c2aa01af8fc4, restricted privileged apps from silently becoming Device Admins. Ia4e1ce9b81756e7f84ed0aa22d97e0b968cd8d89 added privileged APIs for locking the device and resetting the password. We continue that work by providing an alternative for DevicePolicyManager#setKeyguardDisabledFeatures guarded by android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS Bug: 111153365 Bug: 112601004 Test: Secure notifications can be redacted on keyguard Change-Id: If81cecf6e74f7abcff581a122c4b68cc04ff57c6
* Merge "docs: fixing errors found with lint check" into pi-dev am: 8c7d2142f6kopriva2018-10-091-1/+1
|\ | | | | | | | | | | am: 4d12f4c42b Change-Id: I96a6dab05b6d4ea40950fe2ddc0948adf1b4e48f
| * Merge "docs: fixing errors found with lint check" into pi-devkopriva2018-10-091-2/+1
| |\ | | | | | | | | | | | | | | | am: 8c7d2142f6 Change-Id: Ief137b64e798b4b5bb6be5e6d25a35e08037abe5
| | * docs: fixing errors found with lint checkkopriva2018-10-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers directories through /app. removed unused import in KeyguardManager.java Test: make ds-docs Bug: 117494359 Change-Id: Ie2536676ae8d3ab9349aa43dc3e3248b618dd143 Exempt-From-Owner-Approval: Docs-only change
| * | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.app.usage android.app.trust android.app.timezonedetector android.app.timezone android.app.timedetector android.app.job android.app.backup android.app.assist android.app.admin android.app This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I5d15d50344d7178617418846917f693cfabf006b Merged-In: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
* | Move some members to the "Q blacklist".Mathew Inwood2018-09-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on some analysis, these fields/methods are likely false positives. Set maxTargetSdk=P so that any apps using them are required to migrate off them in future. See the bug for more details. Exempted-From-Owner-Approval: Automatic changes to the codebase affecting only @UnsupportedAppUsage annotations, themselves added without requiring owners approval earlier. Bug: 115609023 Test: m Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
* | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.app.usage android.app.trust android.app.timezonedetector android.app.timezone android.app.timedetector android.app.job android.app.backup android.app.assist android.app.admin android.app This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
* | Moved some activities implementation to ActivityTaskManagerService (2/n)Wale Ogunwale2018-06-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Second step in unifying the window hierarchy that is currently split within AM and WM packages. We move some of the API implementation for activities from ActivityManagerService.java to ActivityTaskManagerService.java. Test: Existing tests pass Test: go/wm-smoke-auto Bug: 80414790 Change-Id: I23dcd924493d8ad1e0b6e3a55386fd72b0146605
* | Fixes in KeyguardManager doc.Frank Salim2018-02-201-5/+4
|/ | | | | | | | | | | | | | | he → the remove unused import keyboard → keyguard (It is likely that when the API was originally documented, the keyguard primarily locked interaction with a keyboard and this was not a typo. In the present, Keyguard is an established concept that primarily gates interaction with applications rather than input devices.) Test: comments and lint only Change-Id: I55d58baee02d9131f8c61e23935cd5010ff27f07
* Pass in the user defined by Context.Jeff Sharkey2018-02-031-2/+2
| | | | | | | | | | | | | | | The majority of Manager-style classes already use Context.getUserId() when making calls into the OS, so clean up the remaining callers to unify behind this strategy. This gives @SystemApi developers a nice clean interface to interact across user boundaries, instead of manually adding "AsUser" or "ForUser" method variants, which would quickly become unsustainable. Test: builds, boots Bug: 72863821 Exempt-From-Owner-Approval: trivial changes Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
* FRP: Explicitly throw UnsupportedOperation when FRP is not supportedAdrian Roos2018-01-231-7/+10
| | | | | | | | | | | | | | | | | Changes KeyguardManager.createConfirmFactoryResetCredentialIntent such that it throws UnsupportedOperationException when credential-based FRP is not available on the device (either because storage was corrupted, or the device simply does not support it). This allows GMScore to distinguish this case from when the previous owner simply didn't set up security. Also fixes a few places where we previously unintentionally crashed with an NPE. Bug: 72368658 Test: atest LockSettingsStorageTests Change-Id: I92fe1d4b06834e76a4bfffad41276ca28c68ce70
* Allow custom keyguard "prompt reason"Lucas Dupin2018-01-111-1/+34
| | | | | | | | | | | | | | Adds the possibility of presenting a custom message on the keyboard if you're trying to dismiss the keyguard. This is particularly useful when you're showing the bouncer because custom authentication (SmarLock) failed. Test: launch FLAG_SHOW_WHEN_LOCKED activity and call KeyguardManager#requestDismissKeyguard Fixes: 63940122 Change-Id: I0d88c0e59521887efa56d74874062b2b14970e4e
* Merge "Allow custom keyguard transient message"Lucas Dupin2018-01-111-1/+1
|\
| * Allow custom keyguard transient messageLucas Dupin2018-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | TrustAgentServices can now present a transient message on the lock screen or AoD. Bug: 63940122 Test: call TrustAgentService#showKeyguardErrorMessage via service, lock device, wait for message to show up. Change-Id: I222118787a1afb526ce7c90d46c41d0f20d8d912
* | FRP: Make SystemAPIAdrian Roos2017-12-151-0/+2
|/ | | | | | | | Adds the SystemAPI for the FRP credential feature. Bug: 64209214 Test: m check-api Change-Id: Iee5af94da9cf156a8b83cda60fbe6e42833482d0
* Deprecate inKeyguardRestrictedInputModeSiarhei Vishniakou2017-11-291-5/+3
| | | | | | | | | | The api inKeyguardRestrictedInputMode is no longer needed, deprecate it. Redirect output to isKeyguardLocked(). Remove inKeyguardRestrictedKeyInputMode. Test: make, flash, use system ui Bug: 65998293 Change-Id: Ie2609758fc013aab10530a1be087c983c51d86b0
* Do not send KEYCODE_VOICE_ASSIST to apps.Siarhei Vishniakou2017-10-111-2/+0
| | | | | | | | | | | | | | | | Prevent KEYCODE_VOICE_ASSIST from being sent to the apps. Move the key handling logic from interceptKeyBeforeDispatching to interceptKeyBeforeQueueing for KEYCODE_ASSIST and KEYCODE_VOICE_ASSIST. Allow the launch of assistant with KEYCODE_ASSIST Remove dead link from the docs. Test: bit CtsViewTestCases:.KeyEventInterceptTest Bug: 64776073 Change-Id: I6ab596ffb0448923d71da3fc93ccdd26de8d517f
* FRP: Add config flag for disabling credential FRPAdrian Roos2017-09-251-1/+1
| | | | | | Bug: 65258606 Test: Verify FRP still works when not disabled Change-Id: I78e308b6eaba73c794615b1eebdbfacb334ae72f
* Fix broken javadocs.Jeff Sharkey2017-08-061-1/+3
| | | | | | Bug: 64337634 Test: make -j32 doc-comment-check-docs Change-Id: I20fdd3dcddef09111d35946c41c596c7689effa6