Matt Pietal bbc2b98333 Bouncer update #2
Part 2 of ???. One-handed mode and user-switcher mode will be
mututally exclusive. Encapsulate one-handed logic into a separate
static class. Add logic to decide between implementations. More
support for user-switcher will be coming next.

Bug: 206825213
Test: atest KeyguardSecurityContainerTest
KeyguardSecurityContainerControllerTest

Change-Id: Iba89b62890d6e7e3252505ae38831930484ded3b
2021-11-29 17:51:45 +00:00

2.1 KiB

Bouncer

KeyguardBouncer is the component responsible for displaying the security method set by the user (password, PIN, pattern) as well as SIM-related security methods, allowing the user to unlock the device or SIM.

Supported States

  1. Phone, portrait mode - The default and typically only way to view the bouncer. Screen cannot rotate.
  2. Phone, landscape - Can only get into this state via lockscreen activities. Launch camera, rotate to landscape, tap lock icon is one example.
  3. Foldables - Both landscape and portrait are supported. In landscape, the bouncer can appear on either of the hinge and can be dragged to the other side. Also refered to as "OneHandedMode in KeyguardSecurityContainerController
  4. Tablets - The bouncer is supplemented with user icons and a multi-user switcher, when available.

Components

The bouncer contains a hierarchy of controllers/views to render the user's security method and to manage the authentication attempts.

  1. KeyguardBouncer - Entrypoint for managing the bouncer visibility.
    1. KeyguardHostViewController - Intercepts media keys. Can most likely be merged with the next item.
      1. KeyguardSecurityContainerController - Manages unlock attempt responses, determines the correct security view layout, which may include a user switcher or enable one-handed use.
        1. KeyguardSecurityViewFlipperController - Based upon the KeyguardSecurityModel#SecurityMode, will instantiate the required view and controller. PIN, Pattern, etc.

Fun fact: Naming comes from the concept of a bouncer at a bar or nightclub, who prevent troublemakers from entering or eject them from the premises.