Merge "Fix issue #5309443: Ninjump crashes on boot with..."
This commit is contained in:
committed by
Android (Google) Code Review
commit
b3db5b73a6
@@ -164,11 +164,14 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
|
|
||||||
final W mWindow;
|
final W mWindow;
|
||||||
|
|
||||||
|
final int mTargetSdkVersion;
|
||||||
|
|
||||||
View mView;
|
View mView;
|
||||||
View mFocusedView;
|
View mFocusedView;
|
||||||
View mRealFocusedView; // this is not set to null in touch mode
|
View mRealFocusedView; // this is not set to null in touch mode
|
||||||
int mViewVisibility;
|
int mViewVisibility;
|
||||||
boolean mAppVisible = true;
|
boolean mAppVisible = true;
|
||||||
|
int mOrigWindowType = -1;
|
||||||
|
|
||||||
// Set to true if the owner of this window is in the stopped state,
|
// Set to true if the owner of this window is in the stopped state,
|
||||||
// so the window should no longer be active.
|
// so the window should no longer be active.
|
||||||
@@ -331,6 +334,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
mVisRect = new Rect();
|
mVisRect = new Rect();
|
||||||
mWinFrame = new Rect();
|
mWinFrame = new Rect();
|
||||||
mWindow = new W(this);
|
mWindow = new W(this);
|
||||||
|
mTargetSdkVersion = context.getApplicationInfo().targetSdkVersion;
|
||||||
mInputMethodCallback = new InputMethodCallback(this);
|
mInputMethodCallback = new InputMethodCallback(this);
|
||||||
mViewVisibility = View.GONE;
|
mViewVisibility = View.GONE;
|
||||||
mTransparentRegion = new Region();
|
mTransparentRegion = new Region();
|
||||||
@@ -461,6 +465,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
mInputChannel = new InputChannel();
|
mInputChannel = new InputChannel();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
mOrigWindowType = mWindowAttributes.type;
|
||||||
res = sWindowSession.add(mWindow, mWindowAttributes,
|
res = sWindowSession.add(mWindow, mWindowAttributes,
|
||||||
getHostVisibility(), mAttachInfo.mContentInsets,
|
getHostVisibility(), mAttachInfo.mContentInsets,
|
||||||
mInputChannel);
|
mInputChannel);
|
||||||
@@ -3481,6 +3486,14 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
}
|
}
|
||||||
mPendingConfiguration.seq = 0;
|
mPendingConfiguration.seq = 0;
|
||||||
//Log.d(TAG, ">>>>>> CALLING relayout");
|
//Log.d(TAG, ">>>>>> CALLING relayout");
|
||||||
|
if (params != null && mOrigWindowType != params.type) {
|
||||||
|
// For compatibility with old apps, don't crash here.
|
||||||
|
if (mTargetSdkVersion < android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
||||||
|
Slog.w(TAG, "Window type can not be changed after "
|
||||||
|
+ "the window is added; ignoring change of " + mView);
|
||||||
|
params.type = mOrigWindowType;
|
||||||
|
}
|
||||||
|
}
|
||||||
int relayoutResult = sWindowSession.relayout(
|
int relayoutResult = sWindowSession.relayout(
|
||||||
mWindow, params,
|
mWindow, params,
|
||||||
(int) (mView.getMeasuredWidth() * appScale + 0.5f),
|
(int) (mView.getMeasuredWidth() * appScale + 0.5f),
|
||||||
|
|||||||
Reference in New Issue
Block a user