Jeff Brown | 4ccb823 | 2014-01-16 22:16:42 -0800 | [diff] [blame] | 1 | /* |
Adrian Roos | e99bc05 | 2017-11-20 17:55:31 +0100 | [diff] [blame] | 2 | * Copyright (C) 2017 The Android Open Source Project |
Jeff Brown | 4ccb823 | 2014-01-16 22:16:42 -0800 | [diff] [blame] | 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 | |
Adrian Roos | e99bc05 | 2017-11-20 17:55:31 +0100 | [diff] [blame] | 17 | package com.android.server.wm; |
Jeff Brown | 4ccb823 | 2014-01-16 22:16:42 -0800 | [diff] [blame] | 18 | |
Alan Viverette | 59e53a1 | 2016-03-28 13:41:32 -0400 | [diff] [blame] | 19 | import android.annotation.NonNull; |
Alan Viverette | 214fb68 | 2015-11-17 09:47:11 -0500 | [diff] [blame] | 20 | import android.annotation.Nullable; |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 21 | import android.content.ClipData; |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 22 | import android.graphics.Rect; |
| 23 | import android.graphics.Region; |
Jeff Brown | 4ccb823 | 2014-01-16 22:16:42 -0800 | [diff] [blame] | 24 | import android.hardware.display.DisplayManagerInternal; |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 25 | import android.os.IBinder; |
Daichi Hirono | 4a54517 | 2018-02-01 10:59:48 +0900 | [diff] [blame] | 26 | import android.view.Display; |
Adrian Roos | e99bc05 | 2017-11-20 17:55:31 +0100 | [diff] [blame] | 27 | import android.view.IInputFilter; |
| 28 | import android.view.IWindow; |
Daichi Hirono | 4a54517 | 2018-02-01 10:59:48 +0900 | [diff] [blame] | 29 | import android.view.InputChannel; |
Adrian Roos | e99bc05 | 2017-11-20 17:55:31 +0100 | [diff] [blame] | 30 | import android.view.MagnificationSpec; |
| 31 | import android.view.WindowInfo; |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 32 | |
Daichi Hirono | 4a54517 | 2018-02-01 10:59:48 +0900 | [diff] [blame] | 33 | import com.android.server.input.InputManagerService; |
Adrian Roos | e99bc05 | 2017-11-20 17:55:31 +0100 | [diff] [blame] | 34 | import com.android.server.policy.WindowManagerPolicy; |
| 35 | |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 36 | import java.util.List; |
Jeff Brown | 4ccb823 | 2014-01-16 22:16:42 -0800 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * Window manager local system service interface. |
| 40 | * |
| 41 | * @hide Only for use within the system server. |
| 42 | */ |
| 43 | public abstract class WindowManagerInternal { |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * Interface to receive a callback when the windows reported for |
| 47 | * accessibility changed. |
| 48 | */ |
| 49 | public interface WindowsForAccessibilityCallback { |
| 50 | |
| 51 | /** |
| 52 | * Called when the windows for accessibility changed. |
| 53 | * |
| 54 | * @param windows The windows for accessibility. |
| 55 | */ |
| 56 | public void onWindowsForAccessibilityChanged(List<WindowInfo> windows); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Callbacks for contextual changes that affect the screen magnification |
| 61 | * feature. |
| 62 | */ |
| 63 | public interface MagnificationCallbacks { |
| 64 | |
| 65 | /** |
Phil Weaver | 7043924 | 2016-03-10 15:15:49 -0800 | [diff] [blame] | 66 | * Called when the region where magnification operates changes. Note that this isn't the |
| 67 | * entire screen. For example, IMEs are not magnified. |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 68 | * |
Phil Weaver | 7043924 | 2016-03-10 15:15:49 -0800 | [diff] [blame] | 69 | * @param magnificationRegion the current magnification region |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 70 | */ |
Phil Weaver | 7043924 | 2016-03-10 15:15:49 -0800 | [diff] [blame] | 71 | public void onMagnificationRegionChanged(Region magnificationRegion); |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 72 | |
| 73 | /** |
| 74 | * Called when an application requests a rectangle on the screen to allow |
| 75 | * the client to apply the appropriate pan and scale. |
| 76 | * |
| 77 | * @param left The rectangle left. |
| 78 | * @param top The rectangle top. |
| 79 | * @param right The rectangle right. |
| 80 | * @param bottom The rectangle bottom. |
| 81 | */ |
| 82 | public void onRectangleOnScreenRequested(int left, int top, int right, int bottom); |
| 83 | |
| 84 | /** |
| 85 | * Notifies that the rotation changed. |
| 86 | * |
| 87 | * @param rotation The current rotation. |
| 88 | */ |
| 89 | public void onRotationChanged(int rotation); |
| 90 | |
| 91 | /** |
| 92 | * Notifies that the context of the user changed. For example, an application |
| 93 | * was started. |
| 94 | */ |
| 95 | public void onUserContextChanged(); |
| 96 | } |
| 97 | |
Jeff Brown | 4ccb823 | 2014-01-16 22:16:42 -0800 | [diff] [blame] | 98 | /** |
Jorim Jaggi | 77ba480 | 2015-02-18 13:57:50 +0100 | [diff] [blame] | 99 | * Abstract class to be notified about {@link com.android.server.wm.AppTransition} events. Held |
| 100 | * as an abstract class so a listener only needs to implement the methods of its interest. |
| 101 | */ |
| 102 | public static abstract class AppTransitionListener { |
| 103 | |
| 104 | /** |
| 105 | * Called when an app transition is being setup and about to be executed. |
| 106 | */ |
| 107 | public void onAppTransitionPendingLocked() {} |
| 108 | |
| 109 | /** |
| 110 | * Called when a pending app transition gets cancelled. |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 111 | * |
| 112 | * @param transit transition type indicating what kind of transition got cancelled |
Jorim Jaggi | 77ba480 | 2015-02-18 13:57:50 +0100 | [diff] [blame] | 113 | */ |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 114 | public void onAppTransitionCancelledLocked(int transit) {} |
Jorim Jaggi | 77ba480 | 2015-02-18 13:57:50 +0100 | [diff] [blame] | 115 | |
| 116 | /** |
| 117 | * Called when an app transition gets started |
| 118 | * |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 119 | * @param transit transition type indicating what kind of transition gets run, must be one |
| 120 | * of AppTransition.TRANSIT_* values |
Jorim Jaggi | 77ba480 | 2015-02-18 13:57:50 +0100 | [diff] [blame] | 121 | * @param openToken the token for the opening app |
| 122 | * @param closeToken the token for the closing app |
Jorim Jaggi | f5f9e12 | 2017-10-24 18:21:09 +0200 | [diff] [blame] | 123 | * @param duration the total duration of the transition |
| 124 | * @param statusBarAnimationStartTime the desired start time for all visual animations in |
| 125 | * the status bar caused by this app transition in uptime millis |
| 126 | * @param statusBarAnimationDuration the duration for all visual animations in the status |
| 127 | * bar caused by this app transition in millis |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 128 | * |
| 129 | * @return Return any bit set of {@link WindowManagerPolicy#FINISH_LAYOUT_REDO_LAYOUT}, |
| 130 | * {@link WindowManagerPolicy#FINISH_LAYOUT_REDO_CONFIG}, |
| 131 | * {@link WindowManagerPolicy#FINISH_LAYOUT_REDO_WALLPAPER}, |
| 132 | * or {@link WindowManagerPolicy#FINISH_LAYOUT_REDO_ANIM}. |
Jorim Jaggi | 77ba480 | 2015-02-18 13:57:50 +0100 | [diff] [blame] | 133 | */ |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 134 | public int onAppTransitionStartingLocked(int transit, IBinder openToken, IBinder closeToken, |
Jorim Jaggi | f5f9e12 | 2017-10-24 18:21:09 +0200 | [diff] [blame] | 135 | long duration, long statusBarAnimationStartTime, long statusBarAnimationDuration) { |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 136 | return 0; |
| 137 | } |
Jorim Jaggi | 77ba480 | 2015-02-18 13:57:50 +0100 | [diff] [blame] | 138 | |
| 139 | /** |
| 140 | * Called when an app transition is finished running. |
| 141 | * |
| 142 | * @param token the token for app whose transition has finished |
| 143 | */ |
| 144 | public void onAppTransitionFinishedLocked(IBinder token) {} |
| 145 | } |
| 146 | |
| 147 | /** |
Seigo Nonaka | 7309b12 | 2015-08-17 18:34:13 -0700 | [diff] [blame] | 148 | * An interface to be notified about hardware keyboard status. |
| 149 | */ |
| 150 | public interface OnHardKeyboardStatusChangeListener { |
| 151 | public void onHardKeyboardStatusChange(boolean available); |
| 152 | } |
| 153 | |
| 154 | /** |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 155 | * An interface to customize drag and drop behaviors. |
| 156 | */ |
| 157 | public interface IDragDropCallback { |
Daichi Hirono | 4a54517 | 2018-02-01 10:59:48 +0900 | [diff] [blame] | 158 | default boolean registerInputChannel( |
| 159 | DragState state, Display display, InputManagerService service, |
| 160 | InputChannel source) { |
| 161 | state.register(display); |
| 162 | return service.transferTouchFocus(source, state.getInputChannel()); |
| 163 | } |
| 164 | |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 165 | /** |
Daichi Hirono | bb28efb | 2017-11-21 15:11:01 +0900 | [diff] [blame] | 166 | * Called when drag operation is starting. |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 167 | */ |
Daichi Hirono | bb28efb | 2017-11-21 15:11:01 +0900 | [diff] [blame] | 168 | default boolean prePerformDrag(IWindow window, IBinder dragToken, |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 169 | int touchSource, float touchX, float touchY, float thumbCenterX, float thumbCenterY, |
| 170 | ClipData data) { |
| 171 | return true; |
| 172 | } |
| 173 | |
| 174 | /** |
Daichi Hirono | bb28efb | 2017-11-21 15:11:01 +0900 | [diff] [blame] | 175 | * Called when drag operation is started. |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 176 | */ |
Daichi Hirono | bb28efb | 2017-11-21 15:11:01 +0900 | [diff] [blame] | 177 | default void postPerformDrag() {} |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 178 | |
| 179 | /** |
Daichi Hirono | bb28efb | 2017-11-21 15:11:01 +0900 | [diff] [blame] | 180 | * Called when drop result is being reported. |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 181 | */ |
Daichi Hirono | bb28efb | 2017-11-21 15:11:01 +0900 | [diff] [blame] | 182 | default void preReportDropResult(IWindow window, boolean consumed) {} |
| 183 | |
| 184 | /** |
| 185 | * Called when drop result was reported. |
| 186 | */ |
| 187 | default void postReportDropResult() {} |
| 188 | |
| 189 | /** |
| 190 | * Called when drag operation is being cancelled. |
| 191 | */ |
| 192 | default void preCancelDragAndDrop(IBinder dragToken) {} |
| 193 | |
| 194 | /** |
| 195 | * Called when drag operation was cancelled. |
| 196 | */ |
| 197 | default void postCancelDragAndDrop() {} |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | /** |
Jeff Brown | 4ccb823 | 2014-01-16 22:16:42 -0800 | [diff] [blame] | 201 | * Request that the window manager call |
| 202 | * {@link DisplayManagerInternal#performTraversalInTransactionFromWindowManager} |
| 203 | * within a surface transaction at a later time. |
| 204 | */ |
| 205 | public abstract void requestTraversalFromDisplayManager(); |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 206 | |
| 207 | /** |
| 208 | * Set by the accessibility layer to observe changes in the magnified region, |
| 209 | * rotation, and other window transformations related to display magnification |
| 210 | * as the window manager is responsible for doing the actual magnification |
| 211 | * and has access to the raw window data while the accessibility layer serves |
| 212 | * as a controller. |
| 213 | * |
| 214 | * @param callbacks The callbacks to invoke. |
| 215 | */ |
Alan Viverette | 214fb68 | 2015-11-17 09:47:11 -0500 | [diff] [blame] | 216 | public abstract void setMagnificationCallbacks(@Nullable MagnificationCallbacks callbacks); |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 217 | |
| 218 | /** |
| 219 | * Set by the accessibility layer to specify the magnification and panning to |
| 220 | * be applied to all windows that should be magnified. |
| 221 | * |
Craig Mautner | 8a0da01 | 2014-05-31 15:13:37 -0700 | [diff] [blame] | 222 | * @param spec The MagnficationSpec to set. |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 223 | * |
| 224 | * @see #setMagnificationCallbacks(MagnificationCallbacks) |
| 225 | */ |
| 226 | public abstract void setMagnificationSpec(MagnificationSpec spec); |
| 227 | |
| 228 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 229 | * Set by the accessibility framework to indicate whether the magnifiable regions of the display |
| 230 | * should be shown. |
| 231 | * |
| 232 | * @param show {@code true} to show magnifiable region bounds, {@code false} to hide |
| 233 | */ |
| 234 | public abstract void setForceShowMagnifiableBounds(boolean show); |
| 235 | |
| 236 | /** |
Phil Weaver | 7043924 | 2016-03-10 15:15:49 -0800 | [diff] [blame] | 237 | * Obtains the magnification regions. |
Alan Viverette | 59e53a1 | 2016-03-28 13:41:32 -0400 | [diff] [blame] | 238 | * |
Phil Weaver | 7043924 | 2016-03-10 15:15:49 -0800 | [diff] [blame] | 239 | * @param magnificationRegion the current magnification region |
Alan Viverette | 59e53a1 | 2016-03-28 13:41:32 -0400 | [diff] [blame] | 240 | */ |
Phil Weaver | 7043924 | 2016-03-10 15:15:49 -0800 | [diff] [blame] | 241 | public abstract void getMagnificationRegion(@NonNull Region magnificationRegion); |
Alan Viverette | 59e53a1 | 2016-03-28 13:41:32 -0400 | [diff] [blame] | 242 | |
| 243 | /** |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 244 | * Gets the magnification and translation applied to a window given its token. |
| 245 | * Not all windows are magnified and the window manager policy determines which |
| 246 | * windows are magnified. The returned result also takes into account the compat |
| 247 | * scale if necessary. |
| 248 | * |
| 249 | * @param windowToken The window's token. |
| 250 | * |
| 251 | * @return The magnification spec for the window. |
| 252 | * |
| 253 | * @see #setMagnificationCallbacks(MagnificationCallbacks) |
| 254 | */ |
| 255 | public abstract MagnificationSpec getCompatibleMagnificationSpecForWindow( |
| 256 | IBinder windowToken); |
| 257 | |
| 258 | /** |
| 259 | * Sets a callback for observing which windows are touchable for the purposes |
| 260 | * of accessibility. |
| 261 | * |
| 262 | * @param callback The callback. |
| 263 | */ |
| 264 | public abstract void setWindowsForAccessibilityCallback( |
| 265 | WindowsForAccessibilityCallback callback); |
| 266 | |
| 267 | /** |
| 268 | * Sets a filter for manipulating the input event stream. |
| 269 | * |
| 270 | * @param filter The filter implementation. |
| 271 | */ |
| 272 | public abstract void setInputFilter(IInputFilter filter); |
| 273 | |
| 274 | /** |
| 275 | * Gets the token of the window that has input focus. |
| 276 | * |
| 277 | * @return The token. |
| 278 | */ |
| 279 | public abstract IBinder getFocusedWindowToken(); |
| 280 | |
| 281 | /** |
| 282 | * @return Whether the keyguard is engaged. |
| 283 | */ |
| 284 | public abstract boolean isKeyguardLocked(); |
| 285 | |
| 286 | /** |
Jonathan Solnit | 6e8d709 | 2017-06-15 15:17:20 -0700 | [diff] [blame] | 287 | * @return Whether the keyguard is showing and not occluded. |
| 288 | */ |
| 289 | public abstract boolean isKeyguardShowingAndNotOccluded(); |
| 290 | |
| 291 | /** |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 292 | * Gets the frame of a window given its token. |
| 293 | * |
| 294 | * @param token The token. |
| 295 | * @param outBounds The frame to populate. |
| 296 | */ |
| 297 | public abstract void getWindowFrame(IBinder token, Rect outBounds); |
Craig Mautner | 8a0da01 | 2014-05-31 15:13:37 -0700 | [diff] [blame] | 298 | |
| 299 | /** |
Alan Viverette | e34560b2 | 2014-07-10 14:50:06 -0700 | [diff] [blame] | 300 | * Opens the global actions dialog. |
| 301 | */ |
| 302 | public abstract void showGlobalActions(); |
| 303 | |
| 304 | /** |
Craig Mautner | 8a0da01 | 2014-05-31 15:13:37 -0700 | [diff] [blame] | 305 | * Invalidate all visible windows. Then report back on the callback once all windows have |
| 306 | * redrawn. |
| 307 | */ |
Craig Mautner | 13f6ea7 | 2014-06-23 14:57:02 -0700 | [diff] [blame] | 308 | public abstract void waitForAllWindowsDrawn(Runnable callback, long timeout); |
Svetoslav | 3a5c721 | 2014-10-14 09:54:26 -0700 | [diff] [blame] | 309 | |
| 310 | /** |
| 311 | * Adds a window token for a given window type. |
| 312 | * |
| 313 | * @param token The token to add. |
| 314 | * @param type The window type. |
Wale Ogunwale | ac2561e | 2016-11-01 15:43:46 -0700 | [diff] [blame] | 315 | * @param displayId The display to add the token to. |
Svetoslav | 3a5c721 | 2014-10-14 09:54:26 -0700 | [diff] [blame] | 316 | */ |
Wale Ogunwale | ac2561e | 2016-11-01 15:43:46 -0700 | [diff] [blame] | 317 | public abstract void addWindowToken(android.os.IBinder token, int type, int displayId); |
Svetoslav | 3a5c721 | 2014-10-14 09:54:26 -0700 | [diff] [blame] | 318 | |
| 319 | /** |
| 320 | * Removes a window token. |
| 321 | * |
| 322 | * @param token The toke to remove. |
| 323 | * @param removeWindows Whether to also remove the windows associated with the token. |
Wale Ogunwale | ac2561e | 2016-11-01 15:43:46 -0700 | [diff] [blame] | 324 | * @param displayId The display to remove the token from. |
Svetoslav | 3a5c721 | 2014-10-14 09:54:26 -0700 | [diff] [blame] | 325 | */ |
Wale Ogunwale | ac2561e | 2016-11-01 15:43:46 -0700 | [diff] [blame] | 326 | public abstract void removeWindowToken(android.os.IBinder token, boolean removeWindows, |
| 327 | int displayId); |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 328 | |
| 329 | /** |
| 330 | * Registers a listener to be notified about app transition events. |
| 331 | * |
| 332 | * @param listener The listener to register. |
| 333 | */ |
| 334 | public abstract void registerAppTransitionListener(AppTransitionListener listener); |
Seigo Nonaka | 7309b12 | 2015-08-17 18:34:13 -0700 | [diff] [blame] | 335 | |
| 336 | /** |
| 337 | * Retrieves a height of input method window. |
| 338 | */ |
| 339 | public abstract int getInputMethodWindowVisibleHeight(); |
| 340 | |
| 341 | /** |
| 342 | * Saves last input method window for transition. |
| 343 | * |
| 344 | * Note that it is assumed that this method is called only by InputMethodManagerService. |
| 345 | */ |
| 346 | public abstract void saveLastInputMethodWindowForTransition(); |
| 347 | |
| 348 | /** |
Yohei Yukawa | 833bdce | 2016-05-15 20:05:56 -0700 | [diff] [blame] | 349 | * Clears last input method window for transition. |
| 350 | * |
| 351 | * Note that it is assumed that this method is called only by InputMethodManagerService. |
| 352 | */ |
| 353 | public abstract void clearLastInputMethodWindowForTransition(); |
| 354 | |
| 355 | /** |
Yohei Yukawa | 69e6802 | 2017-02-13 12:04:50 -0800 | [diff] [blame] | 356 | * Notifies WindowManagerService that the current IME window status is being changed. |
| 357 | * |
| 358 | * <p>Only {@link com.android.server.InputMethodManagerService} is the expected and tested |
| 359 | * caller of this method.</p> |
| 360 | * |
| 361 | * @param imeToken token to track the active input method. Corresponding IME windows can be |
| 362 | * identified by checking {@link android.view.WindowManager.LayoutParams#token}. |
| 363 | * Note that there is no guarantee that the corresponding window is already |
| 364 | * created |
| 365 | * @param imeWindowVisible whether the active IME thinks that its window should be visible or |
| 366 | * hidden, no matter how WindowManagerService will react / has reacted |
| 367 | * to corresponding API calls. Note that this state is not guaranteed |
| 368 | * to be synchronized with state in WindowManagerService. |
Yohei Yukawa | d6475a6 | 2017-04-17 10:35:27 -0700 | [diff] [blame] | 369 | * @param dismissImeOnBackKeyPressed {@code true} if the software keyboard is shown and the back |
| 370 | * key is expected to dismiss the software keyboard. |
Yohei Yukawa | 69e6802 | 2017-02-13 12:04:50 -0800 | [diff] [blame] | 371 | * @param targetWindowToken token to identify the target window that the IME is associated with. |
Yohei Yukawa | ee2a7ed | 2017-02-15 21:38:57 -0800 | [diff] [blame] | 372 | * {@code null} when application, system, or the IME itself decided to |
| 373 | * change its window visibility before being associated with any target |
| 374 | * window. |
Yohei Yukawa | 69e6802 | 2017-02-13 12:04:50 -0800 | [diff] [blame] | 375 | */ |
Yohei Yukawa | ee2a7ed | 2017-02-15 21:38:57 -0800 | [diff] [blame] | 376 | public abstract void updateInputMethodWindowStatus(@NonNull IBinder imeToken, |
Yohei Yukawa | d6475a6 | 2017-04-17 10:35:27 -0700 | [diff] [blame] | 377 | boolean imeWindowVisible, boolean dismissImeOnBackKeyPressed, |
| 378 | @Nullable IBinder targetWindowToken); |
Yohei Yukawa | 69e6802 | 2017-02-13 12:04:50 -0800 | [diff] [blame] | 379 | |
| 380 | /** |
Seigo Nonaka | 7309b12 | 2015-08-17 18:34:13 -0700 | [diff] [blame] | 381 | * Returns true when the hardware keyboard is available. |
| 382 | */ |
| 383 | public abstract boolean isHardKeyboardAvailable(); |
| 384 | |
| 385 | /** |
| 386 | * Sets the callback listener for hardware keyboard status changes. |
| 387 | * |
| 388 | * @param listener The listener to set. |
| 389 | */ |
| 390 | public abstract void setOnHardKeyboardStatusChangeListener( |
| 391 | OnHardKeyboardStatusChangeListener listener); |
Wale Ogunwale | 6e94a9e | 2015-10-07 15:35:49 -0700 | [diff] [blame] | 392 | |
Wale Ogunwale | 44f036f | 2017-09-29 05:09:09 -0700 | [diff] [blame] | 393 | /** Returns true if a stack in the windowing mode is currently visible. */ |
| 394 | public abstract boolean isStackVisible(int windowingMode); |
Jorim Jaggi | 9511b0f | 2016-01-29 19:12:44 -0800 | [diff] [blame] | 395 | |
| 396 | /** |
| 397 | * @return True if and only if the docked divider is currently in resize mode. |
| 398 | */ |
| 399 | public abstract boolean isDockedDividerResizing(); |
Svetoslav Ganov | fd13889 | 2016-07-13 18:20:42 -0700 | [diff] [blame] | 400 | |
| 401 | /** |
| 402 | * Requests the window manager to recompute the windows for accessibility. |
| 403 | */ |
| 404 | public abstract void computeWindowsForAccessibility(); |
Tarandeep Singh | e1cfcf4 | 2017-07-10 18:50:00 -0700 | [diff] [blame] | 405 | |
| 406 | /** |
| 407 | * Called after virtual display Id is updated by |
| 408 | * {@link com.android.server.vr.Vr2dDisplay} with a specific |
| 409 | * {@param vr2dDisplayId}. |
| 410 | */ |
| 411 | public abstract void setVr2dDisplayId(int vr2dDisplayId); |
Daichi Hirono | 3c6c95e | 2017-09-13 12:23:57 +0900 | [diff] [blame] | 412 | |
| 413 | /** |
| 414 | * Sets callback to DragDropController. |
| 415 | */ |
| 416 | public abstract void registerDragDropControllerCallback(IDragDropCallback callback); |
Eugene Susla | f9a651d | 2017-10-11 12:06:27 -0700 | [diff] [blame] | 417 | |
| 418 | /** |
| 419 | * @see android.view.IWindowManager#lockNow |
| 420 | */ |
| 421 | public abstract void lockNow(); |
Tony Mak | 6f2e97e | 2018-03-26 20:43:06 +0100 | [diff] [blame] | 422 | |
| 423 | /** |
| 424 | * Return the user that owns the given window, {@link android.os.UserHandle#USER_NULL} if |
| 425 | * the window token is not found. |
| 426 | */ |
| 427 | public abstract int getWindowOwnerUserId(IBinder windowToken); |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 428 | } |