| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright (C) 2011 The Android Open Source Project | 
 | 3 |  * | 
 | 4 |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
 | 5 |  * you may not use this file except in compliance with the License. | 
 | 6 |  * You may obtain a copy of the License at | 
 | 7 |  * | 
 | 8 |  *      http://www.apache.org/licenses/LICENSE-2.0 | 
 | 9 |  * | 
 | 10 |  * Unless required by applicable law or agreed to in writing, software | 
 | 11 |  * distributed under the License is distributed on an "AS IS" BASIS, | 
 | 12 |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | 13 |  * See the License for the specific language governing permissions and | 
 | 14 |  * limitations under the License. | 
 | 15 |  */ | 
 | 16 |  | 
 | 17 | #ifndef _UI_INPUT_WINDOW_H | 
 | 18 | #define _UI_INPUT_WINDOW_H | 
 | 19 |  | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 20 | #include <binder/Parcel.h> | 
 | 21 | #include <binder/Parcelable.h> | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 22 | #include <input/Input.h> | 
 | 23 | #include <input/InputTransport.h> | 
 | 24 | #include <ui/Rect.h> | 
 | 25 | #include <ui/Region.h> | 
| chaviw | fd9c1ed | 2020-07-01 10:57:59 -0700 | [diff] [blame] | 26 | #include <ui/Transform.h> | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 27 | #include <utils/RefBase.h> | 
 | 28 | #include <utils/Timers.h> | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 29 |  | 
 | 30 | #include "InputApplication.h" | 
 | 31 |  | 
 | 32 | namespace android { | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 33 |  | 
 | 34 | /* | 
 | 35 |  * Describes the properties of a window that can receive input. | 
 | 36 |  */ | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 37 | struct InputWindowInfo : public Parcelable { | 
| Robert Carr | 1cc7867 | 2018-07-31 14:25:57 -0700 | [diff] [blame] | 38 |     InputWindowInfo() = default; | 
| Robert Carr | 1cc7867 | 2018-07-31 14:25:57 -0700 | [diff] [blame] | 39 |  | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 40 |     // Window flags from WindowManager.LayoutParams | 
| Siarhei Vishniakou | 67d4450 | 2020-04-09 11:09:29 -0700 | [diff] [blame] | 41 |     enum : uint32_t { | 
 | 42 |         FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001, | 
 | 43 |         FLAG_DIM_BEHIND = 0x00000002, | 
 | 44 |         FLAG_BLUR_BEHIND = 0x00000004, | 
 | 45 |         FLAG_NOT_FOCUSABLE = 0x00000008, | 
 | 46 |         FLAG_NOT_TOUCHABLE = 0x00000010, | 
 | 47 |         FLAG_NOT_TOUCH_MODAL = 0x00000020, | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 48 |         FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040, | 
| Siarhei Vishniakou | 67d4450 | 2020-04-09 11:09:29 -0700 | [diff] [blame] | 49 |         FLAG_KEEP_SCREEN_ON = 0x00000080, | 
 | 50 |         FLAG_LAYOUT_IN_SCREEN = 0x00000100, | 
 | 51 |         FLAG_LAYOUT_NO_LIMITS = 0x00000200, | 
 | 52 |         FLAG_FULLSCREEN = 0x00000400, | 
 | 53 |         FLAG_FORCE_NOT_FULLSCREEN = 0x00000800, | 
 | 54 |         FLAG_DITHER = 0x00001000, | 
 | 55 |         FLAG_SECURE = 0x00002000, | 
 | 56 |         FLAG_SCALED = 0x00004000, | 
 | 57 |         FLAG_IGNORE_CHEEK_PRESSES = 0x00008000, | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 58 |         FLAG_LAYOUT_INSET_DECOR = 0x00010000, | 
 | 59 |         FLAG_ALT_FOCUSABLE_IM = 0x00020000, | 
 | 60 |         FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000, | 
 | 61 |         FLAG_SHOW_WHEN_LOCKED = 0x00080000, | 
 | 62 |         FLAG_SHOW_WALLPAPER = 0x00100000, | 
 | 63 |         FLAG_TURN_SCREEN_ON = 0x00200000, | 
 | 64 |         FLAG_DISMISS_KEYGUARD = 0x00400000, | 
 | 65 |         FLAG_SPLIT_TOUCH = 0x00800000, | 
| Siarhei Vishniakou | 67d4450 | 2020-04-09 11:09:29 -0700 | [diff] [blame] | 66 |         FLAG_HARDWARE_ACCELERATED = 0x01000000, | 
 | 67 |         FLAG_LAYOUT_IN_OVERSCAN = 0x02000000, | 
 | 68 |         FLAG_TRANSLUCENT_STATUS = 0x04000000, | 
 | 69 |         FLAG_TRANSLUCENT_NAVIGATION = 0x08000000, | 
 | 70 |         FLAG_LOCAL_FOCUS_MODE = 0x10000000, | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 71 |         FLAG_SLIPPERY = 0x20000000, | 
| Siarhei Vishniakou | 67d4450 | 2020-04-09 11:09:29 -0700 | [diff] [blame] | 72 |         FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000, | 
 | 73 |         FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000, | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 74 |     }; | 
 | 75 |  | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 76 |     // Window types from WindowManager.LayoutParams | 
 | 77 |     enum { | 
 | 78 |         FIRST_APPLICATION_WINDOW = 1, | 
| wilsonshih | 599042f | 2020-05-04 16:24:58 +0800 | [diff] [blame] | 79 |         TYPE_BASE_APPLICATION = 1, | 
 | 80 |         TYPE_APPLICATION = 2, | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 81 |         TYPE_APPLICATION_STARTING = 3, | 
 | 82 |         LAST_APPLICATION_WINDOW = 99, | 
| wilsonshih | 599042f | 2020-05-04 16:24:58 +0800 | [diff] [blame] | 83 |         FIRST_SUB_WINDOW = 1000, | 
 | 84 |         TYPE_APPLICATION_PANEL = FIRST_SUB_WINDOW, | 
 | 85 |         TYPE_APPLICATION_MEDIA = FIRST_SUB_WINDOW + 1, | 
 | 86 |         TYPE_APPLICATION_SUB_PANEL = FIRST_SUB_WINDOW + 2, | 
 | 87 |         TYPE_APPLICATION_ATTACHED_DIALOG = FIRST_SUB_WINDOW + 3, | 
 | 88 |         TYPE_APPLICATION_MEDIA_OVERLAY = FIRST_SUB_WINDOW + 4, | 
 | 89 |         LAST_SUB_WINDOW = 1999, | 
 | 90 |         FIRST_SYSTEM_WINDOW = 2000, | 
 | 91 |         TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW, | 
 | 92 |         TYPE_SEARCH_BAR = FIRST_SYSTEM_WINDOW + 1, | 
 | 93 |         TYPE_PHONE = FIRST_SYSTEM_WINDOW + 2, | 
 | 94 |         TYPE_SYSTEM_ALERT = FIRST_SYSTEM_WINDOW + 3, | 
 | 95 |         TYPE_KEYGUARD = FIRST_SYSTEM_WINDOW + 4, | 
 | 96 |         TYPE_TOAST = FIRST_SYSTEM_WINDOW + 5, | 
 | 97 |         TYPE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW + 6, | 
 | 98 |         TYPE_PRIORITY_PHONE = FIRST_SYSTEM_WINDOW + 7, | 
 | 99 |         TYPE_SYSTEM_DIALOG = FIRST_SYSTEM_WINDOW + 8, | 
 | 100 |         TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW + 9, | 
 | 101 |         TYPE_SYSTEM_ERROR = FIRST_SYSTEM_WINDOW + 10, | 
 | 102 |         TYPE_INPUT_METHOD = FIRST_SYSTEM_WINDOW + 11, | 
 | 103 |         TYPE_INPUT_METHOD_DIALOG = FIRST_SYSTEM_WINDOW + 12, | 
 | 104 |         TYPE_WALLPAPER = FIRST_SYSTEM_WINDOW + 13, | 
 | 105 |         TYPE_STATUS_BAR_PANEL = FIRST_SYSTEM_WINDOW + 14, | 
 | 106 |         TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW + 15, | 
 | 107 |         TYPE_DRAG = FIRST_SYSTEM_WINDOW + 16, | 
 | 108 |         TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW + 17, | 
 | 109 |         TYPE_POINTER = FIRST_SYSTEM_WINDOW + 18, | 
 | 110 |         TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW + 19, | 
 | 111 |         TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW + 20, | 
 | 112 |         TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW + 21, | 
 | 113 |         TYPE_INPUT_CONSUMER = FIRST_SYSTEM_WINDOW + 22, | 
 | 114 |         TYPE_NAVIGATION_BAR_PANEL = FIRST_SYSTEM_WINDOW + 24, | 
 | 115 |         TYPE_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 27, | 
 | 116 |         TYPE_ACCESSIBILITY_OVERLAY = FIRST_SYSTEM_WINDOW + 32, | 
 | 117 |         TYPE_DOCK_DIVIDER = FIRST_SYSTEM_WINDOW + 34, | 
 | 118 |         TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY = FIRST_SYSTEM_WINDOW + 39, | 
 | 119 |         TYPE_NOTIFICATION_SHADE = FIRST_SYSTEM_WINDOW + 40, | 
 | 120 |         LAST_SYSTEM_WINDOW = 2999, | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 121 |     }; | 
 | 122 |  | 
 | 123 |     enum { | 
 | 124 |         INPUT_FEATURE_DISABLE_TOUCH_PAD_GESTURES = 0x00000001, | 
 | 125 |         INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002, | 
 | 126 |         INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004, | 
 | 127 |     }; | 
| Vishnu Nair | 6fabeec | 2019-03-12 13:42:49 -0700 | [diff] [blame] | 128 |  | 
| Robert Carr | 5cb2578 | 2018-11-14 14:01:42 -0800 | [diff] [blame] | 129 |     /* These values are filled in by the WM and passed through SurfaceFlinger | 
 | 130 |      * unless specified otherwise. | 
 | 131 |      */ | 
| chaviw | af87b3e | 2019-10-01 16:59:28 -0700 | [diff] [blame] | 132 |     // This value should NOT be used to uniquely identify the window. There may be different | 
 | 133 |     // input windows that have the same token. | 
| Robert Carr | 5c8a026 | 2018-10-03 16:30:44 -0700 | [diff] [blame] | 134 |     sp<IBinder> token; | 
| chaviw | af87b3e | 2019-10-01 16:59:28 -0700 | [diff] [blame] | 135 |     // This uniquely identifies the input window. | 
| Robert Carr | 7174efe | 2020-04-13 16:55:27 -0700 | [diff] [blame] | 136 |     int32_t id = -1; | 
| Siarhei Vishniakou | f93fcf4 | 2017-11-22 16:00:14 -0800 | [diff] [blame] | 137 |     std::string name; | 
| Robert Carr | 7174efe | 2020-04-13 16:55:27 -0700 | [diff] [blame] | 138 |     int32_t layoutParamsFlags = 0; | 
 | 139 |     int32_t layoutParamsType = 0; | 
| Siarhei Vishniakou | c1ae556 | 2020-06-30 14:22:57 -0500 | [diff] [blame] | 140 |     std::chrono::nanoseconds dispatchingTimeout = std::chrono::seconds(5); | 
| Robert Carr | 5cb2578 | 2018-11-14 14:01:42 -0800 | [diff] [blame] | 141 |  | 
 | 142 |     /* These values are filled in by SurfaceFlinger. */ | 
| Robert Carr | 7174efe | 2020-04-13 16:55:27 -0700 | [diff] [blame] | 143 |     int32_t frameLeft = -1; | 
 | 144 |     int32_t frameTop = -1; | 
 | 145 |     int32_t frameRight = -1; | 
 | 146 |     int32_t frameBottom = -1; | 
| Robert Carr | 5cb2578 | 2018-11-14 14:01:42 -0800 | [diff] [blame] | 147 |  | 
 | 148 |     /* | 
 | 149 |      * SurfaceFlinger consumes this value to shrink the computed frame. This is | 
 | 150 |      * different from shrinking the touchable region in that it DOES shift the coordinate | 
 | 151 |      * space where-as the touchable region does not and is more like "cropping". This | 
 | 152 |      * is used for window shadows. | 
 | 153 |      */ | 
 | 154 |     int32_t surfaceInset = 0; | 
 | 155 |  | 
| Robert Carr | e07e103 | 2018-11-26 12:55:53 -0800 | [diff] [blame] | 156 |     // A global scaling factor for all windows. Unlike windowScaleX/Y this results | 
 | 157 |     // in scaling of the TOUCH_MAJOR/TOUCH_MINOR axis. | 
| Robert Carr | 7174efe | 2020-04-13 16:55:27 -0700 | [diff] [blame] | 158 |     float globalScaleFactor = 1.0f; | 
| Robert Carr | e07e103 | 2018-11-26 12:55:53 -0800 | [diff] [blame] | 159 |  | 
 | 160 |     // Scaling factors applied to individual windows. | 
 | 161 |     float windowXScale = 1.0f; | 
 | 162 |     float windowYScale = 1.0f; | 
| Robert Carr | 5cb2578 | 2018-11-14 14:01:42 -0800 | [diff] [blame] | 163 |  | 
| chaviw | fd9c1ed | 2020-07-01 10:57:59 -0700 | [diff] [blame] | 164 |     // Transform applied to individual windows. | 
 | 165 |     ui::Transform transform; | 
 | 166 |  | 
| Robert Carr | 5cb2578 | 2018-11-14 14:01:42 -0800 | [diff] [blame] | 167 |     /* | 
 | 168 |      * This is filled in by the WM relative to the frame and then translated | 
 | 169 |      * to absolute coordinates by SurfaceFlinger once the frame is computed. | 
 | 170 |      */ | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 171 |     Region touchableRegion; | 
| Robert Carr | 7174efe | 2020-04-13 16:55:27 -0700 | [diff] [blame] | 172 |     bool visible = false; | 
 | 173 |     bool canReceiveKeys = false; | 
 | 174 |     bool hasFocus = false; | 
 | 175 |     bool hasWallpaper = false; | 
 | 176 |     bool paused = false; | 
| Chris Ye | fcdff3e | 2020-05-10 15:16:04 -0700 | [diff] [blame] | 177 |     /* This flag is set when the window is of a trusted type that is allowed to silently | 
 | 178 |      * overlay other windows for the purpose of implementing the secure views feature. | 
 | 179 |      * Trusted overlays, such as IME windows, can partly obscure other windows without causing | 
 | 180 |      * motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED. | 
 | 181 |      */ | 
 | 182 |     bool trustedOverlay = false; | 
| Robert Carr | 7174efe | 2020-04-13 16:55:27 -0700 | [diff] [blame] | 183 |     int32_t ownerPid = -1; | 
 | 184 |     int32_t ownerUid = -1; | 
 | 185 |     int32_t inputFeatures = 0; | 
 | 186 |     int32_t displayId = ADISPLAY_ID_NONE; | 
| Tiger Huang | 85b8c5e | 2019-01-17 18:34:54 +0800 | [diff] [blame] | 187 |     int32_t portalToDisplayId = ADISPLAY_ID_NONE; | 
| Robert Carr | 740167f | 2018-10-11 19:03:41 -0700 | [diff] [blame] | 188 |     InputApplicationInfo applicationInfo; | 
| Robert Carr | 7174efe | 2020-04-13 16:55:27 -0700 | [diff] [blame] | 189 |     bool replaceTouchableRegionWithCrop = false; | 
| Vishnu Nair | 6fabeec | 2019-03-12 13:42:49 -0700 | [diff] [blame] | 190 |     wp<IBinder> touchableRegionCropHandle; | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 191 |  | 
 | 192 |     void addTouchableRegion(const Rect& region); | 
 | 193 |  | 
 | 194 |     bool touchableRegionContainsPoint(int32_t x, int32_t y) const; | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 195 |  | 
| Chris Ye | fcdff3e | 2020-05-10 15:16:04 -0700 | [diff] [blame] | 196 |     bool frameContainsPoint(int32_t x, int32_t y) const; | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 197 |  | 
 | 198 |     bool supportsSplitTouch() const; | 
| Michael Wright | cdcd8f2 | 2016-03-22 16:52:13 -0700 | [diff] [blame] | 199 |  | 
 | 200 |     bool overlaps(const InputWindowInfo* other) const; | 
| Robert Carr | 3720ed0 | 2018-08-08 16:08:27 -0700 | [diff] [blame] | 201 |  | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 202 |     bool operator==(const InputWindowInfo& inputChannel) const; | 
| Chris Ye | fcdff3e | 2020-05-10 15:16:04 -0700 | [diff] [blame] | 203 |  | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 204 |     status_t writeToParcel(android::Parcel* parcel) const override; | 
 | 205 |  | 
 | 206 |     status_t readFromParcel(const android::Parcel* parcel) override; | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 207 | }; | 
 | 208 |  | 
| Siarhei Vishniakou | 67d4450 | 2020-04-09 11:09:29 -0700 | [diff] [blame] | 209 | std::string inputWindowFlagsToString(uint32_t flags); | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 210 |  | 
 | 211 | /* | 
 | 212 |  * Handle for a window that can receive input. | 
 | 213 |  * | 
 | 214 |  * Used by the native input dispatcher to indirectly refer to the window manager objects | 
 | 215 |  * that describe a window. | 
 | 216 |  */ | 
 | 217 | class InputWindowHandle : public RefBase { | 
 | 218 | public: | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 219 |     explicit InputWindowHandle(); | 
 | 220 |     InputWindowHandle(const InputWindowHandle& other); | 
 | 221 |     InputWindowHandle(const InputWindowInfo& other); | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 222 |  | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 223 |     inline const InputWindowInfo* getInfo() const { return &mInfo; } | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 224 |  | 
| Robert Carr | 5c8a026 | 2018-10-03 16:30:44 -0700 | [diff] [blame] | 225 |     sp<IBinder> getToken() const; | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 226 |  | 
| chaviw | af87b3e | 2019-10-01 16:59:28 -0700 | [diff] [blame] | 227 |     int32_t getId() const { return mInfo.id; } | 
 | 228 |  | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 229 |     sp<IBinder> getApplicationToken() { return mInfo.applicationInfo.token; } | 
| Robert Carr | 740167f | 2018-10-11 19:03:41 -0700 | [diff] [blame] | 230 |  | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 231 |     inline std::string getName() const { return !mInfo.name.empty() ? mInfo.name : "<invalid>"; } | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 232 |  | 
| Siarhei Vishniakou | 4cb50ca | 2020-05-26 21:43:02 -0700 | [diff] [blame] | 233 |     inline std::chrono::nanoseconds getDispatchingTimeout( | 
 | 234 |             std::chrono::nanoseconds defaultValue) const { | 
 | 235 |         return mInfo.token ? std::chrono::nanoseconds(mInfo.dispatchingTimeout) : defaultValue; | 
 | 236 |     } | 
 | 237 |  | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 238 |     /** | 
 | 239 |      * Requests that the state of this object be updated to reflect | 
 | 240 |      * the most current available information about the application. | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 241 |      * As this class is created as RefBase object, no pure virtual function is allowed. | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 242 |      * | 
 | 243 |      * This method should only be called from within the input dispatcher's | 
 | 244 |      * critical section. | 
 | 245 |      * | 
 | 246 |      * Returns true on success, or false if the handle is no longer valid. | 
 | 247 |      */ | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 248 |     virtual bool updateInfo() { return false; } | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 249 |  | 
 | 250 |     /** | 
| Garfield Tan | bd0fbcd | 2018-11-30 12:45:03 -0800 | [diff] [blame] | 251 |      * Updates from another input window handle. | 
 | 252 |      */ | 
 | 253 |     void updateFrom(const sp<InputWindowHandle> handle); | 
 | 254 |  | 
 | 255 |     /** | 
| Arthur Hung | 3b413f2 | 2018-10-26 18:05:34 +0800 | [diff] [blame] | 256 |      * Releases the channel used by the associated information when it is | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 257 |      * no longer needed. | 
 | 258 |      */ | 
| Arthur Hung | 3b413f2 | 2018-10-26 18:05:34 +0800 | [diff] [blame] | 259 |     void releaseChannel(); | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 260 |  | 
| Chris Ye | 0783e99 | 2020-06-02 21:34:49 -0700 | [diff] [blame] | 261 |     // Not override since this class is not derrived from Parcelable. | 
 | 262 |     status_t readFromParcel(const android::Parcel* parcel); | 
 | 263 |     status_t writeToParcel(android::Parcel* parcel) const; | 
 | 264 |  | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 265 | protected: | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 266 |     virtual ~InputWindowHandle(); | 
 | 267 |  | 
| Arthur Hung | 3b413f2 | 2018-10-26 18:05:34 +0800 | [diff] [blame] | 268 |     InputWindowInfo mInfo; | 
| Michael Wright | d02c5b6 | 2014-02-10 15:10:22 -0800 | [diff] [blame] | 269 | }; | 
 | 270 |  | 
 | 271 | } // namespace android | 
 | 272 |  | 
 | 273 | #endif // _UI_INPUT_WINDOW_H |