OSDN Git Service

Fix rotation button background not showing after first boot.
authorTracy Zhou <tracyzhou@google.com>
Sat, 8 Jun 2019 00:02:53 +0000 (17:02 -0700)
committerTracy Zhou <tracyzhou@google.com>
Thu, 13 Jun 2019 22:49:47 +0000 (15:49 -0700)
commit7974a7d6fb77c11c0b7b3cb17f4b2aee4c73bff1
tree52013ebc26fd2b83b122a5ab7a13f5f9a5d73562
parent7983bfb3e6a59ad2a97cc5a6a57756dcecbf8638
Fix rotation button background not showing after first boot.

KeyButtonView#setDarkIntensity() does not initialize mHasOvalBg and
mOvalBgPaint until the drawable is attached to the view, which happens
after KeyButtonView#draw() is called in the first run.

Test: Reboot, make sure background of the rotation button shows at first
run
Fixes: 134070810

Change-Id: Ib38660cde691f3d36f502023ffe082f0becd95eb
packages/SystemUI/src/com/android/systemui/statusbar/phone/FloatingRotationButton.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationContextButton.java
packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonDrawable.java
packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NavigationBarContextTest.java