blob: 9f0153a09c70f75db104e45d50f1174daa7d65ff [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 Ogunwale66d2dd62016-01-04 17:54:26 -080080 Rect arg11, Configuration arg12, boolean arg13, boolean arg14) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -080081 // TODO Auto-generated method stub
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
Jorim Jaggi1a2f3ab2015-11-06 21:31:17 +0100245 public void overridePendingAppTransitionMultiThumbFuture(
246 IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
247 boolean scaleUp) throws RemoteException {
248
249 }
250
251 @Override
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700252 public void overridePendingAppTransitionMultiThumb(AppTransitionAnimationSpec[] specs,
Filip Gruszczynskif254e952015-10-30 16:14:57 -0700253 IRemoteCallback callback0, IRemoteCallback callback1, boolean scaleUp) {
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700254 // TODO Auto-generated method stub
255 }
256
257 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800258 public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
259 // TODO Auto-generated method stub
260
261 }
262
263 @Override
264 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
265 // TODO Auto-generated method stub
266
267 }
268
269 @Override
270 public void reenableKeyguard(IBinder arg0) throws RemoteException {
271 // TODO Auto-generated method stub
272
273 }
274
275 @Override
276 public void removeAppToken(IBinder arg0) throws RemoteException {
277 // TODO Auto-generated method stub
278
279 }
280
281 @Override
282 public void removeWindowToken(IBinder arg0) throws RemoteException {
283 // TODO Auto-generated method stub
284
285 }
286
287 @Override
288 public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
289 // TODO Auto-generated method stub
290
291 }
292
293 @Override
Dianne Hackborn4025c962015-03-17 17:22:33 -0700294 public boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver)
295 throws RemoteException {
296 // TODO Auto-generated method stub
297 return false;
298 }
299
300 @Override
301 public Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth,
Winson8b1871d2015-11-20 09:56:20 -0800302 int maxHeight, float frameScale) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800303 // TODO Auto-generated method stub
304 return null;
305 }
306
307 @Override
308 public void setAnimationScale(int arg0, float arg1) throws RemoteException {
309 // TODO Auto-generated method stub
310
311 }
312
313 @Override
314 public void setAnimationScales(float[] arg0) throws RemoteException {
315 // TODO Auto-generated method stub
316
317 }
318
319 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700320 public float getCurrentAnimatorScale() throws RemoteException {
321 return 0;
322 }
323
324 @Override
Wale Ogunwale2998eef2015-12-02 19:46:29 -0800325 public void setAppTask(IBinder arg0, int arg1, int arg2, Rect arg3, Configuration arg4)
Filip Gruszczynski1bca2972015-09-01 09:29:11 -0700326 throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800327 // TODO Auto-generated method stub
Adam Lesinski282e1812014-01-23 18:17:42 -0800328 }
329
330 @Override
331 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
332 // TODO Auto-generated method stub
333 }
334
335 @Override
336 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
337 CharSequence arg4, int arg5, int arg6, int arg7, int arg8, IBinder arg9, boolean arg10)
338 throws RemoteException {
339 // TODO Auto-generated method stub
340 }
341
342 @Override
343 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
344 // TODO Auto-generated method stub
345
346 }
347
348 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800349 public void setEventDispatching(boolean arg0) throws RemoteException {
350 // TODO Auto-generated method stub
351 }
352
353 @Override
354 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
355 // TODO Auto-generated method stub
356 }
357
358 @Override
359 public void getInitialDisplaySize(int displayId, Point size) {
360 // TODO Auto-generated method stub
361 }
362
363 @Override
364 public void getBaseDisplaySize(int displayId, Point size) {
365 // TODO Auto-generated method stub
366 }
367
368 @Override
369 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
370 // TODO Auto-generated method stub
371 }
372
373 @Override
374 public int getInitialDisplayDensity(int displayId) {
375 return -1;
376 }
377
378 @Override
379 public int getBaseDisplayDensity(int displayId) {
380 return -1;
381 }
382
383 @Override
384 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
385 // TODO Auto-generated method stub
386 }
387
388 @Override
Jeff Brownd46747a2015-04-15 19:02:36 -0700389 public void setForcedDisplayScalingMode(int displayId, int mode) {
390 }
391
392 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800393 public void setInTouchMode(boolean arg0) throws RemoteException {
394 // TODO Auto-generated method stub
395 }
396
397 @Override
398 public void setNewConfiguration(Configuration arg0) throws RemoteException {
399 // TODO Auto-generated method stub
400 }
401
402 @Override
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100403 public void setScreenCaptureDisabled(int userId, boolean disabled) {
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100404 // TODO Auto-generated method stub
405 }
406
407 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800408 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
409 // TODO Auto-generated method stub
410 }
411
412 @Override
413 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
414 // TODO Auto-generated method stub
415 }
416
417 @Override
418 public void showStrictModeViolation(boolean arg0) throws RemoteException {
419 // TODO Auto-generated method stub
420 }
421
422 @Override
423 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
424 // TODO Auto-generated method stub
425 }
426
427 @Override
428 public boolean startViewServer(int arg0) throws RemoteException {
429 // TODO Auto-generated method stub
430 return false;
431 }
432
433 @Override
434 public void statusBarVisibilityChanged(int arg0) throws RemoteException {
435 // TODO Auto-generated method stub
436 }
437
438 @Override
439 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
440 // TODO Auto-generated method stub
441 }
442
443 @Override
444 public boolean stopViewServer() throws RemoteException {
445 // TODO Auto-generated method stub
446 return false;
447 }
448
449 @Override
450 public void thawRotation() throws RemoteException {
451 // TODO Auto-generated method stub
452 }
453
454 @Override
455 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
456 throws RemoteException {
457 // TODO Auto-generated method stub
458 return null;
459 }
460
461 @Override
462 public int watchRotation(IRotationWatcher arg0) throws RemoteException {
463 // TODO Auto-generated method stub
464 return 0;
465 }
466
467 @Override
468 public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException {
469 }
470
471 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800472 public IBinder asBinder() {
473 // TODO Auto-generated method stub
474 return null;
475 }
476
477 @Override
478 public int getPreferredOptionsPanelGravity() throws RemoteException {
479 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
480 }
481
482 @Override
483 public void dismissKeyguard() {
484 }
485
486 @Override
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200487 public void keyguardGoingAway(boolean disableWindowAnimations,
488 boolean keyguardGoingToNotificationShade) throws RemoteException {
Craig Mautner8bd94d52014-05-29 10:49:10 -0700489 }
490
491 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800492 public void lockNow(Bundle options) {
493 // TODO Auto-generated method stub
494 }
495
496 @Override
497 public boolean isSafeModeEnabled() {
498 return false;
499 }
500
501 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800502 public boolean isRotationFrozen() throws RemoteException {
503 // TODO Auto-generated method stub
504 return false;
505 }
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200506
507 @Override
508 public void enableScreenIfNeeded() throws RemoteException {
Svetoslavdd137a82014-04-10 12:48:07 -0700509 // TODO Auto-generated method stub
510 }
511
512 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700513 public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700514 // TODO Auto-generated method stub
515 return false;
516 }
517
518 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700519 public WindowContentFrameStats getWindowContentFrameStats(IBinder token)
Svetoslavdd137a82014-04-10 12:48:07 -0700520 throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700521 // TODO Auto-generated method stub
522 return null;
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200523 }
Winson6b05f802015-11-02 16:38:25 -0800524
525 @Override
Jorim Jaggi1a2f3ab2015-11-06 21:31:17 +0100526 public int getDockedStackSide() throws RemoteException {
527 return 0;
528 }
529
530 @Override
531 public void setDockedStackResizing(boolean resizing) throws RemoteException {
532 }
533
534 @Override
Winson6b05f802015-11-02 16:38:25 -0800535 public void cancelTaskWindowTransition(int taskId) {
536 }
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800537
538 @Override
Winson13d30662015-11-06 15:30:29 -0800539 public void cancelTaskThumbnailTransition(int taskId) {
540 }
541
542 @Override
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800543 public void endProlongedAnimations() {
544 }
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800545
546 @Override
Jorim Jaggi2a374552016-01-05 15:25:24 +0100547 public void registerDockedStackListener(IDockedStackListener listener) throws RemoteException {
548 }
549
550 @Override
551 public void setResizeDimLayer(boolean visible, int targetStackId, float alpha)
552 throws RemoteException {
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800553 }
Wale Ogunwaleb2d13562016-01-13 15:08:29 -0800554
555 @Override
556 public void requestAppKeyboardShortcuts(IResultReceiver receiver) throws RemoteException {
557 }
Adam Lesinski282e1812014-01-23 18:17:42 -0800558}