blob: d2103c811d3ebcb29350322078c53912d755f72f [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;
Muyuan Li94ce94e2016-02-24 16:20:54 -080023import com.android.internal.policy.IShortcutService;
Adam Lesinski282e1812014-01-23 18:17:42 -080024import com.android.internal.view.IInputContext;
25import com.android.internal.view.IInputMethodClient;
26
27import android.content.res.CompatibilityInfo;
28import android.content.res.Configuration;
29import android.graphics.Bitmap;
Adam Lesinski282e1812014-01-23 18:17:42 -080030import android.os.Bundle;
31import android.os.IBinder;
32import android.os.IRemoteCallback;
33import android.os.RemoteException;
34import android.util.DisplayMetrics;
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -070035import android.view.AppTransitionAnimationSpec;
Adam Lesinski282e1812014-01-23 18:17:42 -080036
Svetoslavdd137a82014-04-10 12:48:07 -070037import java.lang.Override;
Adam Lesinski282e1812014-01-23 18:17:42 -080038
39/**
40 * Basic implementation of {@link IWindowManager} so that {@link Display} (and
41 * {@link Display_Delegate}) can return a valid instance.
42 */
43public class IWindowManagerImpl implements IWindowManager {
44
45 private final Configuration mConfig;
46 private final DisplayMetrics mMetrics;
47 private final int mRotation;
48 private final boolean mHasNavigationBar;
49
50 public IWindowManagerImpl(Configuration config, DisplayMetrics metrics, int rotation,
51 boolean hasNavigationBar) {
52 mConfig = config;
53 mMetrics = metrics;
54 mRotation = rotation;
55 mHasNavigationBar = hasNavigationBar;
56 }
57
58 // custom API.
59
60 public DisplayMetrics getMetrics() {
61 return mMetrics;
62 }
63
64 // ---- implementation of IWindowManager that we care about ----
65
66 @Override
67 public int getRotation() throws RemoteException {
68 return mRotation;
69 }
70
71 @Override
72 public boolean hasNavigationBar() {
73 return mHasNavigationBar;
74 }
75
76 // ---- unused implementation of IWindowManager ----
77
78 @Override
Filip Gruszczynski1bca2972015-09-01 09:29:11 -070079 public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4,
Wale Ogunwale861aaa92015-08-06 12:34:44 -070080 boolean arg5, boolean arg6, int arg7, int arg8, boolean arg9, boolean arg10,
Wale Ogunwaleb1faf602016-01-27 09:12:31 -080081 Rect arg11, Configuration arg12, int arg13, boolean arg14, boolean arg15)
82 throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -080083 // TODO Auto-generated method stub
Adam Lesinski282e1812014-01-23 18:17:42 -080084 }
85
86 @Override
87 public void addWindowToken(IBinder arg0, int arg1) throws RemoteException {
88 // TODO Auto-generated method stub
89
90 }
91
92 @Override
93 public void clearForcedDisplaySize(int displayId) throws RemoteException {
94 // TODO Auto-generated method stub
95 }
96
97 @Override
98 public void clearForcedDisplayDensity(int displayId) throws RemoteException {
99 // TODO Auto-generated method stub
100 }
101
102 @Override
103 public void setOverscan(int displayId, int left, int top, int right, int bottom)
104 throws RemoteException {
105 // TODO Auto-generated method stub
106 }
107
108 @Override
109 public void closeSystemDialogs(String arg0) throws RemoteException {
110 // TODO Auto-generated method stub
111
112 }
113
114 @Override
115 public void startFreezingScreen(int exitAnim, int enterAnim) {
116 // TODO Auto-generated method stub
117 }
118
119 @Override
120 public void stopFreezingScreen() {
121 // TODO Auto-generated method stub
122 }
123
124 @Override
125 public void disableKeyguard(IBinder arg0, String arg1) throws RemoteException {
126 // TODO Auto-generated method stub
127
128 }
129
130 @Override
131 public void executeAppTransition() throws RemoteException {
132 // TODO Auto-generated method stub
133
134 }
135
136 @Override
137 public void exitKeyguardSecurely(IOnKeyguardExitResult arg0) throws RemoteException {
138 // TODO Auto-generated method stub
139
140 }
141
142 @Override
143 public void freezeRotation(int arg0) throws RemoteException {
144 // TODO Auto-generated method stub
145
146 }
147
148 @Override
149 public float getAnimationScale(int arg0) throws RemoteException {
150 // TODO Auto-generated method stub
151 return 0;
152 }
153
154 @Override
155 public float[] getAnimationScales() throws RemoteException {
156 // TODO Auto-generated method stub
157 return null;
158 }
159
160 @Override
161 public int getAppOrientation(IApplicationToken arg0) throws RemoteException {
162 // TODO Auto-generated method stub
163 return 0;
164 }
165
166 @Override
167 public int getPendingAppTransition() throws RemoteException {
168 // TODO Auto-generated method stub
169 return 0;
170 }
171
172 @Override
173 public boolean inKeyguardRestrictedInputMode() throws RemoteException {
174 // TODO Auto-generated method stub
175 return false;
176 }
177
178 @Override
179 public boolean inputMethodClientHasFocus(IInputMethodClient arg0) throws RemoteException {
180 // TODO Auto-generated method stub
181 return false;
182 }
183
184 @Override
185 public boolean isKeyguardLocked() throws RemoteException {
186 // TODO Auto-generated method stub
187 return false;
188 }
189
190 @Override
191 public boolean isKeyguardSecure() throws RemoteException {
192 // TODO Auto-generated method stub
193 return false;
194 }
195
196 @Override
197 public boolean isViewServerRunning() throws RemoteException {
198 // TODO Auto-generated method stub
199 return false;
200 }
201
202 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700203 public IWindowSession openSession(IWindowSessionCallback argn1, IInputMethodClient arg0,
204 IInputContext arg1) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800205 // TODO Auto-generated method stub
206 return null;
207 }
208
209 @Override
210 public void overridePendingAppTransition(String arg0, int arg1, int arg2,
211 IRemoteCallback startedCallback) throws RemoteException {
212 // TODO Auto-generated method stub
213
214 }
215
216 @Override
217 public void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth,
218 int startHeight) throws RemoteException {
219 // TODO Auto-generated method stub
220 }
221
222 @Override
Chet Haase10e23ab2015-02-11 15:08:38 -0800223 public void overridePendingAppTransitionClipReveal(int startX, int startY,
224 int startWidth, int startHeight) throws RemoteException {
225 // TODO Auto-generated method stub
226 }
227
228 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800229 public void overridePendingAppTransitionThumb(Bitmap srcThumb, int startX, int startY,
230 IRemoteCallback startedCallback, boolean scaleUp) throws RemoteException {
231 // TODO Auto-generated method stub
232 }
233
234 @Override
Winson Chunga4ccb862014-08-22 15:26:27 -0700235 public void overridePendingAppTransitionAspectScaledThumb(Bitmap srcThumb, int startX,
Winson Chung2e7f3bd2014-09-05 13:17:22 +0200236 int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback,
237 boolean scaleUp) {
Winson Chunga4ccb862014-08-22 15:26:27 -0700238 // TODO Auto-generated method stub
239 }
240
241 @Override
Winson Chung044d5292014-11-06 11:05:19 -0800242 public void overridePendingAppTransitionInPlace(String packageName, int anim) {
243 // TODO Auto-generated method stub
244 }
245
246 @Override
Jorim Jaggi1a2f3ab2015-11-06 21:31:17 +0100247 public void overridePendingAppTransitionMultiThumbFuture(
248 IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
249 boolean scaleUp) throws RemoteException {
250
251 }
252
253 @Override
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700254 public void overridePendingAppTransitionMultiThumb(AppTransitionAnimationSpec[] specs,
Filip Gruszczynskif254e952015-10-30 16:14:57 -0700255 IRemoteCallback callback0, IRemoteCallback callback1, boolean scaleUp) {
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700256 // TODO Auto-generated method stub
257 }
258
259 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800260 public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
261 // TODO Auto-generated method stub
262
263 }
264
265 @Override
266 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
267 // TODO Auto-generated method stub
268
269 }
270
271 @Override
272 public void reenableKeyguard(IBinder arg0) throws RemoteException {
273 // TODO Auto-generated method stub
274
275 }
276
277 @Override
278 public void removeAppToken(IBinder arg0) throws RemoteException {
279 // TODO Auto-generated method stub
280
281 }
282
283 @Override
284 public void removeWindowToken(IBinder arg0) throws RemoteException {
285 // TODO Auto-generated method stub
286
287 }
288
289 @Override
290 public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
291 // TODO Auto-generated method stub
292
293 }
294
295 @Override
Dianne Hackborn4025c962015-03-17 17:22:33 -0700296 public boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver)
297 throws RemoteException {
298 // TODO Auto-generated method stub
299 return false;
300 }
301
302 @Override
303 public Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth,
Winson8b1871d2015-11-20 09:56:20 -0800304 int maxHeight, float frameScale) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800305 // TODO Auto-generated method stub
306 return null;
307 }
308
309 @Override
310 public void setAnimationScale(int arg0, float arg1) throws RemoteException {
311 // TODO Auto-generated method stub
312
313 }
314
315 @Override
316 public void setAnimationScales(float[] arg0) throws RemoteException {
317 // TODO Auto-generated method stub
318
319 }
320
321 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700322 public float getCurrentAnimatorScale() throws RemoteException {
323 return 0;
324 }
325
326 @Override
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800327 public void setAppTask(IBinder arg0, int arg1, int arg2, Rect arg3, Configuration arg4,
328 int arg5, boolean arg6)
Filip Gruszczynski1bca2972015-09-01 09:29:11 -0700329 throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800330 // TODO Auto-generated method stub
Adam Lesinski282e1812014-01-23 18:17:42 -0800331 }
332
333 @Override
334 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
335 // TODO Auto-generated method stub
336 }
337
338 @Override
339 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
340 CharSequence arg4, int arg5, int arg6, int arg7, int arg8, IBinder arg9, boolean arg10)
341 throws RemoteException {
342 // TODO Auto-generated method stub
343 }
344
345 @Override
346 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
347 // TODO Auto-generated method stub
348
349 }
350
351 @Override
Robert Carre12aece2016-02-02 22:43:27 -0800352 public void notifyAppStopped(IBinder token) throws RemoteException {
353 // TODO Auto-generated method stub
354 }
355
356 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800357 public void setEventDispatching(boolean arg0) throws RemoteException {
358 // TODO Auto-generated method stub
359 }
360
361 @Override
362 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
363 // TODO Auto-generated method stub
364 }
365
366 @Override
367 public void getInitialDisplaySize(int displayId, Point size) {
368 // TODO Auto-generated method stub
369 }
370
371 @Override
372 public void getBaseDisplaySize(int displayId, Point size) {
373 // TODO Auto-generated method stub
374 }
375
376 @Override
377 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
378 // TODO Auto-generated method stub
379 }
380
381 @Override
382 public int getInitialDisplayDensity(int displayId) {
383 return -1;
384 }
385
386 @Override
387 public int getBaseDisplayDensity(int displayId) {
388 return -1;
389 }
390
391 @Override
392 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
393 // TODO Auto-generated method stub
394 }
395
396 @Override
Jeff Brownd46747a2015-04-15 19:02:36 -0700397 public void setForcedDisplayScalingMode(int displayId, int mode) {
398 }
399
400 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800401 public void setInTouchMode(boolean arg0) throws RemoteException {
402 // TODO Auto-generated method stub
403 }
404
405 @Override
406 public void setNewConfiguration(Configuration arg0) throws RemoteException {
407 // TODO Auto-generated method stub
408 }
409
410 @Override
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100411 public void setScreenCaptureDisabled(int userId, boolean disabled) {
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100412 // TODO Auto-generated method stub
413 }
414
415 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800416 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
417 // TODO Auto-generated method stub
418 }
419
420 @Override
421 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
422 // TODO Auto-generated method stub
423 }
424
425 @Override
426 public void showStrictModeViolation(boolean arg0) throws RemoteException {
427 // TODO Auto-generated method stub
428 }
429
430 @Override
431 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
432 // TODO Auto-generated method stub
433 }
434
435 @Override
436 public boolean startViewServer(int arg0) throws RemoteException {
437 // TODO Auto-generated method stub
438 return false;
439 }
440
441 @Override
442 public void statusBarVisibilityChanged(int arg0) throws RemoteException {
443 // TODO Auto-generated method stub
444 }
445
446 @Override
447 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
448 // TODO Auto-generated method stub
449 }
450
451 @Override
452 public boolean stopViewServer() throws RemoteException {
453 // TODO Auto-generated method stub
454 return false;
455 }
456
457 @Override
458 public void thawRotation() throws RemoteException {
459 // TODO Auto-generated method stub
460 }
461
462 @Override
463 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
464 throws RemoteException {
465 // TODO Auto-generated method stub
466 return null;
467 }
468
469 @Override
470 public int watchRotation(IRotationWatcher arg0) throws RemoteException {
471 // TODO Auto-generated method stub
472 return 0;
473 }
474
475 @Override
476 public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException {
477 }
478
479 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800480 public IBinder asBinder() {
481 // TODO Auto-generated method stub
482 return null;
483 }
484
485 @Override
486 public int getPreferredOptionsPanelGravity() throws RemoteException {
487 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
488 }
489
490 @Override
491 public void dismissKeyguard() {
492 }
493
494 @Override
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200495 public void keyguardGoingAway(boolean disableWindowAnimations,
496 boolean keyguardGoingToNotificationShade) throws RemoteException {
Craig Mautner8bd94d52014-05-29 10:49:10 -0700497 }
498
499 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800500 public void lockNow(Bundle options) {
501 // TODO Auto-generated method stub
502 }
503
504 @Override
505 public boolean isSafeModeEnabled() {
506 return false;
507 }
508
509 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800510 public boolean isRotationFrozen() throws RemoteException {
511 // TODO Auto-generated method stub
512 return false;
513 }
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200514
515 @Override
516 public void enableScreenIfNeeded() throws RemoteException {
Svetoslavdd137a82014-04-10 12:48:07 -0700517 // TODO Auto-generated method stub
518 }
519
520 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700521 public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700522 // TODO Auto-generated method stub
523 return false;
524 }
525
526 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700527 public WindowContentFrameStats getWindowContentFrameStats(IBinder token)
Svetoslavdd137a82014-04-10 12:48:07 -0700528 throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700529 // TODO Auto-generated method stub
530 return null;
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200531 }
Winson6b05f802015-11-02 16:38:25 -0800532
533 @Override
Jorim Jaggi1a2f3ab2015-11-06 21:31:17 +0100534 public int getDockedStackSide() throws RemoteException {
535 return 0;
536 }
537
538 @Override
539 public void setDockedStackResizing(boolean resizing) throws RemoteException {
540 }
541
542 @Override
Winson6b05f802015-11-02 16:38:25 -0800543 public void cancelTaskWindowTransition(int taskId) {
544 }
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800545
546 @Override
Winson13d30662015-11-06 15:30:29 -0800547 public void cancelTaskThumbnailTransition(int taskId) {
548 }
549
550 @Override
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800551 public void endProlongedAnimations() {
552 }
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800553
554 @Override
Jorim Jaggi2a374552016-01-05 15:25:24 +0100555 public void registerDockedStackListener(IDockedStackListener listener) throws RemoteException {
556 }
557
558 @Override
559 public void setResizeDimLayer(boolean visible, int targetStackId, float alpha)
560 throws RemoteException {
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800561 }
Wale Ogunwaleb2d13562016-01-13 15:08:29 -0800562
563 @Override
564 public void requestAppKeyboardShortcuts(IResultReceiver receiver) throws RemoteException {
565 }
Jorim Jaggi1444cfd2016-02-01 14:24:05 -0800566
567 @Override
568 public void getStableInsets(Rect outInsets) throws RemoteException {
569 }
Muyuan Li94ce94e2016-02-24 16:20:54 -0800570
571 @Override
572 public void registerShortcutKey(long shortcutCode, IShortcutService service)
573 throws RemoteException {}
Adam Lesinski282e1812014-01-23 18:17:42 -0800574}