Renamed and moved InputWindow and related files

In preparation for the hierarchy listener interface, moved the
InputWindow structs into libgui and have libinput dependant on libgui.
Also renamed InputWindow to exclude Input since it will be used for more
generic purposes.

Test: Builds and flashes
Bug: 188792659

Change-Id: I24262cbc14d409c00273de0024a672394a959e5f
diff --git a/include/input/DisplayViewport.h b/include/input/DisplayViewport.h
index 5e40ca7..a6213f3 100644
--- a/include/input/DisplayViewport.h
+++ b/include/input/DisplayViewport.h
@@ -18,8 +18,9 @@
 #define _LIBINPUT_DISPLAY_VIEWPORT_H
 
 #include <android-base/stringprintf.h>
+#include <ftl/NamedEnum.h>
+#include <gui/constants.h>
 #include <input/Input.h>
-#include <input/NamedEnum.h>
 
 #include <cinttypes>
 #include <optional>
diff --git a/include/input/Flags.h b/include/input/Flags.h
deleted file mode 100644
index b12a9ed..0000000
--- a/include/input/Flags.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <android-base/stringprintf.h>
-
-#include <array>
-#include <cstdint>
-#include <optional>
-#include <string>
-#include <type_traits>
-
-#include "NamedEnum.h"
-#include "utils/BitSet.h"
-
-#ifndef __UI_INPUT_FLAGS_H
-#define __UI_INPUT_FLAGS_H
-
-namespace android {
-
-namespace details {
-
-template <typename F>
-inline constexpr auto flag_count = sizeof(F) * __CHAR_BIT__;
-
-template <typename F, typename T, T... I>
-constexpr auto generate_flag_values(std::integer_sequence<T, I...> seq) {
-    constexpr size_t count = seq.size();
-
-    std::array<F, count> values{};
-    for (size_t i = 0, v = 0; v < count; ++i) {
-        values[v++] = static_cast<F>(T{1} << i);
-    }
-
-    return values;
-}
-
-template <typename F>
-inline constexpr auto flag_values = generate_flag_values<F>(
-        std::make_integer_sequence<std::underlying_type_t<F>, flag_count<F>>{});
-
-template <typename F, std::size_t... I>
-constexpr auto generate_flag_names(std::index_sequence<I...>) noexcept {
-    return std::array<std::optional<std::string_view>, sizeof...(I)>{
-            {enum_value_name<F, flag_values<F>[I]>()...}};
-}
-
-template <typename F>
-inline constexpr auto flag_names =
-        generate_flag_names<F>(std::make_index_sequence<flag_count<F>>{});
-
-// A trait for determining whether a type is specifically an enum class or not.
-template <typename T, bool = std::is_enum_v<T>>
-struct is_enum_class : std::false_type {};
-
-// By definition, an enum class is an enum that is not implicitly convertible to its underlying
-// type.
-template <typename T>
-struct is_enum_class<T, true>
-      : std::bool_constant<!std::is_convertible_v<T, std::underlying_type_t<T>>> {};
-
-template <typename T>
-inline constexpr bool is_enum_class_v = is_enum_class<T>::value;
-} // namespace details
-
-template <auto V>
-constexpr auto flag_name() {
-    using F = decltype(V);
-    return details::enum_value_name<F, V>();
-}
-
-template <typename F>
-constexpr std::optional<std::string_view> flag_name(F flag) {
-    using U = std::underlying_type_t<F>;
-    auto idx = static_cast<size_t>(__builtin_ctzl(static_cast<U>(flag)));
-    return details::flag_names<F>[idx];
-}
-
-/* A class for handling flags defined by an enum or enum class in a type-safe way. */
-template <typename F>
-class Flags {
-    // F must be an enum or its underlying type is undefined. Theoretically we could specialize this
-    // further to avoid this restriction but in general we want to encourage the use of enums
-    // anyways.
-    static_assert(std::is_enum_v<F>, "Flags type must be an enum");
-    using U = typename std::underlying_type_t<F>;
-
-public:
-    constexpr Flags(F f) : mFlags(static_cast<U>(f)) {}
-    constexpr Flags() : mFlags(0) {}
-    constexpr Flags(const Flags<F>& f) : mFlags(f.mFlags) {}
-
-    // Provide a non-explicit construct for non-enum classes since they easily convert to their
-    // underlying types (e.g. when used with bitwise operators). For enum classes, however, we
-    // should force them to be explicitly constructed from their underlying types to make full use
-    // of the type checker.
-    template <typename T = U>
-    constexpr Flags(T t, typename std::enable_if_t<!details::is_enum_class_v<F>, T>* = nullptr)
-          : mFlags(t) {}
-    template <typename T = U>
-    explicit constexpr Flags(T t,
-                             typename std::enable_if_t<details::is_enum_class_v<F>, T>* = nullptr)
-          : mFlags(t) {}
-
-    class Iterator {
-        // The type can't be larger than 64-bits otherwise it won't fit in BitSet64.
-        static_assert(sizeof(U) <= sizeof(uint64_t));
-
-    public:
-        Iterator(Flags<F> flags) : mRemainingFlags(flags.mFlags) { (*this)++; }
-        Iterator() : mRemainingFlags(0), mCurrFlag(static_cast<F>(0)) {}
-
-        // Pre-fix ++
-        Iterator& operator++() {
-            if (mRemainingFlags.isEmpty()) {
-                mCurrFlag = static_cast<F>(0);
-            } else {
-                uint64_t bit = mRemainingFlags.clearLastMarkedBit(); // counts from left
-                const U flag = 1 << (64 - bit - 1);
-                mCurrFlag = static_cast<F>(flag);
-            }
-            return *this;
-        }
-
-        // Post-fix ++
-        Iterator operator++(int) {
-            Iterator iter = *this;
-            ++*this;
-            return iter;
-        }
-
-        bool operator==(Iterator other) const {
-            return mCurrFlag == other.mCurrFlag && mRemainingFlags == other.mRemainingFlags;
-        }
-
-        bool operator!=(Iterator other) const { return !(*this == other); }
-
-        F operator*() { return mCurrFlag; }
-
-        // iterator traits
-
-        // In the future we could make this a bidirectional const iterator instead of a forward
-        // iterator but it doesn't seem worth the added complexity at this point. This could not,
-        // however, be made a non-const iterator as assigning one flag to another is a non-sensical
-        // operation.
-        using iterator_category = std::input_iterator_tag;
-        using value_type = F;
-        // Per the C++ spec, because input iterators are not assignable the iterator's reference
-        // type does not actually need to be a reference. In fact, making it a reference would imply
-        // that modifying it would change the underlying Flags object, which is obviously wrong for
-        // the same reason this can't be a non-const iterator.
-        using reference = F;
-        using difference_type = void;
-        using pointer = void;
-
-    private:
-        BitSet64 mRemainingFlags;
-        F mCurrFlag;
-    };
-
-    /*
-     * Tests whether the given flag is set.
-     */
-    bool test(F flag) const {
-        U f = static_cast<U>(flag);
-        return (f & mFlags) == f;
-    }
-
-    /* Tests whether any of the given flags are set */
-    bool any(Flags<F> f) { return (mFlags & f.mFlags) != 0; }
-
-    /* Tests whether all of the given flags are set */
-    bool all(Flags<F> f) { return (mFlags & f.mFlags) == f.mFlags; }
-
-    Flags<F> operator|(Flags<F> rhs) const { return static_cast<F>(mFlags | rhs.mFlags); }
-    Flags<F>& operator|=(Flags<F> rhs) {
-        mFlags = mFlags | rhs.mFlags;
-        return *this;
-    }
-
-    Flags<F> operator&(Flags<F> rhs) const { return static_cast<F>(mFlags & rhs.mFlags); }
-    Flags<F>& operator&=(Flags<F> rhs) {
-        mFlags = mFlags & rhs.mFlags;
-        return *this;
-    }
-
-    Flags<F> operator^(Flags<F> rhs) const { return static_cast<F>(mFlags ^ rhs.mFlags); }
-    Flags<F>& operator^=(Flags<F> rhs) {
-        mFlags = mFlags ^ rhs.mFlags;
-        return *this;
-    }
-
-    Flags<F> operator~() { return static_cast<F>(~mFlags); }
-
-    bool operator==(Flags<F> rhs) const { return mFlags == rhs.mFlags; }
-    bool operator!=(Flags<F> rhs) const { return !operator==(rhs); }
-
-    Flags<F>& operator=(const Flags<F>& rhs) {
-        mFlags = rhs.mFlags;
-        return *this;
-    }
-
-    Iterator begin() const { return Iterator(*this); }
-
-    Iterator end() const { return Iterator(); }
-
-    /*
-     * Returns the stored set of flags.
-     *
-     * Note that this returns the underlying type rather than the base enum class. This is because
-     * the value is no longer necessarily a strict member of the enum since the returned value could
-     * be multiple enum variants OR'd together.
-     */
-    U get() const { return mFlags; }
-
-    std::string string() const {
-        std::string result;
-        bool first = true;
-        U unstringified = 0;
-        for (const F f : *this) {
-            std::optional<std::string_view> flagString = flag_name(f);
-            if (flagString) {
-                appendFlag(result, flagString.value(), first);
-            } else {
-                unstringified |= static_cast<U>(f);
-            }
-        }
-
-        if (unstringified != 0) {
-            appendFlag(result, base::StringPrintf("0x%08x", unstringified), first);
-        }
-
-        if (first) {
-            result += "0x0";
-        }
-
-        return result;
-    }
-
-private:
-    U mFlags;
-
-    static void appendFlag(std::string& str, const std::string_view& flag, bool& first) {
-        if (first) {
-            first = false;
-        } else {
-            str += " | ";
-        }
-        str += flag;
-    }
-};
-
-// This namespace provides operator overloads for enum classes to make it easier to work with them
-// as flags. In order to use these, add them via a `using namespace` declaration.
-namespace flag_operators {
-
-template <typename F, typename = std::enable_if_t<details::is_enum_class_v<F>>>
-inline Flags<F> operator~(F f) {
-    using U = typename std::underlying_type_t<F>;
-    return static_cast<F>(~static_cast<U>(f));
-}
-template <typename F, typename = std::enable_if_t<details::is_enum_class_v<F>>>
-Flags<F> operator|(F lhs, F rhs) {
-    using U = typename std::underlying_type_t<F>;
-    return static_cast<F>(static_cast<U>(lhs) | static_cast<U>(rhs));
-}
-
-} // namespace flag_operators
-} // namespace android
-
-#endif // __UI_INPUT_FLAGS_H
diff --git a/include/input/Input.h b/include/input/Input.h
index 438121b..3bac763 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -106,15 +106,6 @@
 constexpr int32_t AMOTION_EVENT_FLAG_CANCELED = 0x20;
 
 enum {
-    /* Used when a motion event is not associated with any display.
-     * Typically used for non-pointer events. */
-    ADISPLAY_ID_NONE = -1,
-
-    /* The default display id. */
-    ADISPLAY_ID_DEFAULT = 0,
-};
-
-enum {
     /*
      * Indicates that an input device has switches.
      * This input source flag is hidden from the API because switches are only used by the system
@@ -338,12 +329,6 @@
  */
 constexpr float AMOTION_EVENT_INVALID_CURSOR_POSITION = std::numeric_limits<float>::quiet_NaN();
 
-/**
- * Invalid value for display size. Used when display size isn't available for an event or doesn't
- * matter. This is just a constant 0 so that it has no effect if unused.
- */
-constexpr int32_t AMOTION_EVENT_INVALID_DISPLAY_SIZE = 0;
-
 /*
  * Pointer coordinate data.
  */
diff --git a/include/input/InputApplication.h b/include/input/InputApplication.h
deleted file mode 100644
index 8e4fe79..0000000
--- a/include/input/InputApplication.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _UI_INPUT_APPLICATION_H
-#define _UI_INPUT_APPLICATION_H
-
-#include <string>
-
-#include <android/InputApplicationInfo.h>
-
-#include <binder/IBinder.h>
-#include <binder/Parcel.h>
-#include <binder/Parcelable.h>
-
-#include <input/Input.h>
-#include <utils/RefBase.h>
-#include <utils/Timers.h>
-
-namespace android {
-/*
- * Handle for an application that can receive input.
- *
- * Used by the native input dispatcher as a handle for the window manager objects
- * that describe an application.
- */
-class InputApplicationHandle {
-public:
-    inline const InputApplicationInfo* getInfo() const {
-        return &mInfo;
-    }
-
-    inline std::string getName() const {
-        return !mInfo.name.empty() ? mInfo.name : "<invalid>";
-    }
-
-    inline std::chrono::nanoseconds getDispatchingTimeout(
-            std::chrono::nanoseconds defaultValue) const {
-        return mInfo.token ? std::chrono::milliseconds(mInfo.dispatchingTimeoutMillis)
-                           : defaultValue;
-    }
-
-    inline sp<IBinder> getApplicationToken() const {
-        return mInfo.token;
-    }
-
-    bool operator==(const InputApplicationHandle& other) const {
-        return getName() == other.getName() && getApplicationToken() == other.getApplicationToken();
-    }
-
-    bool operator!=(const InputApplicationHandle& other) const { return !(*this == other); }
-
-    /**
-     * Requests that the state of this object be updated to reflect
-     * the most current available information about the application.
-     *
-     * This method should only be called from within the input dispatcher's
-     * critical section.
-     *
-     * Returns true on success, or false if the handle is no longer valid.
-     */
-    virtual bool updateInfo() = 0;
-
-protected:
-    InputApplicationHandle() = default;
-    virtual ~InputApplicationHandle() = default;
-
-    InputApplicationInfo mInfo;
-};
-
-} // namespace android
-
-#endif // _UI_INPUT_APPLICATION_H
diff --git a/include/input/InputWindow.h b/include/input/InputWindow.h
deleted file mode 100644
index 121be6d..0000000
--- a/include/input/InputWindow.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _UI_INPUT_WINDOW_H
-#define _UI_INPUT_WINDOW_H
-
-#include <android/os/TouchOcclusionMode.h>
-#include <binder/Parcel.h>
-#include <binder/Parcelable.h>
-#include <input/Flags.h>
-#include <input/Input.h>
-#include <input/InputTransport.h>
-#include <ui/Rect.h>
-#include <ui/Region.h>
-#include <ui/Transform.h>
-#include <utils/RefBase.h>
-#include <utils/Timers.h>
-
-#include "InputApplication.h"
-
-using android::os::TouchOcclusionMode;
-
-namespace android {
-
-/*
- * Describes the properties of a window that can receive input.
- */
-struct InputWindowInfo : public Parcelable {
-    InputWindowInfo() = default;
-
-    // Window flags from WindowManager.LayoutParams
-    enum class Flag : uint32_t {
-        ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001,
-        DIM_BEHIND = 0x00000002,
-        BLUR_BEHIND = 0x00000004,
-        NOT_FOCUSABLE = 0x00000008,
-        NOT_TOUCHABLE = 0x00000010,
-        NOT_TOUCH_MODAL = 0x00000020,
-        TOUCHABLE_WHEN_WAKING = 0x00000040,
-        KEEP_SCREEN_ON = 0x00000080,
-        LAYOUT_IN_SCREEN = 0x00000100,
-        LAYOUT_NO_LIMITS = 0x00000200,
-        FULLSCREEN = 0x00000400,
-        FORCE_NOT_FULLSCREEN = 0x00000800,
-        DITHER = 0x00001000,
-        SECURE = 0x00002000,
-        SCALED = 0x00004000,
-        IGNORE_CHEEK_PRESSES = 0x00008000,
-        LAYOUT_INSET_DECOR = 0x00010000,
-        ALT_FOCUSABLE_IM = 0x00020000,
-        WATCH_OUTSIDE_TOUCH = 0x00040000,
-        SHOW_WHEN_LOCKED = 0x00080000,
-        SHOW_WALLPAPER = 0x00100000,
-        TURN_SCREEN_ON = 0x00200000,
-        DISMISS_KEYGUARD = 0x00400000,
-        SPLIT_TOUCH = 0x00800000,
-        HARDWARE_ACCELERATED = 0x01000000,
-        LAYOUT_IN_OVERSCAN = 0x02000000,
-        TRANSLUCENT_STATUS = 0x04000000,
-        TRANSLUCENT_NAVIGATION = 0x08000000,
-        LOCAL_FOCUS_MODE = 0x10000000,
-        SLIPPERY = 0x20000000,
-        LAYOUT_ATTACHED_IN_DECOR = 0x40000000,
-        DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000,
-    }; // Window types from WindowManager.LayoutParams
-
-    enum class Type : int32_t {
-        UNKNOWN = 0,
-        FIRST_APPLICATION_WINDOW = 1,
-        BASE_APPLICATION = 1,
-        APPLICATION = 2,
-        APPLICATION_STARTING = 3,
-        LAST_APPLICATION_WINDOW = 99,
-        FIRST_SUB_WINDOW = 1000,
-        APPLICATION_PANEL = FIRST_SUB_WINDOW,
-        APPLICATION_MEDIA = FIRST_SUB_WINDOW + 1,
-        APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW + 2,
-        APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW + 3,
-        APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW + 4,
-        LAST_SUB_WINDOW = 1999,
-        FIRST_SYSTEM_WINDOW = 2000,
-        STATUS_BAR = FIRST_SYSTEM_WINDOW,
-        SEARCH_BAR = FIRST_SYSTEM_WINDOW + 1,
-        PHONE = FIRST_SYSTEM_WINDOW + 2,
-        SYSTEM_ALERT = FIRST_SYSTEM_WINDOW + 3,
-        KEYGUARD = FIRST_SYSTEM_WINDOW + 4,
-        TOAST = FIRST_SYSTEM_WINDOW + 5,
-        SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW + 6,
-        PRIORITY_PHONE = FIRST_SYSTEM_WINDOW + 7,
-        SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW + 8,
-        KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW + 9,
-        SYSTEM_ERROR = FIRST_SYSTEM_WINDOW + 10,
-        INPUT_METHOD = FIRST_SYSTEM_WINDOW + 11,
-        INPUT_METHOD_DIALOG = FIRST_SYSTEM_WINDOW + 12,
-        WALLPAPER = FIRST_SYSTEM_WINDOW + 13,
-        STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW + 14,
-        SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW + 15,
-        DRAG = FIRST_SYSTEM_WINDOW + 16,
-        STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW + 17,
-        POINTER = FIRST_SYSTEM_WINDOW + 18,
-        NAVIGATION_BAR = FIRST_SYSTEM_WINDOW + 19,
-        VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW + 20,
-        BOOT_PROGRESS = FIRST_SYSTEM_WINDOW + 21,
-        INPUT_CONSUMER = FIRST_SYSTEM_WINDOW + 22,
-        NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW + 24,
-        MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 27,
-        ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW + 32,
-        DOCK_DIVIDER = FIRST_SYSTEM_WINDOW + 34,
-        ACCESSIBILITY_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 39,
-        NOTIFICATION_SHADE = FIRST_SYSTEM_WINDOW + 40,
-        LAST_SYSTEM_WINDOW = 2999,
-    };
-
-    enum class Feature {
-        DISABLE_TOUCH_PAD_GESTURES = 0x00000001,
-        NO_INPUT_CHANNEL = 0x00000002,
-        DISABLE_USER_ACTIVITY = 0x00000004,
-    };
-
-    /* These values are filled in by the WM and passed through SurfaceFlinger
-     * unless specified otherwise.
-     */
-    // This value should NOT be used to uniquely identify the window. There may be different
-    // input windows that have the same token.
-    sp<IBinder> token;
-    // This uniquely identifies the input window.
-    int32_t id = -1;
-    std::string name;
-    Flags<Flag> flags;
-    Type type = Type::UNKNOWN;
-    std::chrono::nanoseconds dispatchingTimeout = std::chrono::seconds(5);
-
-    /* These values are filled in by SurfaceFlinger. */
-    int32_t frameLeft = -1;
-    int32_t frameTop = -1;
-    int32_t frameRight = -1;
-    int32_t frameBottom = -1;
-
-    /*
-     * SurfaceFlinger consumes this value to shrink the computed frame. This is
-     * different from shrinking the touchable region in that it DOES shift the coordinate
-     * space where-as the touchable region does not and is more like "cropping". This
-     * is used for window shadows.
-     */
-    int32_t surfaceInset = 0;
-
-    // A global scaling factor for all windows. Unlike windowScaleX/Y this results
-    // in scaling of the TOUCH_MAJOR/TOUCH_MINOR axis.
-    float globalScaleFactor = 1.0f;
-
-    // The opacity of this window, from 0.0 to 1.0 (inclusive).
-    // An alpha of 1.0 means fully opaque and 0.0 means fully transparent.
-    float alpha;
-
-    // Transform applied to individual windows.
-    ui::Transform transform;
-
-    // Display size in its natural rotation. Used to rotate raw coordinates for compatibility.
-    int32_t displayWidth = AMOTION_EVENT_INVALID_DISPLAY_SIZE;
-    int32_t displayHeight = AMOTION_EVENT_INVALID_DISPLAY_SIZE;
-
-    /*
-     * This is filled in by the WM relative to the frame and then translated
-     * to absolute coordinates by SurfaceFlinger once the frame is computed.
-     */
-    Region touchableRegion;
-    bool visible = false;
-    bool focusable = false;
-    bool hasWallpaper = false;
-    bool paused = false;
-    /* This flag is set when the window is of a trusted type that is allowed to silently
-     * overlay other windows for the purpose of implementing the secure views feature.
-     * Trusted overlays, such as IME windows, can partly obscure other windows without causing
-     * motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED.
-     */
-    bool trustedOverlay = false;
-    TouchOcclusionMode touchOcclusionMode = TouchOcclusionMode::BLOCK_UNTRUSTED;
-    int32_t ownerPid = -1;
-    int32_t ownerUid = -1;
-    std::string packageName;
-    Flags<Feature> inputFeatures;
-    int32_t displayId = ADISPLAY_ID_NONE;
-    int32_t portalToDisplayId = ADISPLAY_ID_NONE;
-    InputApplicationInfo applicationInfo;
-    bool replaceTouchableRegionWithCrop = false;
-    wp<IBinder> touchableRegionCropHandle;
-
-    void addTouchableRegion(const Rect& region);
-
-    bool touchableRegionContainsPoint(int32_t x, int32_t y) const;
-
-    bool frameContainsPoint(int32_t x, int32_t y) const;
-
-    bool supportsSplitTouch() const;
-
-    bool overlaps(const InputWindowInfo* other) const;
-
-    bool operator==(const InputWindowInfo& inputChannel) const;
-
-    status_t writeToParcel(android::Parcel* parcel) const override;
-
-    status_t readFromParcel(const android::Parcel* parcel) override;
-};
-
-/*
- * Handle for a window that can receive input.
- *
- * Used by the native input dispatcher to indirectly refer to the window manager objects
- * that describe a window.
- */
-class InputWindowHandle : public RefBase {
-public:
-    explicit InputWindowHandle();
-    InputWindowHandle(const InputWindowHandle& other);
-    InputWindowHandle(const InputWindowInfo& other);
-
-    inline const InputWindowInfo* getInfo() const { return &mInfo; }
-
-    sp<IBinder> getToken() const;
-
-    int32_t getId() const { return mInfo.id; }
-
-    sp<IBinder> getApplicationToken() { return mInfo.applicationInfo.token; }
-
-    inline std::string getName() const { return !mInfo.name.empty() ? mInfo.name : "<invalid>"; }
-
-    inline std::chrono::nanoseconds getDispatchingTimeout(
-            std::chrono::nanoseconds defaultValue) const {
-        return mInfo.token ? std::chrono::nanoseconds(mInfo.dispatchingTimeout) : defaultValue;
-    }
-
-    /**
-     * Requests that the state of this object be updated to reflect
-     * the most current available information about the application.
-     * As this class is created as RefBase object, no pure virtual function is allowed.
-     *
-     * This method should only be called from within the input dispatcher's
-     * critical section.
-     *
-     * Returns true on success, or false if the handle is no longer valid.
-     */
-    virtual bool updateInfo() { return false; }
-
-    /**
-     * Updates from another input window handle.
-     */
-    void updateFrom(const sp<InputWindowHandle> handle);
-
-    /**
-     * Releases the channel used by the associated information when it is
-     * no longer needed.
-     */
-    void releaseChannel();
-
-    // Not override since this class is not derrived from Parcelable.
-    status_t readFromParcel(const android::Parcel* parcel);
-    status_t writeToParcel(android::Parcel* parcel) const;
-
-protected:
-    virtual ~InputWindowHandle();
-
-    InputWindowInfo mInfo;
-};
-} // namespace android
-
-#endif // _UI_INPUT_WINDOW_H
diff --git a/include/input/NamedEnum.h b/include/input/NamedEnum.h
deleted file mode 100644
index 6562348..0000000
--- a/include/input/NamedEnum.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <android-base/stringprintf.h>
-
-#include <array>
-#include <cstdint>
-#include <optional>
-#include <string>
-
-#ifndef __UI_INPUT_NAMEDENUM_H
-#define __UI_INPUT_NAMEDENUM_H
-
-namespace android {
-
-namespace details {
-template <typename E, E V>
-constexpr std::optional<std::string_view> enum_value_name() {
-    // Should look something like (but all on one line):
-    //   std::optional<std::string_view>
-    //   android::details::enum_value_name()
-    //   [E = android::test::TestEnums, V = android::test::TestEnums::ONE]
-    std::string_view view = __PRETTY_FUNCTION__;
-    size_t templateStart = view.rfind("[");
-    size_t templateEnd = view.rfind("]");
-    if (templateStart == std::string::npos || templateEnd == std::string::npos) {
-        return std::nullopt;
-    }
-
-    // Extract the template parameters without the enclosing braces.
-    // Example (cont'd): E = android::test::TestEnums, V = android::test::TestEnums::ONE
-    view = view.substr(templateStart + 1, templateEnd - templateStart - 1);
-    size_t valStart = view.rfind("V = ");
-    if (valStart == std::string::npos) {
-        return std::nullopt;
-    }
-
-    // Example (cont'd): V = android::test::TestEnums::ONE
-    view = view.substr(valStart);
-    size_t nameStart = view.rfind("::");
-    if (nameStart == std::string::npos) {
-        return std::nullopt;
-    }
-
-    // Chop off the initial "::"
-    nameStart += 2;
-    return view.substr(nameStart);
-}
-
-template <typename E, typename T, T... I>
-constexpr auto generate_enum_values(std::integer_sequence<T, I...> seq) {
-    constexpr size_t count = seq.size();
-
-    std::array<E, count> values{};
-    for (size_t i = 0, v = 0; v < count; ++i) {
-        values[v++] = static_cast<E>(T{0} + i);
-    }
-
-    return values;
-}
-
-template <typename E, std::size_t N>
-inline constexpr auto enum_values =
-        generate_enum_values<E>(std::make_integer_sequence<std::underlying_type_t<E>, N>{});
-
-template <typename E, std::size_t N, std::size_t... I>
-constexpr auto generate_enum_names(std::index_sequence<I...>) noexcept {
-    return std::array<std::optional<std::string_view>, sizeof...(I)>{
-            {enum_value_name<E, enum_values<E, N>[I]>()...}};
-}
-
-template <typename E, std::size_t N>
-inline constexpr auto enum_names = generate_enum_names<E, N>(std::make_index_sequence<N>{});
-
-} // namespace details
-
-class NamedEnum {
-public:
-    // By default allowed enum value range is 0 ~ 7.
-    template <typename E>
-    static constexpr size_t max = 8;
-
-    template <auto V>
-    static constexpr auto enum_name() {
-        using E = decltype(V);
-        return details::enum_value_name<E, V>();
-    }
-
-    template <typename E>
-    static constexpr std::optional<std::string_view> enum_name(E val) {
-        auto idx = static_cast<size_t>(val);
-        return idx < max<E> ? details::enum_names<E, max<E>>[idx] : std::nullopt;
-    }
-
-    // Helper function for parsing enum value to string.
-    // Example : enum class TestEnums { ZERO = 0x0 };
-    // NamedEnum::string(TestEnums::ZERO) returns string of "ZERO".
-    // Note the default maximum enum is 8, if the enum ID to be parsed if greater than 8 like 16,
-    // it should be declared to specialized the maximum enum by below:
-    // template <> constexpr size_t NamedEnum::max<TestEnums> = 16;
-    // If the enum class definition is sparse and contains enum values starting from a large value,
-    // Do not specialize it to a large number to avoid performance issues.
-    // The recommended maximum enum number to specialize is 64.
-    template <typename E>
-    static const std::string string(E val, const char* fallbackFormat = "%02d") {
-        std::string result;
-        std::optional<std::string_view> enumString = enum_name(val);
-        result += enumString ? enumString.value() : base::StringPrintf(fallbackFormat, val);
-        return result;
-    }
-};
-
-} // namespace android
-
-#endif // __UI_INPUT_NAMEDENUM_H
\ No newline at end of file