From 9b50b76700b2b0b0271e99bf844aa005f9192568 Mon Sep 17 00:00:00 2001 From: Mike Digman Date: Thu, 19 Apr 2018 10:50:35 -0700 Subject: [PATCH] Reset sticky navbar timeout when rotate btn shown First revealing the navbar and then rotating in an immersive sticky activity makes the rotate navbar button hard to tap. Signal to the navbar to reset sticky hiding timeouts if the button becomes visible or changes. Change-Id: I381bbfd2e0192465b8358bedd213f23dde8ec982 Fixes: 78248328 Test: manual testing with custom immersive sticky activity --- .../systemui/statusbar/phone/NavigationBarFragment.java | 7 ++++++- .../systemui/statusbar/phone/NavigationBarView.java | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java index 46dee95ca912d..b2628478909c8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java @@ -546,7 +546,12 @@ public class NavigationBarFragment extends Fragment implements Callbacks { // Set visibility, may fail if a11y service is active. // If invisible, call will stop animation. - mNavigationBarView.setRotateButtonVisibility(true); + int appliedVisibility = mNavigationBarView.setRotateButtonVisibility(true); + if (appliedVisibility == View.VISIBLE) { + // If the button will actually become visible and the navbar is about to hide, + // tell the statusbar to keep it around for longer + mStatusBar.touchAutoHide(); + } } else { // Hide diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 86411acab7752..3766edb359953 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -772,13 +772,13 @@ public class NavigationBarView extends FrameLayout implements PluginListener