Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5b386d2 authored by Filip Gruszczynski's avatar Filip Gruszczynski Committed by Android (Google) Code Review
Browse files

Merge "Don't depend on mContentParent to determine if content was set."

parents 29474f9e f4bdaeb3
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -146,6 +146,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
    // This is the view in which the window contents are placed. It is either
    // mDecor itself, or a child of mDecor where the contents go.
    ViewGroup mContentParent;
    // Whether the client has explicitly set the content view. If false and mContentParent is not
    // null, then the content parent was set due to window preservation.
    private boolean mContentParentExplicitlySet = false;

    Callback2 mTakeSurfaceCallback;

@@ -315,7 +318,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {

    @Override
    public boolean requestFeature(int featureId) {
        if (mContentParent != null) {
        if (mContentParentExplicitlySet) {
            throw new AndroidRuntimeException("requestFeature() must be called before adding content");
        }
        final int features = getFeatures();
@@ -399,6 +402,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        if (cb != null && !isDestroyed()) {
            cb.onContentChanged();
        }
        mContentParentExplicitlySet = true;
    }

    @Override
@@ -429,6 +433,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        if (cb != null && !isDestroyed()) {
            cb.onContentChanged();
        }
        mContentParentExplicitlySet = true;
    }

    @Override