Print window flags in dumpsys input
Previously, the flag in dumpsys input would show up like this:
flags=0x21800128
which made it difficult to figure out which flags are actually set on
the window.
Instead, propose to stringify the flags:
flags: NOT_FOCUSABLE | LAYOUT_IN_SCREEN | LAYOUT_NO_LIMITS | LAYOUT_INSET_DECOR |
which would make the window portion of dumpsys input to look like:
Windows:
0: name='Window{565cbb2 u0 ScreenDecorOverlayBottom}', displayId=0, portalToDisplayId=-1, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x21800128, type=0x000007e8, frame=[0,2883][1440,3040], globalScale=1.000000, windowScale=(1.000000,1.000000), touchableRegion=<empty>, inputFeatures=0x00000000, ownerPid=4114, ownerUid=10201, dispatchingTimeout=5000.000ms
flags: NOT_FOCUSABLE | NOT_TOUCH_MODAL | LAYOUT_IN_SCREEN | SPLIT_TOUCH | HARDWARE_ACCELERATED | SLIPPERY |
1: name='Window{427d84e u0 ScreenDecorOverlay}', displayId=0, portalToDisplayId=-1, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x21800128, type=0x000007e8, frame=[0,0][1440,157], globalScale=1.000000, windowScale=(1.000000,1.000000), touchableRegion=<empty>, inputFeatures=0x00000000, ownerPid=4114, ownerUid=10201, dispatchingTimeout=5000.000ms
flags: NOT_FOCUSABLE | NOT_TOUCH_MODAL | LAYOUT_IN_SCREEN | SPLIT_TOUCH | HARDWARE_ACCELERATED | SLIPPERY |
2: name='Window{66c2ce u0 NavigationBar0}', displayId=0, portalToDisplayId=-1, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x21840068, type=0x000007e3, frame=[0,2872][1440,3040], globalScale=1.000000, windowScale=(1.000000,1.000000), touchableRegion=<empty>, inputFeatures=0x00000000, ownerPid=4114, ownerUid=10201, dispatchingTimeout=5000.000ms
flags: NOT_FOCUSABLE | NOT_TOUCH_MODAL | TOUCHABLE_WHEN_WAKING | WATCH_OUTSIDE_TOUCH | SPLIT_TOUCH | HARDWARE_ACCELERATED | SLIPPERY |
3: name='Window{9de0939 u0 NotificationShade}', displayId=0, portalToDisplayId=-1, paused=false, hasFocus=true, hasWallpaper=false, visible=true, canReceiveKeys=true, flags=0x81860060, type=0x000007f8, frame=[0,0][1440,3040], globalScale=1.000000, windowScale=(1.000000,1.000000), touchableRegion=[-1440,-3040][2880,6080], inputFeatures=0x00000004, ownerPid=4114, ownerUid=10201, dispatchingTimeout=5000.000ms
flags: NOT_TOUCH_MODAL | TOUCHABLE_WHEN_WAKING | ALT_FOCUSABLE_IM | WATCH_OUTSIDE_TOUCH | SPLIT_TOUCH | HARDWARE_ACCELERATED | DRAWS_SYSTEM_BAR_BACKGROUNDS |
Bug: none
Test: dumpsys input
Change-Id: I7065fda194adb0bf63126c6b3647f3af0f5ca1ba
diff --git a/include/input/InputWindow.h b/include/input/InputWindow.h
index aa85e6d..717b7a6 100644
--- a/include/input/InputWindow.h
+++ b/include/input/InputWindow.h
@@ -37,23 +37,23 @@
InputWindowInfo(const Parcel& from);
// Window flags from WindowManager.LayoutParams
- enum {
- FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001,
- FLAG_DIM_BEHIND = 0x00000002,
- FLAG_BLUR_BEHIND = 0x00000004,
- FLAG_NOT_FOCUSABLE = 0x00000008,
- FLAG_NOT_TOUCHABLE = 0x00000010,
- FLAG_NOT_TOUCH_MODAL = 0x00000020,
+ enum : uint32_t {
+ FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001,
+ FLAG_DIM_BEHIND = 0x00000002,
+ FLAG_BLUR_BEHIND = 0x00000004,
+ FLAG_NOT_FOCUSABLE = 0x00000008,
+ FLAG_NOT_TOUCHABLE = 0x00000010,
+ FLAG_NOT_TOUCH_MODAL = 0x00000020,
FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040,
- FLAG_KEEP_SCREEN_ON = 0x00000080,
- FLAG_LAYOUT_IN_SCREEN = 0x00000100,
- FLAG_LAYOUT_NO_LIMITS = 0x00000200,
- FLAG_FULLSCREEN = 0x00000400,
- FLAG_FORCE_NOT_FULLSCREEN = 0x00000800,
- FLAG_DITHER = 0x00001000,
- FLAG_SECURE = 0x00002000,
- FLAG_SCALED = 0x00004000,
- FLAG_IGNORE_CHEEK_PRESSES = 0x00008000,
+ FLAG_KEEP_SCREEN_ON = 0x00000080,
+ FLAG_LAYOUT_IN_SCREEN = 0x00000100,
+ FLAG_LAYOUT_NO_LIMITS = 0x00000200,
+ FLAG_FULLSCREEN = 0x00000400,
+ FLAG_FORCE_NOT_FULLSCREEN = 0x00000800,
+ FLAG_DITHER = 0x00001000,
+ FLAG_SECURE = 0x00002000,
+ FLAG_SCALED = 0x00004000,
+ FLAG_IGNORE_CHEEK_PRESSES = 0x00008000,
FLAG_LAYOUT_INSET_DECOR = 0x00010000,
FLAG_ALT_FOCUSABLE_IM = 0x00020000,
FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000,
@@ -62,7 +62,14 @@
FLAG_TURN_SCREEN_ON = 0x00200000,
FLAG_DISMISS_KEYGUARD = 0x00400000,
FLAG_SPLIT_TOUCH = 0x00800000,
+ FLAG_HARDWARE_ACCELERATED = 0x01000000,
+ FLAG_LAYOUT_IN_OVERSCAN = 0x02000000,
+ FLAG_TRANSLUCENT_STATUS = 0x04000000,
+ FLAG_TRANSLUCENT_NAVIGATION = 0x08000000,
+ FLAG_LOCAL_FOCUS_MODE = 0x10000000,
FLAG_SLIPPERY = 0x20000000,
+ FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000,
+ FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000,
};
// Window types from WindowManager.LayoutParams
@@ -191,6 +198,7 @@
static InputWindowInfo read(const Parcel& from);
};
+std::string inputWindowFlagsToString(uint32_t flags);
/*
* Handle for a window that can receive input.