1 /* //device/java/android/android/view/IWindow.aidl
2 **
3 ** Copyright 2007, The Android Open Source Project
4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 **     http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17 
18 package android.view;
19 
20 import android.graphics.Point;
21 import android.graphics.Rect;
22 import android.os.Bundle;
23 import android.os.ParcelFileDescriptor;
24 import android.util.MergedConfiguration;
25 import android.view.DisplayCutout;
26 import android.view.DragEvent;
27 import android.view.InsetsSourceControl;
28 import android.view.InsetsState;
29 import android.view.IScrollCaptureController;
30 import android.view.KeyEvent;
31 import android.view.MotionEvent;
32 
33 import com.android.internal.os.IResultReceiver;
34 
35 /**
36  * API back to a client window that the Window Manager uses to inform it of
37  * interesting things happening.
38  *
39  * {@hide}
40  */
41 oneway interface IWindow {
42     /**
43      * ===== NOTICE =====
44      * The first method must remain the first method. Scripts
45      * and tools rely on their transaction number to work properly.
46      */
47 
48     /**
49      * Invoked by the view server to tell a window to execute the specified
50      * command. Any response from the receiver must be sent through the
51      * specified file descriptor.
52      */
executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor)53     void executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor);
54 
resized(in Rect frame, in Rect contentInsets, in Rect visibleInsets, in Rect stableInsets, boolean reportDraw, in MergedConfiguration newMergedConfiguration, in Rect backDropFrame, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, in DisplayCutout.ParcelableWrapper displayCutout)55     void resized(in Rect frame, in Rect contentInsets,
56             in Rect visibleInsets, in Rect stableInsets, boolean reportDraw,
57             in MergedConfiguration newMergedConfiguration, in Rect backDropFrame,
58             boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId,
59             in DisplayCutout.ParcelableWrapper displayCutout);
60 
61     /**
62      * Called when the window location in parent display has changed. The offset will only be a
63      * nonzero value if the window is on an embedded display that is re-parented to another window.
64      */
locationInParentDisplayChanged(in Point offset)65     void locationInParentDisplayChanged(in Point offset);
66 
67     /**
68      * Called when the window insets configuration has changed.
69      */
insetsChanged(in InsetsState insetsState)70     void insetsChanged(in InsetsState insetsState);
71 
72     /**
73      * Called when this window retrieved control over a specified set of insets sources.
74      */
insetsControlChanged(in InsetsState insetsState, in InsetsSourceControl[] activeControls)75     void insetsControlChanged(in InsetsState insetsState, in InsetsSourceControl[] activeControls);
76 
77     /**
78      * Called when a set of insets source window should be shown by policy.
79      *
80      * @param types internal insets types (WindowInsets.Type.InsetsType) to show
81      * @param fromIme true if this request originated from IME (InputMethodService).
82      */
showInsets(int types, boolean fromIme)83     void showInsets(int types, boolean fromIme);
84 
85     /**
86      * Called when a set of insets source window should be hidden by policy.
87      *
88      * @param types internal insets types (WindowInsets.Type.InsetsType) to hide
89      * @param fromIme true if this request originated from IME (InputMethodService).
90      */
hideInsets(int types, boolean fromIme)91     void hideInsets(int types, boolean fromIme);
92 
moved(int newX, int newY)93     void moved(int newX, int newY);
dispatchAppVisibility(boolean visible)94     void dispatchAppVisibility(boolean visible);
dispatchGetNewSurface()95     void dispatchGetNewSurface();
96 
97     /**
98      * Tell the window that it is either gaining or losing focus.  Keep it up
99      * to date on the current state showing navigational focus (touch mode) too.
100      */
windowFocusChanged(boolean hasFocus, boolean inTouchMode)101     void windowFocusChanged(boolean hasFocus, boolean inTouchMode);
102 
closeSystemDialogs(String reason)103     void closeSystemDialogs(String reason);
104 
105     /**
106      * Called for wallpaper windows when their offsets or zoom level change.
107      */
dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, float zoom, boolean sync)108     void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, float zoom, boolean sync);
109 
dispatchWallpaperCommand(String action, int x, int y, int z, in Bundle extras, boolean sync)110     void dispatchWallpaperCommand(String action, int x, int y,
111             int z, in Bundle extras, boolean sync);
112 
113     /**
114      * Drag/drop events
115      */
dispatchDragEvent(in DragEvent event)116     void dispatchDragEvent(in DragEvent event);
117 
118     /**
119      * Pointer icon events
120      */
updatePointerIcon(float x, float y)121     void updatePointerIcon(float x, float y);
122 
123     /**
124      * System chrome visibility changes
125      */
dispatchSystemUiVisibilityChanged(int seq, int globalVisibility, int localValue, int localChanges)126     void dispatchSystemUiVisibilityChanged(int seq, int globalVisibility,
127             int localValue, int localChanges);
128 
129     /**
130      * Called for non-application windows when the enter animation has completed.
131      */
dispatchWindowShown()132     void dispatchWindowShown();
133 
134     /**
135      * Called when Keyboard Shortcuts are requested for the window.
136      */
requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId)137     void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId);
138 
139     /**
140      * Tell the window that it is either gaining or losing pointer capture.
141      */
dispatchPointerCaptureChanged(boolean hasCapture)142     void dispatchPointerCaptureChanged(boolean hasCapture);
143 
144     /**
145      * Called when Scroll Capture support is requested for a window.
146      *
147      * @param controller the controller to receive responses
148      */
requestScrollCapture(in IScrollCaptureController controller)149     void requestScrollCapture(in IScrollCaptureController controller);
150 }
151