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

Commit b43fe24a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Removing remnants of menu key"

parents fa0a6619 195d31c5
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1167,16 +1167,6 @@ public abstract class Window {
        dispatchWindowAttributesChanged(attrs);
    }

    /**
     * {@hide}
     */
    @UnsupportedAppUsage
    protected void setNeedsMenuKey(int value) {
        final WindowManager.LayoutParams attrs = getAttributes();
        attrs.needsMenuKey = value;
        dispatchWindowAttributesChanged(attrs);
    }

    /**
     * {@hide}
     */
+0 −56
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import static android.view.WindowLayoutParamsProto.HAS_SYSTEM_UI_LISTENERS;
import static android.view.WindowLayoutParamsProto.HEIGHT;
import static android.view.WindowLayoutParamsProto.HORIZONTAL_MARGIN;
import static android.view.WindowLayoutParamsProto.INPUT_FEATURE_FLAGS;
import static android.view.WindowLayoutParamsProto.NEEDS_MENU_KEY;
import static android.view.WindowLayoutParamsProto.PREFERRED_REFRESH_RATE;
import static android.view.WindowLayoutParamsProto.PRIVATE_FLAGS;
import static android.view.WindowLayoutParamsProto.ROTATION_ANIMATION;
@@ -1947,48 +1946,6 @@ public interface WindowManager extends ViewManager {
        @TestApi
        public int privateFlags;

        /**
         * Value for {@link #needsMenuKey} for a window that has not explicitly specified if it
         * needs {@link #NEEDS_MENU_SET_TRUE} or doesn't need {@link #NEEDS_MENU_SET_FALSE} a menu
         * key. For this case, we should look at windows behind it to determine the appropriate
         * value.
         *
         * @hide
         */
        public static final int NEEDS_MENU_UNSET = 0;

        /**
         * Value for {@link #needsMenuKey} for a window that has explicitly specified it needs a
         * menu key.
         *
         * @hide
         */
        @UnsupportedAppUsage
        public static final int NEEDS_MENU_SET_TRUE = 1;

        /**
         * Value for {@link #needsMenuKey} for a window that has explicitly specified it doesn't
         * needs a menu key.
         *
         * @hide
         */
        @UnsupportedAppUsage
        public static final int NEEDS_MENU_SET_FALSE = 2;

        /**
         * State variable for a window belonging to an activity that responds to
         * {@link KeyEvent#KEYCODE_MENU} and therefore needs a Menu key. For devices where Menu is a
         * physical button this variable is ignored, but on devices where the Menu key is drawn in
         * software it may be hidden unless this variable is set to {@link #NEEDS_MENU_SET_TRUE}.
         *
         *  (Note that Action Bars, when available, are the preferred way to offer additional
         * functions otherwise accessed via an options menu.)
         *
         * {@hide}
         */
        @UnsupportedAppUsage
        public int needsMenuKey = NEEDS_MENU_UNSET;

        /**
         * Given a particular set of window manager flags, determine whether
         * such a window may be a target for an input method when it has
@@ -2791,7 +2748,6 @@ public interface WindowManager extends ViewManager {
            out.writeInt(surfaceInsets.bottom);
            out.writeInt(hasManualSurfaceInsets ? 1 : 0);
            out.writeInt(preservePreviousSurfaceInsets ? 1 : 0);
            out.writeInt(needsMenuKey);
            out.writeLong(accessibilityIdOfAnchor);
            TextUtils.writeToParcel(accessibilityTitle, out, parcelableFlags);
            out.writeInt(mColorMode);
@@ -2849,7 +2805,6 @@ public interface WindowManager extends ViewManager {
            surfaceInsets.bottom = in.readInt();
            hasManualSurfaceInsets = in.readInt() != 0;
            preservePreviousSurfaceInsets = in.readInt() != 0;
            needsMenuKey = in.readInt();
            accessibilityIdOfAnchor = in.readLong();
            accessibilityTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
            mColorMode = in.readInt();
@@ -2891,8 +2846,6 @@ public interface WindowManager extends ViewManager {
        /** {@hide} */
        public static final int PREFERRED_REFRESH_RATE_CHANGED = 1 << 21;
        /** {@hide} */
        public static final int NEEDS_MENU_KEY_CHANGED = 1 << 22;
        /** {@hide} */
        public static final int PREFERRED_DISPLAY_MODE_ID = 1 << 23;
        /** {@hide} */
        public static final int ACCESSIBILITY_ANCHOR_CHANGED = 1 << 24;
@@ -3066,11 +3019,6 @@ public interface WindowManager extends ViewManager {
                changes |= SURFACE_INSETS_CHANGED;
            }

            if (needsMenuKey != o.needsMenuKey) {
                needsMenuKey = o.needsMenuKey;
                changes |= NEEDS_MENU_KEY_CHANGED;
            }

            if (accessibilityIdOfAnchor != o.accessibilityIdOfAnchor) {
                accessibilityIdOfAnchor = o.accessibilityIdOfAnchor;
                changes |= ACCESSIBILITY_ANCHOR_CHANGED;
@@ -3224,9 +3172,6 @@ public interface WindowManager extends ViewManager {
                    sb.append(" (!preservePreviousSurfaceInsets)");
                }
            }
            if (needsMenuKey == NEEDS_MENU_SET_TRUE) {
                sb.append(" needsMenuKey");
            }
            if (mColorMode != COLOR_MODE_DEFAULT) {
                sb.append(" colorMode=").append(ActivityInfo.colorModeToString(mColorMode));
            }
@@ -3288,7 +3233,6 @@ public interface WindowManager extends ViewManager {
            proto.write(HAS_SYSTEM_UI_LISTENERS, hasSystemUiListeners);
            proto.write(INPUT_FEATURE_FLAGS, inputFeatures);
            proto.write(USER_ACTIVITY_TIMEOUT, userActivityTimeout);
            proto.write(NEEDS_MENU_KEY, needsMenuKey);
            proto.write(COLOR_MODE, mColorMode);
            proto.write(FLAGS, flags);
            proto.write(PRIVATE_FLAGS, privateFlags);
+0 −12
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN;
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN;
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
import static android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
@@ -2423,19 +2422,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {

        final Context context = getContext();
        final int targetSdk = context.getApplicationInfo().targetSdkVersion;
        final boolean targetPreHoneycomb = targetSdk < android.os.Build.VERSION_CODES.HONEYCOMB;
        final boolean targetPreIcs = targetSdk < android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH;
        final boolean targetPreL = targetSdk < android.os.Build.VERSION_CODES.LOLLIPOP;
        final boolean targetPreQ = targetSdk < Build.VERSION_CODES.Q;
        final boolean targetHcNeedsOptions = context.getResources().getBoolean(
                R.bool.target_honeycomb_needs_options_menu);
        final boolean noActionBar = !hasFeature(FEATURE_ACTION_BAR) || hasFeature(FEATURE_NO_TITLE);

        if (targetPreHoneycomb || (targetPreIcs && targetHcNeedsOptions && noActionBar)) {
            setNeedsMenuKey(WindowManager.LayoutParams.NEEDS_MENU_SET_TRUE);
        } else {
            setNeedsMenuKey(WindowManager.LayoutParams.NEEDS_MENU_SET_FALSE);
        }

        if (!mForcedStatusBarColor) {
            mStatusBarColor = a.getColor(R.styleable.Window_statusBarColor, 0xFF000000);
+0 −7
Original line number Diff line number Diff line
@@ -56,13 +56,6 @@ message WindowLayoutParamsProto {
    optional uint32 input_feature_flags = 19;
    optional int64 user_activity_timeout = 20;

    enum NeedsMenuState {
        NEEDS_MENU_UNSET = 0;
        NEEDS_MENU_SET_TRUE = 1;
        NEEDS_MENU_SET_FALSE = 2;
    }
    optional NeedsMenuState needs_menu_key = 22;

    optional DisplayProto.ColorMode color_mode = 23;
    optional uint32 flags = 24;
    optional uint32 private_flags = 26;
+0 −1
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
-->

<resources>
    <bool name="target_honeycomb_needs_options_menu">false</bool>
    <bool name="show_ongoing_ime_switcher">true</bool>
    <bool name="kg_share_status_area">false</bool>
    <bool name="kg_sim_puk_account_full_screen">false</bool>
Loading