summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java
AgeCommit message (Collapse)Author
2022-03-15Merge SP2A.220305.013Haamed Gheibi
Bug: 220074017 Change-Id: Idfdd94e902f656ac65a2a75dfdd199f6f85ba472
2021-04-28Renamed enableOneHandedBouncer to enableDynamicKeyguardPositioning.Jamie Garside
One-handed mode is used elsewhere in Android for other stuff, so this refactoring is to disambiguate the two. Test: Tests pass Bug: 170858298 Change-Id: Ief5a0d6a32ab9c016b6e365e58e63db2ed78c198
2021-04-16Move bouncer to bottom of screen when in one handed mode.Jamie Garside
If one handed bouncer is enabled, both in the SysUI config (i.e. sw600dp-land) and in the device config, then use a different gravity for the keyguard host view. This is used to move the bouncer to the bottom of the screen when the bouncer is one handed. Of course, password entry isn't one-handed, but we don't bother checking which security mode is in use. In that mode, the password line is just on top of the keyboard anyway, so even using gravity = BOTTOM, it doesn't render differently. Bug: 170858298 Test: atest SystemUITests: com.android.keyguard.KeyguardHostViewControllerTest Change-Id: Ia24d74ca1993d667c46b8ebb8bde6ea4888a0f97
2021-04-01Open bouncer on screen side of swipe in one-handed mode.Jamie Garside
This detects where the swipe to open the bouncer comes from when the device is in left-handed mode, and moves the bouncer to that side. Currently, this is just a simple case of opening it on the screen half where the first swipe was, rather than following the finger during the swipe or anything like that. Bug: 170858298 Test: atest SystemUITests Change-Id: I4b18cee7d56fedf792a1923e316778bda077e75f
2021-03-24Ensure bouncer in correct position on swipe. Remove orientationlistener.Jamie Garside
This adds a hook to onLayout to move the bouncer to the correct screen side on large format devices. KeyguardBouncer already calls updateLayoutForSecurityMode() when the security mode is created, but this can happen before the bouncer has actually been attached to the screen (hence width = 0, so the bouncer gets left-aligned). It's also done in onResume(), but this is only called when the bouncer is at the correct place after swipe (hence causing the "jump" when swiping up). Also, removes orientationlistener from KeyguardBouncer, and replaces it with a proxied "updateResources" call. I messed up; I thought that orientationlistener worked like deviceorientationlistener, which notifies on screen rotation. Instead, it notifies on _every_ angle change, which would have led to a lot of layout passes as it'd update the bouncer gravity whenever the device moved. Oops. Test: atest SystemUITests: com.android.keyguard.KeyguardSecurityContainerControllerTest Bug: 177303121 Change-Id: I6d68e553c3114e043bcc126ba7b6910f98ce6694
2021-03-12Make KeyguardBouncer react to device config changes.Jamie Garside
Test: Existing tests updated (atest SystemUITests). Bug: 181127471 Change-Id: I5d03bf807d420e0f976632fb7b916197488c6667
2020-12-30Password bouncer - Go back on first gestureMatt Pietal
When using the bouncer with password security, it currently takes 2 swipes to go back: 1 to dimiss the IME, the 2nd to exit the bouncer. For this case, intercept the back key event and immediately close bouncer. Fixes: 174020768 Test: manual Change-Id: I85a650bb4a28d4209dc84461e69fb80824228a39
2020-10-23Change ViewController#initInternal to #onInitDave Mankoff
Bug: 171472009 Test: manual Change-Id: Iddc6c0240486b0d3005216bba0c40bfb481b94b3
2020-10-22Add initInternal to ViewController.Dave Mankoff
ViewController's init method was not ideal to override. On the one hand, if you put a call super.init() first your onViewAttach method is called before you're subclass's init. Further, if you put your own code befer super.init(), you are still left with the problem that your init is not automatically idempotent, and multiple calls to #init() could result in multiple executions of your code unless you handle it yourself. With this change, #initInternal() is introduced, giving ViewControllers a place to put their run-once code such that it runs before any view-attachment callbacks are fired. Fixes: 171472009 Test: manual Change-Id: I2e284024c82e3f7c7b6f29f22a1ffa3c8aae9fcb
2020-09-2410/N Ensure KeyguardSecurityContainer always has CallbackDave Mankoff
This passes the SecurityCallback directly into the KeyguardSecurityContainer's constructor, rather than setting it during on-attach. Fixes: 169231892 Test: atest SystemUITests && manual Change-Id: Ia9adf399e299768b3b8a70822cfda662a54d803b
2020-09-24Revert^2 "7/N controllers for remaining Keyguard Password ..."Dave Mankoff
Revert submission 12656261-revert-12585643-b166448040-keyguard-message-area-NUUJOVRYJS This also fixes the original issue introduced in this CL. KeyguardAbsKeyInputViewController#reset would call mView#resetState instead of its own internal resetState method. However, all the logic from the various resetState methods had been moved from the views to their controllers. Simply calling resetState direclty resolves the issue (line 105 of KeyguardAbsKeyInputViewController). Reason for revert: Fixing http://b/169231892 and http://b/169145796 Reverted Changes: I7683b2234:Revert "4/N Setup Controller fo KeyguardSecurityCo... I5cbe04c0c:Revert "5/N Add KeyguardSecurityViewFlipperControl... I11dff38ad:Revert "6/N Add Controller for KeyguardPatternView... I55c250121:Revert "7/N controllers for remaining Keyguard Pas... Ie84234cb8:Revert "8/N Remove View Injection from KeyguardMes... Ic62f199a5:Revert "9/N Clean Up Keyguard Class Structure" Change-Id: Ie3669e0c9a23ffd4443ced0fb08ec754f1df55db Fixes: 169145796
2020-09-24Revert^2 "5/N Add KeyguardSecurityViewFlipperController."Dave Mankoff
612c5d78c418ff33b36a19a7911e4279a26bcf9b Change-Id: Ic51f3c2dd7d49832927393df9831d956bfa45763
2020-09-24Revert^2 "4/N Setup Controller fo KeyguardSecurityContainer."Dave Mankoff
0d6a9012a73a2d999d52aaefca0a6ad52322db31 Change-Id: I881bbcdc63fcbafa8966064cccb7ce1edc710062
2020-09-22Revert "4/N Setup Controller fo KeyguardSecurityContainer."Dave Mankoff
Revert submission 12585643-b166448040-keyguard-message-area Reason for revert: http://b/169081305 & http://b/169020145 Reverted Changes: I6fa05012c:4/N Setup Controller fo KeyguardSecurityContainer.... Iecf265744:5/N Add KeyguardSecurityViewFlipperController. I90ab99b2f:6/N Add Controller for KeyguardPatternView I4b74eddd1:7/N controllers for remaining Keyguard Password Vi... I805286374:8/N Remove View Injection from KeyguardMessageArea... I362755980:9/N Clean Up Keyguard Class Structure Change-Id: I7683b2234b601032ee606fbaabd474c5e2f6e989 Fixes: 169081305 Fixes: 169020145
2020-09-22Revert "5/N Add KeyguardSecurityViewFlipperController."Dave Mankoff
Revert submission 12585643-b166448040-keyguard-message-area Reason for revert: http://b/169081305 & http://b/169020145 Reverted Changes: I6fa05012c:4/N Setup Controller fo KeyguardSecurityContainer.... Iecf265744:5/N Add KeyguardSecurityViewFlipperController. I90ab99b2f:6/N Add Controller for KeyguardPatternView I4b74eddd1:7/N controllers for remaining Keyguard Password Vi... I805286374:8/N Remove View Injection from KeyguardMessageArea... I362755980:9/N Clean Up Keyguard Class Structure Change-Id: I5cbe04c0cfb1c081fbf2e9958cb22dca3e4d80ad Fixes: 169081305 Fixes: 169020145
2020-09-22Revert "7/N controllers for remaining Keyguard Password Views."Dave Mankoff
Revert submission 12585643-b166448040-keyguard-message-area Reason for revert: http://b/169081305 & http://b/169020145 Reverted Changes: I6fa05012c:4/N Setup Controller fo KeyguardSecurityContainer.... Iecf265744:5/N Add KeyguardSecurityViewFlipperController. I90ab99b2f:6/N Add Controller for KeyguardPatternView I4b74eddd1:7/N controllers for remaining Keyguard Password Vi... I805286374:8/N Remove View Injection from KeyguardMessageArea... I362755980:9/N Clean Up Keyguard Class Structure Change-Id: I55c250121c2e234a41b30f2d647c44f6cb631028 Fixes: 169081305 Fixes: 169020145
2020-09-167/N controllers for remaining Keyguard Password Views.Dave Mankoff
No real functionality changes (hopefully). Just moving objects into controllers. Test: manual Bug: 166448040 Change-Id: I4b74eddd18d29dd8966caa32c5960ff8be2e6f43
2020-09-165/N Add KeyguardSecurityViewFlipperController.Dave Mankoff
Adds a Controller for KeyguardSecurityViewFlipper. Test: atest SystemUITests && manual Change-Id: Iecf265744a385efb7a9ab32a29b90c22054a4c84
2020-09-164/N Setup Controller fo KeyguardSecurityContainer.Dave Mankoff
Move the guts of KeyguardSecurityContainer into KeyguardSecurityContainerController. This removes a lot of Dependency#get calls, and is another step towards simplifying our view inflation process. CustomViews that previously implemented KeyguardSecurityView now all extend KeyguardInputView, allowing them to be simultaneously treated as one while also being recognized as a View (the interface required a lot of casting back and forth to a View). LockscreenUtil is made a Singleton in this CL. Bug: 166448040 Test: atest SystemUITests && manual Change-Id: I6fa05012c55f5e003ab551d2f8360891a62fa2a7
2020-09-083/N Use KeyguardSecurityContainerController in KHVC.Dave Mankoff
Use the KeyguardSecurityContainerController in the KeyguardHostViewController instead of the view directly. This actually cleans up KeyguardHostView quite a bit, with all lot of its business logic moved over to its view. The KeyguardSecurityContainerController doesn't do much except to proxy through calls to its view for now. Bug: 166448040 Test: atest SystemUITests && manual Change-Id: I96a27b673c4579983bb07b7fb7ef321a022f0f65
2020-09-082/N Use KeyguardHostViewController in KeyguardBouncer.Dave Mankoff
This mostly proxies existing calls through to the view. A few exceptions were made where it was obvious what to change. Also, make ViewController take a View type to streamling initialization a bit more. Bug: 166448040 Test: atest SystemUITests && manual. Change-Id: If849ff57c4b8462e07cc9a4b0546fe7d2a6a0c0a
2020-09-081/N Add Controllers for most KeyguardBouncer related views.Dave Mankoff
This adds Controllers to most of the KeyguardBouncer related views, though it does not move much (or any) functionality into them. This is the first step of a few to get View Injection out of the KeyguardMessageArea. The CL was growing large, and I wanted to find a good check-in point before continuing. I also added a "ViewController" utility class in this CL that simplifies some of the repetetive work I've been finding myself writing when implementing other Controllers. It is intentionally left simple, existing only to hook into view lifecycle events. More work to follow. Bug: 166448040 Test: manual && atest SystemUITests Change-Id: Ie59f62e97d979fb753e4a103d37ceca02e327238