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

Commit 29ba533e authored by Ioana Stefan's avatar Ioana Stefan
Browse files

Add IntDef annotations to fields

Added IntDef annotations to fields that missed them in
WindowManager LayoutParams: input_feature_flags,
system_ui_visibility_flags and subtree_system_ui_visibility_flags.

Bug: 160129453
Test: Run 'mp :framework-minus-apex-intdefs' and check if mapping files are properly generated

Change-Id: I66d6dcbff3b41175827c84c9fda68be92877925a
parent 1bac4834
Loading
Loading
Loading
Loading
+69 −1
Original line number Diff line number Diff line
@@ -17,6 +17,27 @@
package android.view;

import static android.content.pm.ActivityInfo.COLOR_MODE_DEFAULT;
import static android.view.View.STATUS_BAR_DISABLE_BACK;
import static android.view.View.STATUS_BAR_DISABLE_CLOCK;
import static android.view.View.STATUS_BAR_DISABLE_EXPAND;
import static android.view.View.STATUS_BAR_DISABLE_HOME;
import static android.view.View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS;
import static android.view.View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS;
import static android.view.View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER;
import static android.view.View.STATUS_BAR_DISABLE_RECENT;
import static android.view.View.STATUS_BAR_DISABLE_SEARCH;
import static android.view.View.STATUS_BAR_DISABLE_SYSTEM_INFO;
import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN;
import static android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
import static android.view.View.SYSTEM_UI_FLAG_IMMERSIVE;
import static android.view.View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE;
import static android.view.View.SYSTEM_UI_FLAG_VISIBLE;
import static android.view.WindowInsets.Side.BOTTOM;
import static android.view.WindowInsets.Side.LEFT;
import static android.view.WindowInsets.Side.RIGHT;
@@ -2708,6 +2729,38 @@ public interface WindowManager extends ViewManager {
         */
        public int preferredDisplayModeId;

        /**
         * An internal annotation for flags that can be specified to {@link #systemUiVisibility}
         * and {@link #subtreeSystemUiVisibility}.
         *
         * @hide
         */
        @Retention(RetentionPolicy.SOURCE)
        @IntDef(flag = true, prefix = { "" }, value = {
            SYSTEM_UI_FLAG_VISIBLE,
            SYSTEM_UI_FLAG_LOW_PROFILE,
            SYSTEM_UI_FLAG_HIDE_NAVIGATION,
            SYSTEM_UI_FLAG_FULLSCREEN,
            SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR,
            SYSTEM_UI_FLAG_LAYOUT_STABLE,
            SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION,
            SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN,
            SYSTEM_UI_FLAG_IMMERSIVE,
            SYSTEM_UI_FLAG_IMMERSIVE_STICKY,
            SYSTEM_UI_FLAG_LIGHT_STATUS_BAR,
            STATUS_BAR_DISABLE_EXPAND,
            STATUS_BAR_DISABLE_NOTIFICATION_ICONS,
            STATUS_BAR_DISABLE_NOTIFICATION_ALERTS,
            STATUS_BAR_DISABLE_NOTIFICATION_TICKER,
            STATUS_BAR_DISABLE_SYSTEM_INFO,
            STATUS_BAR_DISABLE_HOME,
            STATUS_BAR_DISABLE_BACK,
            STATUS_BAR_DISABLE_CLOCK,
            STATUS_BAR_DISABLE_RECENT,
            STATUS_BAR_DISABLE_SEARCH,
        })
        public @interface SystemUiVisibilityFlags {}

        /**
         * Control the visibility of the status bar.
         *
@@ -2717,6 +2770,7 @@ public interface WindowManager extends ViewManager {
         * @deprecated SystemUiVisibility flags are deprecated. Use {@link WindowInsetsController}
         * instead.
         */
        @SystemUiVisibilityFlags
        @Deprecated
        public int systemUiVisibility;

@@ -2725,6 +2779,7 @@ public interface WindowManager extends ViewManager {
         * The ui visibility as requested by the views in this hierarchy.
         * the combined value should be systemUiVisibility | subtreeSystemUiVisibility.
         */
        @SystemUiVisibilityFlags
        @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
        public int subtreeSystemUiVisibility;

@@ -2738,7 +2793,6 @@ public interface WindowManager extends ViewManager {
        @UnsupportedAppUsage
        public boolean hasSystemUiListeners;


        /** @hide */
        @Retention(RetentionPolicy.SOURCE)
        @IntDef(
@@ -2904,6 +2958,19 @@ public interface WindowManager extends ViewManager {
        @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
        public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;

        /**
         * An internal annotation for flags that can be specified to {@link #inputFeatures}.
         *
         * @hide
         */
        @Retention(RetentionPolicy.SOURCE)
        @IntDef(flag = true, prefix = { "INPUT_FEATURE_" }, value = {
            INPUT_FEATURE_DISABLE_POINTER_GESTURES,
            INPUT_FEATURE_NO_INPUT_CHANNEL,
            INPUT_FEATURE_DISABLE_USER_ACTIVITY,
        })
        public @interface InputFeatureFlags {}

        /**
         * Control special features of the input subsystem.
         *
@@ -2912,6 +2979,7 @@ public interface WindowManager extends ViewManager {
         * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
         * @hide
         */
        @InputFeatureFlags
        @UnsupportedAppUsage
        public int inputFeatures;

+4 −4
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ message WindowLayoutParamsProto {
    optional int32 height = 5;
    optional float horizontal_margin = 6;
    optional float vertical_margin = 7;
    optional int32 gravity = 8; // TODO (b/160129453): Add IntDef
    optional int32 gravity = 8;
    optional int32 soft_input_mode = 9 [(.android.typedef) = "android.view.WindowManager.LayoutParams.SoftInputModeFlags"];
    optional .android.graphics.PixelFormatProto.Format format = 10;
    optional int32 window_animations = 11;
@@ -54,14 +54,14 @@ message WindowLayoutParamsProto {
    optional float preferred_refresh_rate = 16;
    optional int32 preferred_display_mode_id = 17;
    optional bool has_system_ui_listeners = 18;
    optional uint32 input_feature_flags = 19; // TODO (b/160129453): Add IntDef
    optional uint32 input_feature_flags = 19 [(.android.typedef) = "android.view.WindowManager.LayoutParams.InputFeatureFlags"];
    optional int64 user_activity_timeout = 20;

    optional DisplayProto.ColorMode color_mode = 23;
    optional uint32 flags = 24 [(.android.typedef) = "android.view.WindowManager.LayoutParams.Flags"];
    optional uint32 private_flags = 26 [(.android.typedef) = "android.view.WindowManager.LayoutParams.PrivateFlags"];
    optional uint32 system_ui_visibility_flags = 27; // TODO (b/160129453): Add IntDef
    optional uint32 subtree_system_ui_visibility_flags = 28; // TODO (b/160129453): Add IntDef
    optional uint32 system_ui_visibility_flags = 27 [(.android.typedef) = "android.view.WindowManager.LayoutParams.SystemUiVisibilityFlags"];
    optional uint32 subtree_system_ui_visibility_flags = 28 [(.android.typedef) = "android.view.WindowManager.LayoutParams.SystemUiVisibilityFlags"];
    optional uint32 appearance = 29 [(.android.typedef) = "android.view.WindowInsetsController.Appearance"];
    optional uint32 behavior = 30 [(.android.typedef) = "android.view.WindowInsetsController.Behavior"];
    optional uint32 fit_insets_types = 31 [(.android.typedef) = "android.view.WindowInsets.Type.InsetsType"];