File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
packages/SystemUI/src/com/android/systemui/statusbar/phone Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ public void start() {
252252 mWindowManager = IWindowManager .Stub .asInterface (
253253 ServiceManager .getService (Context .WINDOW_SERVICE ));
254254
255- super .start ();
255+ super .start (); // calls makeStatusBarView()
256256
257257 addNavigationBar ();
258258
@@ -270,12 +270,7 @@ protected View makeStatusBarView() {
270270
271271 Resources res = context .getResources ();
272272
273- mDisplay .getMetrics (mDisplayMetrics );
274- if (DEBUG ) {
275- Slog .d (TAG , "makeStatusBarView: mDisplayMetrics=" + mDisplayMetrics );
276- mDisplayMetrics = res .getDisplayMetrics ();
277- Slog .d (TAG , "makeStatusBarView: mDisplayMetrics2=" + mDisplayMetrics );
278- }
273+ updateDisplaySize (); // populates mDisplayMetrics
279274 loadDimens ();
280275
281276 mIconSize = res .getDimensionPixelSize (com .android .internal .R .dimen .status_bar_icon_size );
@@ -1793,6 +1788,11 @@ public void run() {
17931788 }
17941789
17951790 void onBarViewAttached () {
1791+ // The status bar has just been attached to the view hierarchy; it's possible that the
1792+ // screen has rotated in-between when we set up the window and now, so let's double-check
1793+ // the display metrics just in case.
1794+ updateDisplaySize ();
1795+
17961796 WindowManager .LayoutParams lp ;
17971797 int pixelFormat ;
17981798 Drawable bg ;
You can’t perform that action at this time.
0 commit comments