blob: a8fd91c3a607bdbe6bda2acb80923e172af409e8 [file] [log] [blame]
Adam Lesinski282e1812014-01-23 18:17:42 -08001/*
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
17package android.view;
18
19import android.graphics.Point;
Wale Ogunwale861aaa92015-08-06 12:34:44 -070020import android.graphics.Rect;
Dianne Hackborn4025c962015-03-17 17:22:33 -070021import com.android.internal.app.IAssistScreenshotReceiver;
Adam Lesinski282e1812014-01-23 18:17:42 -080022import com.android.internal.view.IInputContext;
23import com.android.internal.view.IInputMethodClient;
24
25import android.content.res.CompatibilityInfo;
26import android.content.res.Configuration;
27import android.graphics.Bitmap;
Adam Lesinski282e1812014-01-23 18:17:42 -080028import android.os.Bundle;
29import android.os.IBinder;
30import android.os.IRemoteCallback;
31import android.os.RemoteException;
32import android.util.DisplayMetrics;
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -070033import android.view.AppTransitionAnimationSpec;
Adam Lesinski282e1812014-01-23 18:17:42 -080034
Svetoslavdd137a82014-04-10 12:48:07 -070035import java.lang.Override;
Adam Lesinski282e1812014-01-23 18:17:42 -080036
37/**
38 * Basic implementation of {@link IWindowManager} so that {@link Display} (and
39 * {@link Display_Delegate}) can return a valid instance.
40 */
41public class IWindowManagerImpl implements IWindowManager {
42
43 private final Configuration mConfig;
44 private final DisplayMetrics mMetrics;
45 private final int mRotation;
46 private final boolean mHasNavigationBar;
47
48 public IWindowManagerImpl(Configuration config, DisplayMetrics metrics, int rotation,
49 boolean hasNavigationBar) {
50 mConfig = config;
51 mMetrics = metrics;
52 mRotation = rotation;
53 mHasNavigationBar = hasNavigationBar;
54 }
55
56 // custom API.
57
58 public DisplayMetrics getMetrics() {
59 return mMetrics;
60 }
61
62 // ---- implementation of IWindowManager that we care about ----
63
64 @Override
65 public int getRotation() throws RemoteException {
66 return mRotation;
67 }
68
69 @Override
70 public boolean hasNavigationBar() {
71 return mHasNavigationBar;
72 }
73
74 // ---- unused implementation of IWindowManager ----
75
76 @Override
Wale Ogunwale861aaa92015-08-06 12:34:44 -070077 public Configuration addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4,
78 boolean arg5, boolean arg6, int arg7, int arg8, boolean arg9, boolean arg10,
79 Rect arg11) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -080080 // TODO Auto-generated method stub
Wale Ogunwale861aaa92015-08-06 12:34:44 -070081 return Configuration.EMPTY;
Adam Lesinski282e1812014-01-23 18:17:42 -080082 }
83
84 @Override
85 public void addWindowToken(IBinder arg0, int arg1) throws RemoteException {
86 // TODO Auto-generated method stub
87
88 }
89
90 @Override
91 public void clearForcedDisplaySize(int displayId) throws RemoteException {
92 // TODO Auto-generated method stub
93 }
94
95 @Override
96 public void clearForcedDisplayDensity(int displayId) throws RemoteException {
97 // TODO Auto-generated method stub
98 }
99
100 @Override
101 public void setOverscan(int displayId, int left, int top, int right, int bottom)
102 throws RemoteException {
103 // TODO Auto-generated method stub
104 }
105
106 @Override
107 public void closeSystemDialogs(String arg0) throws RemoteException {
108 // TODO Auto-generated method stub
109
110 }
111
112 @Override
113 public void startFreezingScreen(int exitAnim, int enterAnim) {
114 // TODO Auto-generated method stub
115 }
116
117 @Override
118 public void stopFreezingScreen() {
119 // TODO Auto-generated method stub
120 }
121
122 @Override
123 public void disableKeyguard(IBinder arg0, String arg1) throws RemoteException {
124 // TODO Auto-generated method stub
125
126 }
127
128 @Override
129 public void executeAppTransition() throws RemoteException {
130 // TODO Auto-generated method stub
131
132 }
133
134 @Override
135 public void exitKeyguardSecurely(IOnKeyguardExitResult arg0) throws RemoteException {
136 // TODO Auto-generated method stub
137
138 }
139
140 @Override
141 public void freezeRotation(int arg0) throws RemoteException {
142 // TODO Auto-generated method stub
143
144 }
145
146 @Override
147 public float getAnimationScale(int arg0) throws RemoteException {
148 // TODO Auto-generated method stub
149 return 0;
150 }
151
152 @Override
153 public float[] getAnimationScales() throws RemoteException {
154 // TODO Auto-generated method stub
155 return null;
156 }
157
158 @Override
159 public int getAppOrientation(IApplicationToken arg0) throws RemoteException {
160 // TODO Auto-generated method stub
161 return 0;
162 }
163
164 @Override
165 public int getPendingAppTransition() throws RemoteException {
166 // TODO Auto-generated method stub
167 return 0;
168 }
169
170 @Override
171 public boolean inKeyguardRestrictedInputMode() throws RemoteException {
172 // TODO Auto-generated method stub
173 return false;
174 }
175
176 @Override
177 public boolean inputMethodClientHasFocus(IInputMethodClient arg0) throws RemoteException {
178 // TODO Auto-generated method stub
179 return false;
180 }
181
182 @Override
183 public boolean isKeyguardLocked() throws RemoteException {
184 // TODO Auto-generated method stub
185 return false;
186 }
187
188 @Override
189 public boolean isKeyguardSecure() throws RemoteException {
190 // TODO Auto-generated method stub
191 return false;
192 }
193
194 @Override
195 public boolean isViewServerRunning() throws RemoteException {
196 // TODO Auto-generated method stub
197 return false;
198 }
199
200 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700201 public IWindowSession openSession(IWindowSessionCallback argn1, IInputMethodClient arg0,
202 IInputContext arg1) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800203 // TODO Auto-generated method stub
204 return null;
205 }
206
207 @Override
208 public void overridePendingAppTransition(String arg0, int arg1, int arg2,
209 IRemoteCallback startedCallback) throws RemoteException {
210 // TODO Auto-generated method stub
211
212 }
213
214 @Override
215 public void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth,
216 int startHeight) throws RemoteException {
217 // TODO Auto-generated method stub
218 }
219
220 @Override
Chet Haase10e23ab2015-02-11 15:08:38 -0800221 public void overridePendingAppTransitionClipReveal(int startX, int startY,
222 int startWidth, int startHeight) throws RemoteException {
223 // TODO Auto-generated method stub
224 }
225
226 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800227 public void overridePendingAppTransitionThumb(Bitmap srcThumb, int startX, int startY,
228 IRemoteCallback startedCallback, boolean scaleUp) throws RemoteException {
229 // TODO Auto-generated method stub
230 }
231
232 @Override
Winson Chunga4ccb862014-08-22 15:26:27 -0700233 public void overridePendingAppTransitionAspectScaledThumb(Bitmap srcThumb, int startX,
Winson Chung2e7f3bd2014-09-05 13:17:22 +0200234 int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback,
235 boolean scaleUp) {
Winson Chunga4ccb862014-08-22 15:26:27 -0700236 // TODO Auto-generated method stub
237 }
238
239 @Override
Winson Chung044d5292014-11-06 11:05:19 -0800240 public void overridePendingAppTransitionInPlace(String packageName, int anim) {
241 // TODO Auto-generated method stub
242 }
243
244 @Override
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700245 public void overridePendingAppTransitionMultiThumb(AppTransitionAnimationSpec[] specs,
246 IRemoteCallback callback, boolean scaleUp) {
247 // TODO Auto-generated method stub
248 }
249
250 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800251 public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
252 // TODO Auto-generated method stub
253
254 }
255
256 @Override
257 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
258 // TODO Auto-generated method stub
259
260 }
261
262 @Override
263 public void reenableKeyguard(IBinder arg0) throws RemoteException {
264 // TODO Auto-generated method stub
265
266 }
267
268 @Override
269 public void removeAppToken(IBinder arg0) throws RemoteException {
270 // TODO Auto-generated method stub
271
272 }
273
274 @Override
275 public void removeWindowToken(IBinder arg0) throws RemoteException {
276 // TODO Auto-generated method stub
277
278 }
279
280 @Override
281 public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
282 // TODO Auto-generated method stub
283
284 }
285
286 @Override
Dianne Hackborn4025c962015-03-17 17:22:33 -0700287 public boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver)
288 throws RemoteException {
289 // TODO Auto-generated method stub
290 return false;
291 }
292
293 @Override
294 public Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth,
295 int maxHeight) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800296 // TODO Auto-generated method stub
297 return null;
298 }
299
300 @Override
301 public void setAnimationScale(int arg0, float arg1) throws RemoteException {
302 // TODO Auto-generated method stub
303
304 }
305
306 @Override
307 public void setAnimationScales(float[] arg0) throws RemoteException {
308 // TODO Auto-generated method stub
309
310 }
311
312 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700313 public float getCurrentAnimatorScale() throws RemoteException {
314 return 0;
315 }
316
317 @Override
Wale Ogunwale861aaa92015-08-06 12:34:44 -0700318 public Configuration setAppTask(IBinder arg0, int arg1, Rect arg2) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800319 // TODO Auto-generated method stub
Wale Ogunwale861aaa92015-08-06 12:34:44 -0700320 return Configuration.EMPTY;
Adam Lesinski282e1812014-01-23 18:17:42 -0800321 }
322
323 @Override
324 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
325 // TODO Auto-generated method stub
326 }
327
328 @Override
329 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
330 CharSequence arg4, int arg5, int arg6, int arg7, int arg8, IBinder arg9, boolean arg10)
331 throws RemoteException {
332 // TODO Auto-generated method stub
333 }
334
335 @Override
336 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
337 // TODO Auto-generated method stub
338
339 }
340
341 @Override
342 public void setAppWillBeHidden(IBinder arg0) throws RemoteException {
343 // TODO Auto-generated method stub
344 }
345
346 @Override
347 public void setEventDispatching(boolean arg0) throws RemoteException {
348 // TODO Auto-generated method stub
349 }
350
351 @Override
352 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
353 // TODO Auto-generated method stub
354 }
355
356 @Override
357 public void getInitialDisplaySize(int displayId, Point size) {
358 // TODO Auto-generated method stub
359 }
360
361 @Override
362 public void getBaseDisplaySize(int displayId, Point size) {
363 // TODO Auto-generated method stub
364 }
365
366 @Override
367 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
368 // TODO Auto-generated method stub
369 }
370
371 @Override
372 public int getInitialDisplayDensity(int displayId) {
373 return -1;
374 }
375
376 @Override
377 public int getBaseDisplayDensity(int displayId) {
378 return -1;
379 }
380
381 @Override
382 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
383 // TODO Auto-generated method stub
384 }
385
386 @Override
Jeff Brownd46747a2015-04-15 19:02:36 -0700387 public void setForcedDisplayScalingMode(int displayId, int mode) {
388 }
389
390 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800391 public void setInTouchMode(boolean arg0) throws RemoteException {
392 // TODO Auto-generated method stub
393 }
394
395 @Override
396 public void setNewConfiguration(Configuration arg0) throws RemoteException {
397 // TODO Auto-generated method stub
398 }
399
400 @Override
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100401 public void setScreenCaptureDisabled(int userId, boolean disabled) {
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100402 // TODO Auto-generated method stub
403 }
404
405 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800406 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
407 // TODO Auto-generated method stub
408 }
409
410 @Override
411 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
412 // TODO Auto-generated method stub
413 }
414
415 @Override
416 public void showStrictModeViolation(boolean arg0) throws RemoteException {
417 // TODO Auto-generated method stub
418 }
419
420 @Override
421 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
422 // TODO Auto-generated method stub
423 }
424
425 @Override
426 public boolean startViewServer(int arg0) throws RemoteException {
427 // TODO Auto-generated method stub
428 return false;
429 }
430
431 @Override
432 public void statusBarVisibilityChanged(int arg0) throws RemoteException {
433 // TODO Auto-generated method stub
434 }
435
436 @Override
437 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
438 // TODO Auto-generated method stub
439 }
440
441 @Override
442 public boolean stopViewServer() throws RemoteException {
443 // TODO Auto-generated method stub
444 return false;
445 }
446
447 @Override
448 public void thawRotation() throws RemoteException {
449 // TODO Auto-generated method stub
450 }
451
452 @Override
453 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
454 throws RemoteException {
455 // TODO Auto-generated method stub
456 return null;
457 }
458
459 @Override
460 public int watchRotation(IRotationWatcher arg0) throws RemoteException {
461 // TODO Auto-generated method stub
462 return 0;
463 }
464
465 @Override
466 public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException {
467 }
468
469 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800470 public IBinder asBinder() {
471 // TODO Auto-generated method stub
472 return null;
473 }
474
475 @Override
476 public int getPreferredOptionsPanelGravity() throws RemoteException {
477 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
478 }
479
480 @Override
481 public void dismissKeyguard() {
482 }
483
484 @Override
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200485 public void keyguardGoingAway(boolean disableWindowAnimations,
486 boolean keyguardGoingToNotificationShade) throws RemoteException {
Craig Mautner8bd94d52014-05-29 10:49:10 -0700487 }
488
489 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800490 public void lockNow(Bundle options) {
491 // TODO Auto-generated method stub
492 }
493
494 @Override
495 public boolean isSafeModeEnabled() {
496 return false;
497 }
498
499 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800500 public boolean isRotationFrozen() throws RemoteException {
501 // TODO Auto-generated method stub
502 return false;
503 }
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200504
505 @Override
506 public void enableScreenIfNeeded() throws RemoteException {
Svetoslavdd137a82014-04-10 12:48:07 -0700507 // TODO Auto-generated method stub
508 }
509
510 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700511 public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700512 // TODO Auto-generated method stub
513 return false;
514 }
515
516 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700517 public WindowContentFrameStats getWindowContentFrameStats(IBinder token)
Svetoslavdd137a82014-04-10 12:48:07 -0700518 throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700519 // TODO Auto-generated method stub
520 return null;
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200521 }
Adam Lesinski282e1812014-01-23 18:17:42 -0800522}