Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +4 −4 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ import java.io.PrintWriter; public class NavigationBarView extends LinearLayout { final static boolean DEBUG = false; final static String TAG = "PhoneStatusBar/NavigationBarView"; final static String TAG = "StatusBar/NavBarView"; // slippery nav bar when everything is disabled, e.g. during setup final static boolean SLIPPERY_WHEN_DISABLED = true; Loading Loading @@ -527,8 +527,8 @@ public class NavigationBarView extends LinearLayout { updateCurrentView(); } public boolean needsReorient() { return mCurrentRotation != mDisplay.getRotation(); public boolean needsReorient(int rotation) { return mCurrentRotation != rotation; } private void updateCurrentView() { Loading Loading @@ -567,7 +567,7 @@ public class NavigationBarView extends LinearLayout { setMenuVisibility(mShowMenu, true /* force */); if (DEBUG) { Log.d(TAG, "reorient(): rot=" + mDisplay.getRotation()); Log.d(TAG, "reorient(): rot=" + mCurrentRotation); } updateTaskSwitchHelper(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +23 −20 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.hardware.display.DisplayManager; import android.inputmethodservice.InputMethodService; import android.media.AudioAttributes; import android.media.MediaMetadata; Loading Loading @@ -100,6 +99,7 @@ import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; import android.view.Display; import android.view.IRotationWatcher; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; Loading Loading @@ -207,7 +207,7 @@ import java.util.Map; public class PhoneStatusBar extends BaseStatusBar implements DemoMode, DragDownHelper.DragDownCallback, ActivityStarter, OnUnlockMethodChangedListener, HeadsUpManager.OnHeadsUpChangedListener, DisplayManager.DisplayListener { HeadsUpManager.OnHeadsUpChangedListener { static final String TAG = "PhoneStatusBar"; public static final boolean DEBUG = BaseStatusBar.DEBUG; public static final boolean SPEW = false; Loading Loading @@ -693,8 +693,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mUnlockMethodCache.addListener(this); startKeyguard(); mContext.getSystemService(DisplayManager.class).registerDisplayListener(this, null); mDozeServiceHost = new DozeServiceHost(); KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mDozeServiceHost); putComponent(DozeHost.class, mDozeServiceHost); Loading Loading @@ -1411,6 +1409,27 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (DEBUG) Log.v(TAG, "addNavigationBar: about to add " + mNavigationBarView); if (mNavigationBarView == null) return; try { WindowManagerGlobal.getWindowManagerService() .watchRotation(new IRotationWatcher.Stub() { @Override public void onRotationChanged(int rotation) throws RemoteException { // We need this to be scheduled as early as possible to beat the redrawing of // window in response to the orientation change. Message msg = Message.obtain(mHandler, () -> { if (mNavigationBarView != null && mNavigationBarView.needsReorient(rotation)) { repositionNavigationBar(); } }); msg.setAsynchronous(true); mHandler.sendMessageAtFrontOfQueue(msg); } }); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } prepareNavigationBarView(); mWindowManager.addView(mNavigationBarView, getNavigationBarLayoutParams()); Loading Loading @@ -3586,22 +3605,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNetworkController.onConfigurationChanged(); } @Override public void onDisplayAdded(int displayId) { } @Override public void onDisplayRemoved(int displayId) { } @Override public void onDisplayChanged(int displayId) { if (displayId == Display.DEFAULT_DISPLAY && mNavigationBarView != null && mNavigationBarView.needsReorient()) { repositionNavigationBar(); } } @Override public void userSwitched(int newUserId) { super.userSwitched(newUserId); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +4 −4 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ import java.io.PrintWriter; public class NavigationBarView extends LinearLayout { final static boolean DEBUG = false; final static String TAG = "PhoneStatusBar/NavigationBarView"; final static String TAG = "StatusBar/NavBarView"; // slippery nav bar when everything is disabled, e.g. during setup final static boolean SLIPPERY_WHEN_DISABLED = true; Loading Loading @@ -527,8 +527,8 @@ public class NavigationBarView extends LinearLayout { updateCurrentView(); } public boolean needsReorient() { return mCurrentRotation != mDisplay.getRotation(); public boolean needsReorient(int rotation) { return mCurrentRotation != rotation; } private void updateCurrentView() { Loading Loading @@ -567,7 +567,7 @@ public class NavigationBarView extends LinearLayout { setMenuVisibility(mShowMenu, true /* force */); if (DEBUG) { Log.d(TAG, "reorient(): rot=" + mDisplay.getRotation()); Log.d(TAG, "reorient(): rot=" + mCurrentRotation); } updateTaskSwitchHelper(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +23 −20 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.hardware.display.DisplayManager; import android.inputmethodservice.InputMethodService; import android.media.AudioAttributes; import android.media.MediaMetadata; Loading Loading @@ -100,6 +99,7 @@ import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; import android.view.Display; import android.view.IRotationWatcher; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; Loading Loading @@ -207,7 +207,7 @@ import java.util.Map; public class PhoneStatusBar extends BaseStatusBar implements DemoMode, DragDownHelper.DragDownCallback, ActivityStarter, OnUnlockMethodChangedListener, HeadsUpManager.OnHeadsUpChangedListener, DisplayManager.DisplayListener { HeadsUpManager.OnHeadsUpChangedListener { static final String TAG = "PhoneStatusBar"; public static final boolean DEBUG = BaseStatusBar.DEBUG; public static final boolean SPEW = false; Loading Loading @@ -693,8 +693,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mUnlockMethodCache.addListener(this); startKeyguard(); mContext.getSystemService(DisplayManager.class).registerDisplayListener(this, null); mDozeServiceHost = new DozeServiceHost(); KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mDozeServiceHost); putComponent(DozeHost.class, mDozeServiceHost); Loading Loading @@ -1411,6 +1409,27 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (DEBUG) Log.v(TAG, "addNavigationBar: about to add " + mNavigationBarView); if (mNavigationBarView == null) return; try { WindowManagerGlobal.getWindowManagerService() .watchRotation(new IRotationWatcher.Stub() { @Override public void onRotationChanged(int rotation) throws RemoteException { // We need this to be scheduled as early as possible to beat the redrawing of // window in response to the orientation change. Message msg = Message.obtain(mHandler, () -> { if (mNavigationBarView != null && mNavigationBarView.needsReorient(rotation)) { repositionNavigationBar(); } }); msg.setAsynchronous(true); mHandler.sendMessageAtFrontOfQueue(msg); } }); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } prepareNavigationBarView(); mWindowManager.addView(mNavigationBarView, getNavigationBarLayoutParams()); Loading Loading @@ -3586,22 +3605,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNetworkController.onConfigurationChanged(); } @Override public void onDisplayAdded(int displayId) { } @Override public void onDisplayRemoved(int displayId) { } @Override public void onDisplayChanged(int displayId) { if (displayId == Display.DEFAULT_DISPLAY && mNavigationBarView != null && mNavigationBarView.needsReorient()) { repositionNavigationBar(); } } @Override public void userSwitched(int newUserId) { super.userSwitched(newUserId); Loading