blob: 14dc35646539801d04745e7336776214c3de99c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
/*
* Copyright (C) 2014 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.
*/
package android.view;
import android.graphics.Rect;
import android.graphics.Region;
import android.hardware.display.DisplayManagerInternal;
import android.os.IBinder;
import java.util.List;
/**
* Window manager local system service interface.
*
* @hide Only for use within the system server.
*/
public abstract class WindowManagerInternal {
/**
* Interface to receive a callback when the windows reported for
* accessibility changed.
*/
public interface WindowsForAccessibilityCallback {
/**
* Called when the windows for accessibility changed.
*
* @param windows The windows for accessibility.
*/
public void onWindowsForAccessibilityChanged(List<WindowInfo> windows);
}
/**
* Callbacks for contextual changes that affect the screen magnification
* feature.
*/
public interface MagnificationCallbacks {
/**
* Called when the bounds of the screen content that is magnified changed.
* Note that not the entire screen is magnified.
*
* @param bounds The bounds.
*/
public void onMagnifedBoundsChanged(Region bounds);
/**
* Called when an application requests a rectangle on the screen to allow
* the client to apply the appropriate pan and scale.
*
* @param left The rectangle left.
* @param top The rectangle top.
* @param right The rectangle right.
* @param bottom The rectangle bottom.
*/
public void onRectangleOnScreenRequested(int left, int top, int right, int bottom);
/**
* Notifies that the rotation changed.
*
* @param rotation The current rotation.
*/
public void onRotationChanged(int rotation);
/**
* Notifies that the context of the user changed. For example, an application
* was started.
*/
public void onUserContextChanged();
}
/**
* Request that the window manager call
* {@link DisplayManagerInternal#performTraversalInTransactionFromWindowManager}
* within a surface transaction at a later time.
*/
public abstract void requestTraversalFromDisplayManager();
/**
* Set by the accessibility layer to observe changes in the magnified region,
* rotation, and other window transformations related to display magnification
* as the window manager is responsible for doing the actual magnification
* and has access to the raw window data while the accessibility layer serves
* as a controller.
*
* @param callbacks The callbacks to invoke.
*/
public abstract void setMagnificationCallbacks(MagnificationCallbacks callbacks);
/**
* Set by the accessibility layer to specify the magnification and panning to
* be applied to all windows that should be magnified.
*
* @param callbacks The callbacks to invoke.
*
* @see #setMagnificationCallbacks(MagnificationCallbacks)
*/
public abstract void setMagnificationSpec(MagnificationSpec spec);
/**
* Gets the magnification and translation applied to a window given its token.
* Not all windows are magnified and the window manager policy determines which
* windows are magnified. The returned result also takes into account the compat
* scale if necessary.
*
* @param windowToken The window's token.
*
* @return The magnification spec for the window.
*
* @see #setMagnificationCallbacks(MagnificationCallbacks)
*/
public abstract MagnificationSpec getCompatibleMagnificationSpecForWindow(
IBinder windowToken);
/**
* Sets a callback for observing which windows are touchable for the purposes
* of accessibility.
*
* @param callback The callback.
*/
public abstract void setWindowsForAccessibilityCallback(
WindowsForAccessibilityCallback callback);
/**
* Sets a filter for manipulating the input event stream.
*
* @param filter The filter implementation.
*/
public abstract void setInputFilter(IInputFilter filter);
/**
* Gets the token of the window that has input focus.
*
* @return The token.
*/
public abstract IBinder getFocusedWindowToken();
/**
* @return Whether the keyguard is engaged.
*/
public abstract boolean isKeyguardLocked();
/**
* Gets the frame of a window given its token.
*
* @param token The token.
* @param outBounds The frame to populate.
*/
public abstract void getWindowFrame(IBinder token, Rect outBounds);
}
|