diff options
| author | 2017-06-28 13:18:33 -0400 | |
|---|---|---|
| committer | 2017-06-28 13:18:33 -0400 | |
| commit | 19d2865dd5f0155f31bc715c0f6142ea50d9e00a (patch) | |
| tree | cba17cdb512da2e4758be510e0dd015b9bf67b4c | |
| parent | e06004421781c7f6c1fb42d140536a2854ff7afc (diff) | |
NavBar: Don't reorient as much, its a waste of work
Test: runtest systemui
Change-Id: Iea9955fb48bc7f2a3da772af34109d972e11e7d7
Fixes: 62620242
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java | 17 |
1 files changed, 13 insertions, 4 deletions
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 a6cd472f2686..18dc7e2fa35b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -575,15 +575,17 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav mRotatedViews[Surface.ROTATION_270] = mRotatedViews[Surface.ROTATION_90] = findViewById(R.id.rot90); - updateCurrentView(); + mCurrentRotation = -1; + reorient(); } public boolean needsReorient(int rotation) { return mCurrentRotation != rotation; } - private void updateCurrentView() { + private boolean updateCurrentView() { final int rot = mDisplay.getRotation(); + if (rot == mCurrentRotation) return false; for (int i=0; i<4; i++) { mRotatedViews[i].setVisibility(View.GONE); } @@ -595,6 +597,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav } updateLayoutTransitionsEnabled(); mCurrentRotation = rot; + return true; } private void updateRecentsIcon() { @@ -607,10 +610,15 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav } public void reorient() { - updateCurrentView(); + if (!updateCurrentView()) { + return; + } + Log.d(TAG, "reorient", new Throwable()); mDeadZone = (DeadZone) mCurrentView.findViewById(R.id.deadzone); - ((NavigationBarFrame) getRootView()).setDeadZone(mDeadZone); + if (getRootView() instanceof NavigationBarFrame) { + ((NavigationBarFrame) getRootView()).setDeadZone(mDeadZone); + } mDeadZone.setDisplayRotation(mCurrentRotation); // force the low profile & disabled states into compliance @@ -644,6 +652,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav mVertical = newVertical; //Log.v(TAG, String.format("onSizeChanged: h=%d, w=%d, vert=%s", h, w, mVertical?"y":"n")); reorient(); + getHomeButton().setVertical(mVertical); notifyVerticalChangedListener(newVertical); } |