Fixes bug where the indication text is not padded.
This is a fun one.
When switching to a language where the "Unlock screen for access to all
functions" indication area message (which only appears right after a
reboot) is very long, the home controls quick affordance button can overlap with the message as per the linked bug.
Normally, the padding of the indication area is controled based on the
visibility of quick affordances. If at least one quick affordance button
is visible, the KeyguardBottomAreaViewBinder pads the indication area to
fit between the buttons. If none is visible, the padding is set to 0, so
the indication area message can be as wide as possible.
There are two separate issues here:
1. The home controls quick affordance config, which provides state to
ultimately show the button does not emit an initial value. That makes
the entire downstream flow never receive a value which means that the
padding logic in the binder never runs. This CL addresses this issue
by emitting an initially Hidden value for any quick affordance known
to the quick affordance framework (as this bug can repeat itself if
the next config does not emit an initial value).
2. The home controls quick affordance config is incorrectly being shown
on the lock-screen before the first unlock after a device reboot. In
the process of refactoring the code, the new implementation missed
the need to include the ControlsComponent.getVisibility check that
the old implementation was using. In a followup CL, we will address
this too
Fix: 244296596
Test: Unit tests. Manually made sure that, with a phone switched to
Slovenian and rebooted, when the home controls button appears on the
lock-screen before unlocking it (which is a bug as explained above), the
long text is properly wrapped because the indication area is padded.
Change-Id: I6fb612edb139113594040a5d45ee8e661f0a0e5c
3 files changed