blob: 01ee18b1649c3548f013f0be25a52266c3638aac [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
Filip Gruszczynski1bca2972015-09-01 09:29:11 -070077 public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4,
Wale Ogunwale861aaa92015-08-06 12:34:44 -070078 boolean arg5, boolean arg6, int arg7, int arg8, boolean arg9, boolean arg10,
Wale Ogunwale66d2dd62016-01-04 17:54:26 -080079 Rect arg11, Configuration arg12, boolean arg13, boolean arg14) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -080080 // TODO Auto-generated method stub
Adam Lesinski282e1812014-01-23 18:17:42 -080081 }
82
83 @Override
84 public void addWindowToken(IBinder arg0, int arg1) throws RemoteException {
85 // TODO Auto-generated method stub
86
87 }
88
89 @Override
90 public void clearForcedDisplaySize(int displayId) throws RemoteException {
91 // TODO Auto-generated method stub
92 }
93
94 @Override
95 public void clearForcedDisplayDensity(int displayId) throws RemoteException {
96 // TODO Auto-generated method stub
97 }
98
99 @Override
100 public void setOverscan(int displayId, int left, int top, int right, int bottom)
101 throws RemoteException {
102 // TODO Auto-generated method stub
103 }
104
105 @Override
106 public void closeSystemDialogs(String arg0) throws RemoteException {
107 // TODO Auto-generated method stub
108
109 }
110
111 @Override
112 public void startFreezingScreen(int exitAnim, int enterAnim) {
113 // TODO Auto-generated method stub
114 }
115
116 @Override
117 public void stopFreezingScreen() {
118 // TODO Auto-generated method stub
119 }
120
121 @Override
122 public void disableKeyguard(IBinder arg0, String arg1) throws RemoteException {
123 // TODO Auto-generated method stub
124
125 }
126
127 @Override
128 public void executeAppTransition() throws RemoteException {
129 // TODO Auto-generated method stub
130
131 }
132
133 @Override
134 public void exitKeyguardSecurely(IOnKeyguardExitResult arg0) throws RemoteException {
135 // TODO Auto-generated method stub
136
137 }
138
139 @Override
140 public void freezeRotation(int arg0) throws RemoteException {
141 // TODO Auto-generated method stub
142
143 }
144
145 @Override
146 public float getAnimationScale(int arg0) throws RemoteException {
147 // TODO Auto-generated method stub
148 return 0;
149 }
150
151 @Override
152 public float[] getAnimationScales() throws RemoteException {
153 // TODO Auto-generated method stub
154 return null;
155 }
156
157 @Override
158 public int getAppOrientation(IApplicationToken arg0) throws RemoteException {
159 // TODO Auto-generated method stub
160 return 0;
161 }
162
163 @Override
164 public int getPendingAppTransition() throws RemoteException {
165 // TODO Auto-generated method stub
166 return 0;
167 }
168
169 @Override
170 public boolean inKeyguardRestrictedInputMode() throws RemoteException {
171 // TODO Auto-generated method stub
172 return false;
173 }
174
175 @Override
176 public boolean inputMethodClientHasFocus(IInputMethodClient arg0) throws RemoteException {
177 // TODO Auto-generated method stub
178 return false;
179 }
180
181 @Override
182 public boolean isKeyguardLocked() throws RemoteException {
183 // TODO Auto-generated method stub
184 return false;
185 }
186
187 @Override
188 public boolean isKeyguardSecure() throws RemoteException {
189 // TODO Auto-generated method stub
190 return false;
191 }
192
193 @Override
194 public boolean isViewServerRunning() throws RemoteException {
195 // TODO Auto-generated method stub
196 return false;
197 }
198
199 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700200 public IWindowSession openSession(IWindowSessionCallback argn1, IInputMethodClient arg0,
201 IInputContext arg1) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800202 // TODO Auto-generated method stub
203 return null;
204 }
205
206 @Override
207 public void overridePendingAppTransition(String arg0, int arg1, int arg2,
208 IRemoteCallback startedCallback) throws RemoteException {
209 // TODO Auto-generated method stub
210
211 }
212
213 @Override
214 public void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth,
215 int startHeight) throws RemoteException {
216 // TODO Auto-generated method stub
217 }
218
219 @Override
Chet Haase10e23ab2015-02-11 15:08:38 -0800220 public void overridePendingAppTransitionClipReveal(int startX, int startY,
221 int startWidth, int startHeight) throws RemoteException {
222 // TODO Auto-generated method stub
223 }
224
225 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800226 public void overridePendingAppTransitionThumb(Bitmap srcThumb, int startX, int startY,
227 IRemoteCallback startedCallback, boolean scaleUp) throws RemoteException {
228 // TODO Auto-generated method stub
229 }
230
231 @Override
Winson Chunga4ccb862014-08-22 15:26:27 -0700232 public void overridePendingAppTransitionAspectScaledThumb(Bitmap srcThumb, int startX,
Winson Chung2e7f3bd2014-09-05 13:17:22 +0200233 int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback,
234 boolean scaleUp) {
Winson Chunga4ccb862014-08-22 15:26:27 -0700235 // TODO Auto-generated method stub
236 }
237
238 @Override
Winson Chung044d5292014-11-06 11:05:19 -0800239 public void overridePendingAppTransitionInPlace(String packageName, int anim) {
240 // TODO Auto-generated method stub
241 }
242
243 @Override
Jorim Jaggi1a2f3ab2015-11-06 21:31:17 +0100244 public void overridePendingAppTransitionMultiThumbFuture(
245 IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
246 boolean scaleUp) throws RemoteException {
247
248 }
249
250 @Override
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700251 public void overridePendingAppTransitionMultiThumb(AppTransitionAnimationSpec[] specs,
Filip Gruszczynskif254e952015-10-30 16:14:57 -0700252 IRemoteCallback callback0, IRemoteCallback callback1, boolean scaleUp) {
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700253 // TODO Auto-generated method stub
254 }
255
256 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800257 public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
258 // TODO Auto-generated method stub
259
260 }
261
262 @Override
263 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
264 // TODO Auto-generated method stub
265
266 }
267
268 @Override
269 public void reenableKeyguard(IBinder arg0) throws RemoteException {
270 // TODO Auto-generated method stub
271
272 }
273
274 @Override
275 public void removeAppToken(IBinder arg0) throws RemoteException {
276 // TODO Auto-generated method stub
277
278 }
279
280 @Override
281 public void removeWindowToken(IBinder arg0) throws RemoteException {
282 // TODO Auto-generated method stub
283
284 }
285
286 @Override
287 public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
288 // TODO Auto-generated method stub
289
290 }
291
292 @Override
Dianne Hackborn4025c962015-03-17 17:22:33 -0700293 public boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver)
294 throws RemoteException {
295 // TODO Auto-generated method stub
296 return false;
297 }
298
299 @Override
300 public Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth,
Winson8b1871d2015-11-20 09:56:20 -0800301 int maxHeight, float frameScale) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800302 // TODO Auto-generated method stub
303 return null;
304 }
305
306 @Override
307 public void setAnimationScale(int arg0, float arg1) throws RemoteException {
308 // TODO Auto-generated method stub
309
310 }
311
312 @Override
313 public void setAnimationScales(float[] arg0) throws RemoteException {
314 // TODO Auto-generated method stub
315
316 }
317
318 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700319 public float getCurrentAnimatorScale() throws RemoteException {
320 return 0;
321 }
322
323 @Override
Wale Ogunwale2998eef2015-12-02 19:46:29 -0800324 public void setAppTask(IBinder arg0, int arg1, int arg2, Rect arg3, Configuration arg4)
Filip Gruszczynski1bca2972015-09-01 09:29:11 -0700325 throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800326 // TODO Auto-generated method stub
Adam Lesinski282e1812014-01-23 18:17:42 -0800327 }
328
329 @Override
330 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
331 // TODO Auto-generated method stub
332 }
333
334 @Override
335 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
336 CharSequence arg4, int arg5, int arg6, int arg7, int arg8, IBinder arg9, boolean arg10)
337 throws RemoteException {
338 // TODO Auto-generated method stub
339 }
340
341 @Override
342 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
343 // TODO Auto-generated method stub
344
345 }
346
347 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800348 public void setEventDispatching(boolean arg0) throws RemoteException {
349 // TODO Auto-generated method stub
350 }
351
352 @Override
353 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
354 // TODO Auto-generated method stub
355 }
356
357 @Override
358 public void getInitialDisplaySize(int displayId, Point size) {
359 // TODO Auto-generated method stub
360 }
361
362 @Override
363 public void getBaseDisplaySize(int displayId, Point size) {
364 // TODO Auto-generated method stub
365 }
366
367 @Override
368 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
369 // TODO Auto-generated method stub
370 }
371
372 @Override
373 public int getInitialDisplayDensity(int displayId) {
374 return -1;
375 }
376
377 @Override
378 public int getBaseDisplayDensity(int displayId) {
379 return -1;
380 }
381
382 @Override
383 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
384 // TODO Auto-generated method stub
385 }
386
387 @Override
Jeff Brownd46747a2015-04-15 19:02:36 -0700388 public void setForcedDisplayScalingMode(int displayId, int mode) {
389 }
390
391 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800392 public void setInTouchMode(boolean arg0) throws RemoteException {
393 // TODO Auto-generated method stub
394 }
395
396 @Override
397 public void setNewConfiguration(Configuration arg0) throws RemoteException {
398 // TODO Auto-generated method stub
399 }
400
401 @Override
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100402 public void setScreenCaptureDisabled(int userId, boolean disabled) {
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100403 // TODO Auto-generated method stub
404 }
405
406 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800407 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
408 // TODO Auto-generated method stub
409 }
410
411 @Override
412 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
413 // TODO Auto-generated method stub
414 }
415
416 @Override
417 public void showStrictModeViolation(boolean arg0) throws RemoteException {
418 // TODO Auto-generated method stub
419 }
420
421 @Override
422 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
423 // TODO Auto-generated method stub
424 }
425
426 @Override
427 public boolean startViewServer(int arg0) throws RemoteException {
428 // TODO Auto-generated method stub
429 return false;
430 }
431
432 @Override
433 public void statusBarVisibilityChanged(int arg0) throws RemoteException {
434 // TODO Auto-generated method stub
435 }
436
437 @Override
438 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
439 // TODO Auto-generated method stub
440 }
441
442 @Override
443 public boolean stopViewServer() throws RemoteException {
444 // TODO Auto-generated method stub
445 return false;
446 }
447
448 @Override
449 public void thawRotation() throws RemoteException {
450 // TODO Auto-generated method stub
451 }
452
453 @Override
454 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
455 throws RemoteException {
456 // TODO Auto-generated method stub
457 return null;
458 }
459
460 @Override
461 public int watchRotation(IRotationWatcher arg0) throws RemoteException {
462 // TODO Auto-generated method stub
463 return 0;
464 }
465
466 @Override
467 public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException {
468 }
469
470 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800471 public IBinder asBinder() {
472 // TODO Auto-generated method stub
473 return null;
474 }
475
476 @Override
477 public int getPreferredOptionsPanelGravity() throws RemoteException {
478 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
479 }
480
481 @Override
482 public void dismissKeyguard() {
483 }
484
485 @Override
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200486 public void keyguardGoingAway(boolean disableWindowAnimations,
487 boolean keyguardGoingToNotificationShade) throws RemoteException {
Craig Mautner8bd94d52014-05-29 10:49:10 -0700488 }
489
490 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800491 public void lockNow(Bundle options) {
492 // TODO Auto-generated method stub
493 }
494
495 @Override
496 public boolean isSafeModeEnabled() {
497 return false;
498 }
499
500 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800501 public boolean isRotationFrozen() throws RemoteException {
502 // TODO Auto-generated method stub
503 return false;
504 }
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200505
506 @Override
507 public void enableScreenIfNeeded() throws RemoteException {
Svetoslavdd137a82014-04-10 12:48:07 -0700508 // TODO Auto-generated method stub
509 }
510
511 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700512 public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700513 // TODO Auto-generated method stub
514 return false;
515 }
516
517 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700518 public WindowContentFrameStats getWindowContentFrameStats(IBinder token)
Svetoslavdd137a82014-04-10 12:48:07 -0700519 throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700520 // TODO Auto-generated method stub
521 return null;
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200522 }
Winson6b05f802015-11-02 16:38:25 -0800523
524 @Override
Jorim Jaggi1a2f3ab2015-11-06 21:31:17 +0100525 public int getDockedStackSide() throws RemoteException {
526 return 0;
527 }
528
529 @Override
530 public void setDockedStackResizing(boolean resizing) throws RemoteException {
531 }
532
533 @Override
Winson6b05f802015-11-02 16:38:25 -0800534 public void cancelTaskWindowTransition(int taskId) {
535 }
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800536
537 @Override
Winson13d30662015-11-06 15:30:29 -0800538 public void cancelTaskThumbnailTransition(int taskId) {
539 }
540
541 @Override
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800542 public void endProlongedAnimations() {
543 }
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800544
545 @Override
Jorim Jaggi2a374552016-01-05 15:25:24 +0100546 public void registerDockedStackListener(IDockedStackListener listener) throws RemoteException {
547 }
548
549 @Override
550 public void setResizeDimLayer(boolean visible, int targetStackId, float alpha)
551 throws RemoteException {
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800552 }
Adam Lesinski282e1812014-01-23 18:17:42 -0800553}