blob: 2560c31196f02b5968851352f936c3e8e3346010 [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;
Wale Ogunwaleb2d13562016-01-13 15:08:29 -080022import com.android.internal.os.IResultReceiver;
Adam Lesinski282e1812014-01-23 18:17:42 -080023import com.android.internal.view.IInputContext;
24import com.android.internal.view.IInputMethodClient;
25
26import android.content.res.CompatibilityInfo;
27import android.content.res.Configuration;
28import android.graphics.Bitmap;
Adam Lesinski282e1812014-01-23 18:17:42 -080029import android.os.Bundle;
30import android.os.IBinder;
31import android.os.IRemoteCallback;
32import android.os.RemoteException;
33import android.util.DisplayMetrics;
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -070034import android.view.AppTransitionAnimationSpec;
Adam Lesinski282e1812014-01-23 18:17:42 -080035
Svetoslavdd137a82014-04-10 12:48:07 -070036import java.lang.Override;
Adam Lesinski282e1812014-01-23 18:17:42 -080037
38/**
39 * Basic implementation of {@link IWindowManager} so that {@link Display} (and
40 * {@link Display_Delegate}) can return a valid instance.
41 */
42public class IWindowManagerImpl implements IWindowManager {
43
44 private final Configuration mConfig;
45 private final DisplayMetrics mMetrics;
46 private final int mRotation;
47 private final boolean mHasNavigationBar;
48
49 public IWindowManagerImpl(Configuration config, DisplayMetrics metrics, int rotation,
50 boolean hasNavigationBar) {
51 mConfig = config;
52 mMetrics = metrics;
53 mRotation = rotation;
54 mHasNavigationBar = hasNavigationBar;
55 }
56
57 // custom API.
58
59 public DisplayMetrics getMetrics() {
60 return mMetrics;
61 }
62
63 // ---- implementation of IWindowManager that we care about ----
64
65 @Override
66 public int getRotation() throws RemoteException {
67 return mRotation;
68 }
69
70 @Override
71 public boolean hasNavigationBar() {
72 return mHasNavigationBar;
73 }
74
75 // ---- unused implementation of IWindowManager ----
76
77 @Override
Filip Gruszczynski1bca2972015-09-01 09:29:11 -070078 public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4,
Wale Ogunwale861aaa92015-08-06 12:34:44 -070079 boolean arg5, boolean arg6, int arg7, int arg8, boolean arg9, boolean arg10,
Wale Ogunwaleb1faf602016-01-27 09:12:31 -080080 Rect arg11, Configuration arg12, int arg13, boolean arg14, boolean arg15)
81 throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -080082 // TODO Auto-generated method stub
Adam Lesinski282e1812014-01-23 18:17:42 -080083 }
84
85 @Override
86 public void addWindowToken(IBinder arg0, int arg1) throws RemoteException {
87 // TODO Auto-generated method stub
88
89 }
90
91 @Override
92 public void clearForcedDisplaySize(int displayId) throws RemoteException {
93 // TODO Auto-generated method stub
94 }
95
96 @Override
97 public void clearForcedDisplayDensity(int displayId) throws RemoteException {
98 // TODO Auto-generated method stub
99 }
100
101 @Override
102 public void setOverscan(int displayId, int left, int top, int right, int bottom)
103 throws RemoteException {
104 // TODO Auto-generated method stub
105 }
106
107 @Override
108 public void closeSystemDialogs(String arg0) throws RemoteException {
109 // TODO Auto-generated method stub
110
111 }
112
113 @Override
114 public void startFreezingScreen(int exitAnim, int enterAnim) {
115 // TODO Auto-generated method stub
116 }
117
118 @Override
119 public void stopFreezingScreen() {
120 // TODO Auto-generated method stub
121 }
122
123 @Override
124 public void disableKeyguard(IBinder arg0, String arg1) throws RemoteException {
125 // TODO Auto-generated method stub
126
127 }
128
129 @Override
130 public void executeAppTransition() throws RemoteException {
131 // TODO Auto-generated method stub
132
133 }
134
135 @Override
136 public void exitKeyguardSecurely(IOnKeyguardExitResult arg0) throws RemoteException {
137 // TODO Auto-generated method stub
138
139 }
140
141 @Override
142 public void freezeRotation(int arg0) throws RemoteException {
143 // TODO Auto-generated method stub
144
145 }
146
147 @Override
148 public float getAnimationScale(int arg0) throws RemoteException {
149 // TODO Auto-generated method stub
150 return 0;
151 }
152
153 @Override
154 public float[] getAnimationScales() throws RemoteException {
155 // TODO Auto-generated method stub
156 return null;
157 }
158
159 @Override
160 public int getAppOrientation(IApplicationToken arg0) throws RemoteException {
161 // TODO Auto-generated method stub
162 return 0;
163 }
164
165 @Override
166 public int getPendingAppTransition() throws RemoteException {
167 // TODO Auto-generated method stub
168 return 0;
169 }
170
171 @Override
172 public boolean inKeyguardRestrictedInputMode() throws RemoteException {
173 // TODO Auto-generated method stub
174 return false;
175 }
176
177 @Override
178 public boolean inputMethodClientHasFocus(IInputMethodClient arg0) throws RemoteException {
179 // TODO Auto-generated method stub
180 return false;
181 }
182
183 @Override
184 public boolean isKeyguardLocked() throws RemoteException {
185 // TODO Auto-generated method stub
186 return false;
187 }
188
189 @Override
190 public boolean isKeyguardSecure() throws RemoteException {
191 // TODO Auto-generated method stub
192 return false;
193 }
194
195 @Override
196 public boolean isViewServerRunning() throws RemoteException {
197 // TODO Auto-generated method stub
198 return false;
199 }
200
201 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700202 public IWindowSession openSession(IWindowSessionCallback argn1, IInputMethodClient arg0,
203 IInputContext arg1) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800204 // TODO Auto-generated method stub
205 return null;
206 }
207
208 @Override
209 public void overridePendingAppTransition(String arg0, int arg1, int arg2,
210 IRemoteCallback startedCallback) throws RemoteException {
211 // TODO Auto-generated method stub
212
213 }
214
215 @Override
216 public void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth,
217 int startHeight) throws RemoteException {
218 // TODO Auto-generated method stub
219 }
220
221 @Override
Chet Haase10e23ab2015-02-11 15:08:38 -0800222 public void overridePendingAppTransitionClipReveal(int startX, int startY,
223 int startWidth, int startHeight) throws RemoteException {
224 // TODO Auto-generated method stub
225 }
226
227 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800228 public void overridePendingAppTransitionThumb(Bitmap srcThumb, int startX, int startY,
229 IRemoteCallback startedCallback, boolean scaleUp) throws RemoteException {
230 // TODO Auto-generated method stub
231 }
232
233 @Override
Winson Chunga4ccb862014-08-22 15:26:27 -0700234 public void overridePendingAppTransitionAspectScaledThumb(Bitmap srcThumb, int startX,
Winson Chung2e7f3bd2014-09-05 13:17:22 +0200235 int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback,
236 boolean scaleUp) {
Winson Chunga4ccb862014-08-22 15:26:27 -0700237 // TODO Auto-generated method stub
238 }
239
240 @Override
Winson Chung044d5292014-11-06 11:05:19 -0800241 public void overridePendingAppTransitionInPlace(String packageName, int anim) {
242 // TODO Auto-generated method stub
243 }
244
245 @Override
Jorim Jaggi1a2f3ab2015-11-06 21:31:17 +0100246 public void overridePendingAppTransitionMultiThumbFuture(
247 IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
248 boolean scaleUp) throws RemoteException {
249
250 }
251
252 @Override
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700253 public void overridePendingAppTransitionMultiThumb(AppTransitionAnimationSpec[] specs,
Filip Gruszczynskif254e952015-10-30 16:14:57 -0700254 IRemoteCallback callback0, IRemoteCallback callback1, boolean scaleUp) {
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700255 // TODO Auto-generated method stub
256 }
257
258 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800259 public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
260 // TODO Auto-generated method stub
261
262 }
263
264 @Override
265 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
266 // TODO Auto-generated method stub
267
268 }
269
270 @Override
271 public void reenableKeyguard(IBinder arg0) throws RemoteException {
272 // TODO Auto-generated method stub
273
274 }
275
276 @Override
277 public void removeAppToken(IBinder arg0) throws RemoteException {
278 // TODO Auto-generated method stub
279
280 }
281
282 @Override
283 public void removeWindowToken(IBinder arg0) throws RemoteException {
284 // TODO Auto-generated method stub
285
286 }
287
288 @Override
289 public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
290 // TODO Auto-generated method stub
291
292 }
293
294 @Override
Dianne Hackborn4025c962015-03-17 17:22:33 -0700295 public boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver)
296 throws RemoteException {
297 // TODO Auto-generated method stub
298 return false;
299 }
300
301 @Override
302 public Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth,
Winson8b1871d2015-11-20 09:56:20 -0800303 int maxHeight, float frameScale) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800304 // TODO Auto-generated method stub
305 return null;
306 }
307
308 @Override
309 public void setAnimationScale(int arg0, float arg1) throws RemoteException {
310 // TODO Auto-generated method stub
311
312 }
313
314 @Override
315 public void setAnimationScales(float[] arg0) throws RemoteException {
316 // TODO Auto-generated method stub
317
318 }
319
320 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700321 public float getCurrentAnimatorScale() throws RemoteException {
322 return 0;
323 }
324
325 @Override
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800326 public void setAppTask(IBinder arg0, int arg1, int arg2, Rect arg3, Configuration arg4,
327 int arg5, boolean arg6)
Filip Gruszczynski1bca2972015-09-01 09:29:11 -0700328 throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800329 // TODO Auto-generated method stub
Adam Lesinski282e1812014-01-23 18:17:42 -0800330 }
331
332 @Override
333 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
334 // TODO Auto-generated method stub
335 }
336
337 @Override
338 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
339 CharSequence arg4, int arg5, int arg6, int arg7, int arg8, IBinder arg9, boolean arg10)
340 throws RemoteException {
341 // TODO Auto-generated method stub
342 }
343
344 @Override
345 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
346 // TODO Auto-generated method stub
347
348 }
349
350 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800351 public void setEventDispatching(boolean arg0) throws RemoteException {
352 // TODO Auto-generated method stub
353 }
354
355 @Override
356 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
357 // TODO Auto-generated method stub
358 }
359
360 @Override
361 public void getInitialDisplaySize(int displayId, Point size) {
362 // TODO Auto-generated method stub
363 }
364
365 @Override
366 public void getBaseDisplaySize(int displayId, Point size) {
367 // TODO Auto-generated method stub
368 }
369
370 @Override
371 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
372 // TODO Auto-generated method stub
373 }
374
375 @Override
376 public int getInitialDisplayDensity(int displayId) {
377 return -1;
378 }
379
380 @Override
381 public int getBaseDisplayDensity(int displayId) {
382 return -1;
383 }
384
385 @Override
386 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
387 // TODO Auto-generated method stub
388 }
389
390 @Override
Jeff Brownd46747a2015-04-15 19:02:36 -0700391 public void setForcedDisplayScalingMode(int displayId, int mode) {
392 }
393
394 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800395 public void setInTouchMode(boolean arg0) throws RemoteException {
396 // TODO Auto-generated method stub
397 }
398
399 @Override
400 public void setNewConfiguration(Configuration arg0) throws RemoteException {
401 // TODO Auto-generated method stub
402 }
403
404 @Override
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100405 public void setScreenCaptureDisabled(int userId, boolean disabled) {
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100406 // TODO Auto-generated method stub
407 }
408
409 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800410 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
411 // TODO Auto-generated method stub
412 }
413
414 @Override
415 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
416 // TODO Auto-generated method stub
417 }
418
419 @Override
420 public void showStrictModeViolation(boolean arg0) throws RemoteException {
421 // TODO Auto-generated method stub
422 }
423
424 @Override
425 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
426 // TODO Auto-generated method stub
427 }
428
429 @Override
430 public boolean startViewServer(int arg0) throws RemoteException {
431 // TODO Auto-generated method stub
432 return false;
433 }
434
435 @Override
436 public void statusBarVisibilityChanged(int arg0) throws RemoteException {
437 // TODO Auto-generated method stub
438 }
439
440 @Override
441 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
442 // TODO Auto-generated method stub
443 }
444
445 @Override
446 public boolean stopViewServer() throws RemoteException {
447 // TODO Auto-generated method stub
448 return false;
449 }
450
451 @Override
452 public void thawRotation() throws RemoteException {
453 // TODO Auto-generated method stub
454 }
455
456 @Override
457 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
458 throws RemoteException {
459 // TODO Auto-generated method stub
460 return null;
461 }
462
463 @Override
464 public int watchRotation(IRotationWatcher arg0) throws RemoteException {
465 // TODO Auto-generated method stub
466 return 0;
467 }
468
469 @Override
470 public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException {
471 }
472
473 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800474 public IBinder asBinder() {
475 // TODO Auto-generated method stub
476 return null;
477 }
478
479 @Override
480 public int getPreferredOptionsPanelGravity() throws RemoteException {
481 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
482 }
483
484 @Override
485 public void dismissKeyguard() {
486 }
487
488 @Override
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200489 public void keyguardGoingAway(boolean disableWindowAnimations,
490 boolean keyguardGoingToNotificationShade) throws RemoteException {
Craig Mautner8bd94d52014-05-29 10:49:10 -0700491 }
492
493 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800494 public void lockNow(Bundle options) {
495 // TODO Auto-generated method stub
496 }
497
498 @Override
499 public boolean isSafeModeEnabled() {
500 return false;
501 }
502
503 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800504 public boolean isRotationFrozen() throws RemoteException {
505 // TODO Auto-generated method stub
506 return false;
507 }
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200508
509 @Override
510 public void enableScreenIfNeeded() throws RemoteException {
Svetoslavdd137a82014-04-10 12:48:07 -0700511 // TODO Auto-generated method stub
512 }
513
514 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700515 public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700516 // TODO Auto-generated method stub
517 return false;
518 }
519
520 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700521 public WindowContentFrameStats getWindowContentFrameStats(IBinder token)
Svetoslavdd137a82014-04-10 12:48:07 -0700522 throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700523 // TODO Auto-generated method stub
524 return null;
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200525 }
Winson6b05f802015-11-02 16:38:25 -0800526
527 @Override
Jorim Jaggi1a2f3ab2015-11-06 21:31:17 +0100528 public int getDockedStackSide() throws RemoteException {
529 return 0;
530 }
531
532 @Override
533 public void setDockedStackResizing(boolean resizing) throws RemoteException {
534 }
535
536 @Override
Winson6b05f802015-11-02 16:38:25 -0800537 public void cancelTaskWindowTransition(int taskId) {
538 }
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800539
540 @Override
Winson13d30662015-11-06 15:30:29 -0800541 public void cancelTaskThumbnailTransition(int taskId) {
542 }
543
544 @Override
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800545 public void endProlongedAnimations() {
546 }
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800547
548 @Override
Jorim Jaggi2a374552016-01-05 15:25:24 +0100549 public void registerDockedStackListener(IDockedStackListener listener) throws RemoteException {
550 }
551
552 @Override
553 public void setResizeDimLayer(boolean visible, int targetStackId, float alpha)
554 throws RemoteException {
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800555 }
Wale Ogunwaleb2d13562016-01-13 15:08:29 -0800556
557 @Override
558 public void requestAppKeyboardShortcuts(IResultReceiver receiver) throws RemoteException {
559 }
Jorim Jaggi1444cfd2016-02-01 14:24:05 -0800560
561 @Override
562 public void getStableInsets(Rect outInsets) throws RemoteException {
563 }
Adam Lesinski282e1812014-01-23 18:17:42 -0800564}