blob: 750926f11180a986fc532601a91626f1f682f3cd [file] [log] [blame]
Jeff Brown4ccb8232014-01-16 22:16:42 -08001/*
Adrian Roose99bc052017-11-20 17:55:31 +01002 * Copyright (C) 2017 The Android Open Source Project
Jeff Brown4ccb8232014-01-16 22:16:42 -08003 *
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 Roose99bc052017-11-20 17:55:31 +010017package com.android.server.wm;
Jeff Brown4ccb8232014-01-16 22:16:42 -080018
Alan Viverette59e53a12016-03-28 13:41:32 -040019import android.annotation.NonNull;
Alan Viverette214fb682015-11-17 09:47:11 -050020import android.annotation.Nullable;
Daichi Hirono3c6c95e2017-09-13 12:23:57 +090021import android.content.ClipData;
Svetoslav8e3feb12014-02-24 13:46:47 -080022import android.graphics.Rect;
23import android.graphics.Region;
Jeff Brown4ccb8232014-01-16 22:16:42 -080024import android.hardware.display.DisplayManagerInternal;
Svetoslav8e3feb12014-02-24 13:46:47 -080025import android.os.IBinder;
Daichi Hirono4a545172018-02-01 10:59:48 +090026import android.view.Display;
Adrian Roose99bc052017-11-20 17:55:31 +010027import android.view.IInputFilter;
28import android.view.IWindow;
Daichi Hirono4a545172018-02-01 10:59:48 +090029import android.view.InputChannel;
Adrian Roose99bc052017-11-20 17:55:31 +010030import android.view.MagnificationSpec;
31import android.view.WindowInfo;
Svetoslav8e3feb12014-02-24 13:46:47 -080032
Daichi Hirono4a545172018-02-01 10:59:48 +090033import com.android.server.input.InputManagerService;
Adrian Roose99bc052017-11-20 17:55:31 +010034import com.android.server.policy.WindowManagerPolicy;
35
Svetoslav8e3feb12014-02-24 13:46:47 -080036import java.util.List;
Jeff Brown4ccb8232014-01-16 22:16:42 -080037
38/**
39 * Window manager local system service interface.
40 *
41 * @hide Only for use within the system server.
42 */
43public abstract class WindowManagerInternal {
Svetoslav8e3feb12014-02-24 13:46:47 -080044
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 *
Jackal Guo28dce102019-05-28 14:25:17 +080054 * @param forceSend Send the windows for accessibility even if they haven't changed.
Jacky Kao81167402019-08-22 12:05:34 +080055 * @param topFocusedDisplayId The display Id which has the top focused window.
56 * @param topFocusedWindowToken The window token of top focused window.
Svetoslav8e3feb12014-02-24 13:46:47 -080057 * @param windows The windows for accessibility.
58 */
Jacky Kao81167402019-08-22 12:05:34 +080059 void onWindowsForAccessibilityChanged(boolean forceSend, int topFocusedDisplayId,
60 IBinder topFocusedWindowToken, @NonNull List<WindowInfo> windows);
Svetoslav8e3feb12014-02-24 13:46:47 -080061 }
62
63 /**
64 * Callbacks for contextual changes that affect the screen magnification
65 * feature.
66 */
67 public interface MagnificationCallbacks {
68
69 /**
Phil Weaver70439242016-03-10 15:15:49 -080070 * Called when the region where magnification operates changes. Note that this isn't the
71 * entire screen. For example, IMEs are not magnified.
Svetoslav8e3feb12014-02-24 13:46:47 -080072 *
Phil Weaver70439242016-03-10 15:15:49 -080073 * @param magnificationRegion the current magnification region
Svetoslav8e3feb12014-02-24 13:46:47 -080074 */
Phil Weaver70439242016-03-10 15:15:49 -080075 public void onMagnificationRegionChanged(Region magnificationRegion);
Svetoslav8e3feb12014-02-24 13:46:47 -080076
77 /**
78 * Called when an application requests a rectangle on the screen to allow
79 * the client to apply the appropriate pan and scale.
80 *
81 * @param left The rectangle left.
82 * @param top The rectangle top.
83 * @param right The rectangle right.
84 * @param bottom The rectangle bottom.
85 */
86 public void onRectangleOnScreenRequested(int left, int top, int right, int bottom);
87
88 /**
89 * Notifies that the rotation changed.
90 *
91 * @param rotation The current rotation.
92 */
93 public void onRotationChanged(int rotation);
94
95 /**
96 * Notifies that the context of the user changed. For example, an application
97 * was started.
98 */
99 public void onUserContextChanged();
100 }
101
Jeff Brown4ccb8232014-01-16 22:16:42 -0800102 /**
Jorim Jaggi77ba4802015-02-18 13:57:50 +0100103 * Abstract class to be notified about {@link com.android.server.wm.AppTransition} events. Held
104 * as an abstract class so a listener only needs to implement the methods of its interest.
105 */
106 public static abstract class AppTransitionListener {
107
108 /**
109 * Called when an app transition is being setup and about to be executed.
110 */
111 public void onAppTransitionPendingLocked() {}
112
113 /**
114 * Called when a pending app transition gets cancelled.
Jorim Jaggife762342016-10-13 14:33:27 +0200115 *
116 * @param transit transition type indicating what kind of transition got cancelled
Jorim Jaggi77ba4802015-02-18 13:57:50 +0100117 */
Jorim Jaggife762342016-10-13 14:33:27 +0200118 public void onAppTransitionCancelledLocked(int transit) {}
Jorim Jaggi77ba4802015-02-18 13:57:50 +0100119
120 /**
121 * Called when an app transition gets started
122 *
Jorim Jaggife762342016-10-13 14:33:27 +0200123 * @param transit transition type indicating what kind of transition gets run, must be one
124 * of AppTransition.TRANSIT_* values
Jorim Jaggif5f9e122017-10-24 18:21:09 +0200125 * @param duration the total duration of the transition
126 * @param statusBarAnimationStartTime the desired start time for all visual animations in
127 * the status bar caused by this app transition in uptime millis
128 * @param statusBarAnimationDuration the duration for all visual animations in the status
129 * bar caused by this app transition in millis
Jorim Jaggife762342016-10-13 14:33:27 +0200130 *
131 * @return Return any bit set of {@link WindowManagerPolicy#FINISH_LAYOUT_REDO_LAYOUT},
132 * {@link WindowManagerPolicy#FINISH_LAYOUT_REDO_CONFIG},
133 * {@link WindowManagerPolicy#FINISH_LAYOUT_REDO_WALLPAPER},
134 * or {@link WindowManagerPolicy#FINISH_LAYOUT_REDO_ANIM}.
Jorim Jaggi77ba4802015-02-18 13:57:50 +0100135 */
Evan Rosky2289ba12018-11-19 18:28:18 -0800136 public int onAppTransitionStartingLocked(int transit, long duration,
137 long statusBarAnimationStartTime, long statusBarAnimationDuration) {
Jorim Jaggife762342016-10-13 14:33:27 +0200138 return 0;
139 }
Jorim Jaggi77ba4802015-02-18 13:57:50 +0100140
141 /**
142 * Called when an app transition is finished running.
143 *
144 * @param token the token for app whose transition has finished
145 */
146 public void onAppTransitionFinishedLocked(IBinder token) {}
147 }
148
149 /**
Seigo Nonaka7309b122015-08-17 18:34:13 -0700150 * An interface to be notified about hardware keyboard status.
151 */
152 public interface OnHardKeyboardStatusChangeListener {
153 public void onHardKeyboardStatusChange(boolean available);
154 }
155
156 /**
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900157 * An interface to customize drag and drop behaviors.
158 */
159 public interface IDragDropCallback {
Daichi Hirono4a545172018-02-01 10:59:48 +0900160 default boolean registerInputChannel(
161 DragState state, Display display, InputManagerService service,
162 InputChannel source) {
chaviwb5e316c2018-12-26 15:39:15 -0800163 state.mTransferTouchFromToken = source.getToken();
Daichi Hirono4a545172018-02-01 10:59:48 +0900164 state.register(display);
chaviwb5e316c2018-12-26 15:39:15 -0800165 return true;
Daichi Hirono4a545172018-02-01 10:59:48 +0900166 }
167
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900168 /**
Daichi Hironobb28efb2017-11-21 15:11:01 +0900169 * Called when drag operation is starting.
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900170 */
Daichi Hironobb28efb2017-11-21 15:11:01 +0900171 default boolean prePerformDrag(IWindow window, IBinder dragToken,
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900172 int touchSource, float touchX, float touchY, float thumbCenterX, float thumbCenterY,
173 ClipData data) {
174 return true;
175 }
176
177 /**
Daichi Hironobb28efb2017-11-21 15:11:01 +0900178 * Called when drag operation is started.
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900179 */
Daichi Hironobb28efb2017-11-21 15:11:01 +0900180 default void postPerformDrag() {}
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900181
182 /**
Daichi Hironobb28efb2017-11-21 15:11:01 +0900183 * Called when drop result is being reported.
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900184 */
Daichi Hironobb28efb2017-11-21 15:11:01 +0900185 default void preReportDropResult(IWindow window, boolean consumed) {}
186
187 /**
188 * Called when drop result was reported.
189 */
190 default void postReportDropResult() {}
191
192 /**
193 * Called when drag operation is being cancelled.
194 */
195 default void preCancelDragAndDrop(IBinder dragToken) {}
196
197 /**
198 * Called when drag operation was cancelled.
199 */
200 default void postCancelDragAndDrop() {}
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900201 }
202
203 /**
Jeff Brown4ccb8232014-01-16 22:16:42 -0800204 * Request that the window manager call
205 * {@link DisplayManagerInternal#performTraversalInTransactionFromWindowManager}
206 * within a surface transaction at a later time.
207 */
208 public abstract void requestTraversalFromDisplayManager();
Svetoslav8e3feb12014-02-24 13:46:47 -0800209
210 /**
211 * Set by the accessibility layer to observe changes in the magnified region,
212 * rotation, and other window transformations related to display magnification
213 * as the window manager is responsible for doing the actual magnification
214 * and has access to the raw window data while the accessibility layer serves
215 * as a controller.
216 *
Rhed Jao02655dc2018-10-30 20:44:52 +0800217 * @param displayId The logical display id.
Svetoslav8e3feb12014-02-24 13:46:47 -0800218 * @param callbacks The callbacks to invoke.
Rhed Jao02655dc2018-10-30 20:44:52 +0800219 * @return {@code false} if display id is not valid.
Svetoslav8e3feb12014-02-24 13:46:47 -0800220 */
Rhed Jao02655dc2018-10-30 20:44:52 +0800221 public abstract boolean setMagnificationCallbacks(int displayId,
222 @Nullable MagnificationCallbacks callbacks);
Svetoslav8e3feb12014-02-24 13:46:47 -0800223
224 /**
225 * Set by the accessibility layer to specify the magnification and panning to
226 * be applied to all windows that should be magnified.
227 *
Rhed Jao02655dc2018-10-30 20:44:52 +0800228 * @param displayId The logical display id.
Craig Mautner8a0da012014-05-31 15:13:37 -0700229 * @param spec The MagnficationSpec to set.
Svetoslav8e3feb12014-02-24 13:46:47 -0800230 *
Rhed Jao02655dc2018-10-30 20:44:52 +0800231 * @see #setMagnificationCallbacks(int, MagnificationCallbacks)
Svetoslav8e3feb12014-02-24 13:46:47 -0800232 */
Rhed Jao02655dc2018-10-30 20:44:52 +0800233 public abstract void setMagnificationSpec(int displayId, MagnificationSpec spec);
Svetoslav8e3feb12014-02-24 13:46:47 -0800234
235 /**
Casey Burkhardt74922c62017-02-13 12:43:16 -0800236 * Set by the accessibility framework to indicate whether the magnifiable regions of the display
237 * should be shown.
238 *
Rhed Jao02655dc2018-10-30 20:44:52 +0800239 * @param displayId The logical display id.
Casey Burkhardt74922c62017-02-13 12:43:16 -0800240 * @param show {@code true} to show magnifiable region bounds, {@code false} to hide
241 */
Rhed Jao02655dc2018-10-30 20:44:52 +0800242 public abstract void setForceShowMagnifiableBounds(int displayId, boolean show);
Casey Burkhardt74922c62017-02-13 12:43:16 -0800243
244 /**
Phil Weaver70439242016-03-10 15:15:49 -0800245 * Obtains the magnification regions.
Alan Viverette59e53a12016-03-28 13:41:32 -0400246 *
Rhed Jao02655dc2018-10-30 20:44:52 +0800247 * @param displayId The logical display id.
Phil Weaver70439242016-03-10 15:15:49 -0800248 * @param magnificationRegion the current magnification region
Alan Viverette59e53a12016-03-28 13:41:32 -0400249 */
Rhed Jao02655dc2018-10-30 20:44:52 +0800250 public abstract void getMagnificationRegion(int displayId, @NonNull Region magnificationRegion);
Alan Viverette59e53a12016-03-28 13:41:32 -0400251
252 /**
Svetoslav8e3feb12014-02-24 13:46:47 -0800253 * Gets the magnification and translation applied to a window given its token.
254 * Not all windows are magnified and the window manager policy determines which
255 * windows are magnified. The returned result also takes into account the compat
256 * scale if necessary.
257 *
258 * @param windowToken The window's token.
259 *
260 * @return The magnification spec for the window.
261 *
Rhed Jao02655dc2018-10-30 20:44:52 +0800262 * @see #setMagnificationCallbacks(int, MagnificationCallbacks)
Svetoslav8e3feb12014-02-24 13:46:47 -0800263 */
264 public abstract MagnificationSpec getCompatibleMagnificationSpecForWindow(
265 IBinder windowToken);
266
267 /**
268 * Sets a callback for observing which windows are touchable for the purposes
Jacky Kaof93252b2019-07-18 15:19:52 +0800269 * of accessibility on specified display.
Svetoslav8e3feb12014-02-24 13:46:47 -0800270 *
Jacky Kaof93252b2019-07-18 15:19:52 +0800271 * @param displayId The logical display id.
Svetoslav8e3feb12014-02-24 13:46:47 -0800272 * @param callback The callback.
Jacky Kaof93252b2019-07-18 15:19:52 +0800273 * @return {@code false} if display id is not valid.
Svetoslav8e3feb12014-02-24 13:46:47 -0800274 */
Jacky Kaof93252b2019-07-18 15:19:52 +0800275 public abstract boolean setWindowsForAccessibilityCallback(int displayId,
Svetoslav8e3feb12014-02-24 13:46:47 -0800276 WindowsForAccessibilityCallback callback);
277
278 /**
279 * Sets a filter for manipulating the input event stream.
280 *
281 * @param filter The filter implementation.
282 */
283 public abstract void setInputFilter(IInputFilter filter);
284
285 /**
286 * Gets the token of the window that has input focus.
287 *
288 * @return The token.
289 */
290 public abstract IBinder getFocusedWindowToken();
291
292 /**
293 * @return Whether the keyguard is engaged.
294 */
295 public abstract boolean isKeyguardLocked();
296
297 /**
Jonathan Solnit6e8d7092017-06-15 15:17:20 -0700298 * @return Whether the keyguard is showing and not occluded.
299 */
300 public abstract boolean isKeyguardShowingAndNotOccluded();
301
302 /**
Svetoslav8e3feb12014-02-24 13:46:47 -0800303 * Gets the frame of a window given its token.
304 *
305 * @param token The token.
306 * @param outBounds The frame to populate.
307 */
308 public abstract void getWindowFrame(IBinder token, Rect outBounds);
Craig Mautner8a0da012014-05-31 15:13:37 -0700309
310 /**
Alan Viverettee34560b22014-07-10 14:50:06 -0700311 * Opens the global actions dialog.
312 */
313 public abstract void showGlobalActions();
314
315 /**
Craig Mautner8a0da012014-05-31 15:13:37 -0700316 * Invalidate all visible windows. Then report back on the callback once all windows have
317 * redrawn.
318 */
Craig Mautner13f6ea72014-06-23 14:57:02 -0700319 public abstract void waitForAllWindowsDrawn(Runnable callback, long timeout);
Svetoslav3a5c7212014-10-14 09:54:26 -0700320
321 /**
Adrian Roos595416b2018-10-14 14:50:33 +0200322 * Overrides the display size.
323 *
324 * @param displayId The display to override the display size.
325 * @param width The width to override.
326 * @param height The height to override.
327 */
328 public abstract void setForcedDisplaySize(int displayId, int width, int height);
329
330 /**
331 * Recover the display size to real display size.
332 *
333 * @param displayId The display to recover the display size.
334 */
335 public abstract void clearForcedDisplaySize(int displayId);
336
337 /**
Svetoslav3a5c7212014-10-14 09:54:26 -0700338 * Adds a window token for a given window type.
339 *
340 * @param token The token to add.
341 * @param type The window type.
Wale Ogunwaleac2561e2016-11-01 15:43:46 -0700342 * @param displayId The display to add the token to.
Svetoslav3a5c7212014-10-14 09:54:26 -0700343 */
Wale Ogunwaleac2561e2016-11-01 15:43:46 -0700344 public abstract void addWindowToken(android.os.IBinder token, int type, int displayId);
Svetoslav3a5c7212014-10-14 09:54:26 -0700345
346 /**
347 * Removes a window token.
348 *
349 * @param token The toke to remove.
350 * @param removeWindows Whether to also remove the windows associated with the token.
Wale Ogunwaleac2561e2016-11-01 15:43:46 -0700351 * @param displayId The display to remove the token from.
Svetoslav3a5c7212014-10-14 09:54:26 -0700352 */
Wale Ogunwaleac2561e2016-11-01 15:43:46 -0700353 public abstract void removeWindowToken(android.os.IBinder token, boolean removeWindows,
354 int displayId);
Jorim Jaggi24bec7c2015-02-04 12:40:14 +0100355
356 /**
357 * Registers a listener to be notified about app transition events.
358 *
359 * @param listener The listener to register.
360 */
361 public abstract void registerAppTransitionListener(AppTransitionListener listener);
Seigo Nonaka7309b122015-08-17 18:34:13 -0700362
363 /**
Adrian Roos1c8e3c02018-11-20 20:07:55 +0100364 * Reports that the password for the given user has changed.
365 */
366 public abstract void reportPasswordChanged(int userId);
367
368 /**
lumark90120a82018-08-15 00:33:03 +0800369 * Retrieves a height of input method window for given display.
Seigo Nonaka7309b122015-08-17 18:34:13 -0700370 */
lumark90120a82018-08-15 00:33:03 +0800371 public abstract int getInputMethodWindowVisibleHeight(int displayId);
Seigo Nonaka7309b122015-08-17 18:34:13 -0700372
373 /**
Yohei Yukawa69e68022017-02-13 12:04:50 -0800374 * Notifies WindowManagerService that the current IME window status is being changed.
375 *
Yohei Yukawa603f4d02018-09-11 15:04:58 -0700376 * <p>Only {@link com.android.server.inputmethod.InputMethodManagerService} is the expected and
377 * tested caller of this method.</p>
Yohei Yukawa69e68022017-02-13 12:04:50 -0800378 *
379 * @param imeToken token to track the active input method. Corresponding IME windows can be
380 * identified by checking {@link android.view.WindowManager.LayoutParams#token}.
381 * Note that there is no guarantee that the corresponding window is already
382 * created
383 * @param imeWindowVisible whether the active IME thinks that its window should be visible or
384 * hidden, no matter how WindowManagerService will react / has reacted
385 * to corresponding API calls. Note that this state is not guaranteed
386 * to be synchronized with state in WindowManagerService.
Yohei Yukawad6475a62017-04-17 10:35:27 -0700387 * @param dismissImeOnBackKeyPressed {@code true} if the software keyboard is shown and the back
388 * key is expected to dismiss the software keyboard.
Yohei Yukawa69e68022017-02-13 12:04:50 -0800389 */
Yohei Yukawaee2a7ed2017-02-15 21:38:57 -0800390 public abstract void updateInputMethodWindowStatus(@NonNull IBinder imeToken,
Yohei Yukawa99e1f6e2018-06-22 17:33:19 -0700391 boolean imeWindowVisible, boolean dismissImeOnBackKeyPressed);
392
393 /**
394 * Notifies WindowManagerService that the current IME window status is being changed.
395 *
Yohei Yukawa603f4d02018-09-11 15:04:58 -0700396 * <p>Only {@link com.android.server.inputmethod.InputMethodManagerService} is the expected and
397 * tested caller of this method.</p>
Yohei Yukawa99e1f6e2018-06-22 17:33:19 -0700398 *
399 * @param imeToken token to track the active input method. Corresponding IME windows can be
400 * identified by checking {@link android.view.WindowManager.LayoutParams#token}.
401 * Note that there is no guarantee that the corresponding window is already
402 * created
403 * @param imeTargetWindowToken token to identify the target window that the IME is associated
404 * with
405 */
406 public abstract void updateInputMethodTargetWindow(@NonNull IBinder imeToken,
407 @NonNull IBinder imeTargetWindowToken);
Yohei Yukawa69e68022017-02-13 12:04:50 -0800408
409 /**
Seigo Nonaka7309b122015-08-17 18:34:13 -0700410 * Returns true when the hardware keyboard is available.
411 */
412 public abstract boolean isHardKeyboardAvailable();
413
414 /**
415 * Sets the callback listener for hardware keyboard status changes.
416 *
417 * @param listener The listener to set.
418 */
419 public abstract void setOnHardKeyboardStatusChangeListener(
420 OnHardKeyboardStatusChangeListener listener);
Wale Ogunwale6e94a9e2015-10-07 15:35:49 -0700421
Wale Ogunwale44f036f2017-09-29 05:09:09 -0700422 /** Returns true if a stack in the windowing mode is currently visible. */
Jorim Jaggi4981f152019-03-26 18:58:45 +0100423 public abstract boolean isStackVisibleLw(int windowingMode);
Jorim Jaggi9511b0f2016-01-29 19:12:44 -0800424
425 /**
Jacky Kaof93252b2019-07-18 15:19:52 +0800426 * Requests the window manager to resend the windows for accessibility on specified display.
427 *
428 * @param displayId Display ID to be computed its windows for accessibility
Svetoslav Ganovfd138892016-07-13 18:20:42 -0700429 */
Jacky Kaof93252b2019-07-18 15:19:52 +0800430 public abstract void computeWindowsForAccessibility(int displayId);
Tarandeep Singhe1cfcf42017-07-10 18:50:00 -0700431
432 /**
433 * Called after virtual display Id is updated by
434 * {@link com.android.server.vr.Vr2dDisplay} with a specific
435 * {@param vr2dDisplayId}.
436 */
437 public abstract void setVr2dDisplayId(int vr2dDisplayId);
Daichi Hirono3c6c95e2017-09-13 12:23:57 +0900438
439 /**
440 * Sets callback to DragDropController.
441 */
442 public abstract void registerDragDropControllerCallback(IDragDropCallback callback);
Eugene Suslaf9a651d2017-10-11 12:06:27 -0700443
444 /**
445 * @see android.view.IWindowManager#lockNow
446 */
447 public abstract void lockNow();
Tony Mak6f2e97e2018-03-26 20:43:06 +0100448
449 /**
450 * Return the user that owns the given window, {@link android.os.UserHandle#USER_NULL} if
451 * the window token is not found.
452 */
453 public abstract int getWindowOwnerUserId(IBinder windowToken);
Chad Brubakera6b2d5c2018-06-25 12:50:01 -0700454
455 /**
456 * Returns {@code true} if a Window owned by {@code uid} has focus.
457 */
458 public abstract boolean isUidFocused(int uid);
Yohei Yukawacf93f9a2018-08-30 15:58:47 -0700459
460 /**
Yohei Yukawa4052a10f2018-10-15 15:35:55 +0800461 * Checks whether the specified IME client has IME focus or not.
Yohei Yukawa41f89c32018-09-19 14:30:04 -0700462 *
463 * @param uid UID of the process to be queried
464 * @param pid PID of the process to be queried
Yohei Yukawa4052a10f2018-10-15 15:35:55 +0800465 * @param displayId Display ID reported from the client. Note that this method also verifies
466 * whether the specified process is allowed to access to this display or not
467 * @return {@code true} if the IME client specified with {@code uid}, {@code pid}, and
468 * {@code displayId} has IME focus
Yohei Yukawacf93f9a2018-08-30 15:58:47 -0700469 */
Yohei Yukawa4052a10f2018-10-15 15:35:55 +0800470 public abstract boolean isInputMethodClientFocus(int uid, int pid, int displayId);
471
472 /**
473 * Checks whether the given {@code uid} is allowed to use the given {@code displayId} or not.
474 *
475 * @param displayId Display ID to be checked
476 * @param uid UID to be checked.
477 * @return {@code true} if the given {@code uid} is allowed to use the given {@code displayId}
478 */
479 public abstract boolean isUidAllowedOnDisplay(int displayId, int uid);
lumark90120a82018-08-15 00:33:03 +0800480
481 /**
482 * Return the display Id for given window.
483 */
484 public abstract int getDisplayIdForWindow(IBinder windowToken);
Andrii Kuliandd989612019-02-21 12:13:28 -0800485
486 /**
lumark7570cac2019-03-07 22:14:38 +0800487 * @return The top focused display ID.
488 */
489 public abstract int getTopFocusedDisplayId();
490
491 /**
wilsonshihc17691b32019-03-28 11:56:27 +0800492 * Checks if this display is configured and allowed to show system decorations.
Andrii Kuliandd989612019-02-21 12:13:28 -0800493 */
494 public abstract boolean shouldShowSystemDecorOnDisplay(int displayId);
lumark9a72d222019-03-30 18:31:45 +0800495
496 /**
497 * Indicates that the display should show IME.
498 *
499 * @param displayId The id of the display.
500 * @return {@code true} if the display should show IME when an input field become focused on it.
501 */
502 public abstract boolean shouldShowIme(int displayId);
Eino-Ville Talvalab3805162019-05-13 15:38:11 -0700503
504 /**
505 * Tell window manager about a package that should not be running with high refresh rate
506 * setting until removeNonHighRefreshRatePackage is called for the same package.
507 *
508 * This must not be called again for the same package.
509 */
510 public abstract void addNonHighRefreshRatePackage(@NonNull String packageName);
511
512 /**
513 * Tell window manager to stop constraining refresh rate for the given package.
514 */
515 public abstract void removeNonHighRefreshRatePackage(@NonNull String packageName);
516
RyanlwLin80788132019-06-13 17:51:33 +0800517 /**
518 * Checks if this display is touchable.
519 */
520 public abstract boolean isTouchableDisplay(int displayId);
521
Svetoslav8e3feb12014-02-24 13:46:47 -0800522}