am 11accf51: Merge "Make sure starting windows only draw once" into mnc-dev

* commit '11accf51c2e5b3e4fcfc3d61e9b8a46c1ce0284a':
  Make sure starting windows only draw once
This commit is contained in:
Jorim Jaggi
2015-06-02 22:39:45 +00:00
committed by Android Git Automerger
2 changed files with 9 additions and 2 deletions

View File

@@ -289,6 +289,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
private Rect mTempRect;
private Rect mOutsets = new Rect();
private boolean mIsStartingWindow;
static class WindowManagerHolder {
static final IWindowManager sWindowManager = IWindowManager.Stub.asInterface(
ServiceManager.getService("window"));
@@ -3891,7 +3893,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
// A pending invalidation will typically be resolved before the posted message
// would run normally in order to satisfy instance state restoration.
PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, false);
if (!isDestroyed() && (st == null || st.menu == null)) {
if (!isDestroyed() && (st == null || st.menu == null) && !mIsStartingWindow) {
invalidatePanelMenu(FEATURE_ACTION_BAR);
}
} else {
@@ -4966,4 +4968,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
mDecor.updateColorViews(null, false /* animate */);
}
}
public void setIsStartingWindow(boolean isStartingWindow) {
mIsStartingWindow = isStartingWindow;
}
}

View File

@@ -2154,7 +2154,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
Window win = new PhoneWindow(context);
PhoneWindow win = new PhoneWindow(context);
win.setIsStartingWindow(true);
final TypedArray ta = win.getWindowStyle();
if (ta.getBoolean(
com.android.internal.R.styleable.Window_windowDisablePreview, false)