Merge "Fix race condition in status bar init code." into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
d939dd2eaa
@@ -252,7 +252,7 @@ public class PhoneStatusBar extends StatusBar {
|
|||||||
mWindowManager = IWindowManager.Stub.asInterface(
|
mWindowManager = IWindowManager.Stub.asInterface(
|
||||||
ServiceManager.getService(Context.WINDOW_SERVICE));
|
ServiceManager.getService(Context.WINDOW_SERVICE));
|
||||||
|
|
||||||
super.start();
|
super.start(); // calls makeStatusBarView()
|
||||||
|
|
||||||
addNavigationBar();
|
addNavigationBar();
|
||||||
|
|
||||||
@@ -270,12 +270,7 @@ public class PhoneStatusBar extends StatusBar {
|
|||||||
|
|
||||||
Resources res = context.getResources();
|
Resources res = context.getResources();
|
||||||
|
|
||||||
mDisplay.getMetrics(mDisplayMetrics);
|
updateDisplaySize(); // populates mDisplayMetrics
|
||||||
if (DEBUG) {
|
|
||||||
Slog.d(TAG, "makeStatusBarView: mDisplayMetrics=" + mDisplayMetrics);
|
|
||||||
mDisplayMetrics = res.getDisplayMetrics();
|
|
||||||
Slog.d(TAG, "makeStatusBarView: mDisplayMetrics2=" + mDisplayMetrics);
|
|
||||||
}
|
|
||||||
loadDimens();
|
loadDimens();
|
||||||
|
|
||||||
mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size);
|
mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size);
|
||||||
@@ -1793,6 +1788,11 @@ public class PhoneStatusBar extends StatusBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onBarViewAttached() {
|
void onBarViewAttached() {
|
||||||
|
// The status bar has just been attached to the view hierarchy; it's possible that the
|
||||||
|
// screen has rotated in-between when we set up the window and now, so let's double-check
|
||||||
|
// the display metrics just in case.
|
||||||
|
updateDisplaySize();
|
||||||
|
|
||||||
WindowManager.LayoutParams lp;
|
WindowManager.LayoutParams lp;
|
||||||
int pixelFormat;
|
int pixelFormat;
|
||||||
Drawable bg;
|
Drawable bg;
|
||||||
|
|||||||
Reference in New Issue
Block a user