blob: ed8b56e1e6012af177a2ef376920947192472b51 [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,
Filip Gruszczynski1bca2972015-09-01 09:29:11 -070079 Rect arg11, Configuration arg12) 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
Filip Gruszczynskiad98eeb2015-08-19 15:12:11 -0700244 public void overridePendingAppTransitionMultiThumb(AppTransitionAnimationSpec[] specs,
245 IRemoteCallback callback, boolean scaleUp) {
246 // TODO Auto-generated method stub
247 }
248
249 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800250 public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
251 // TODO Auto-generated method stub
252
253 }
254
255 @Override
256 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
257 // TODO Auto-generated method stub
258
259 }
260
261 @Override
262 public void reenableKeyguard(IBinder arg0) throws RemoteException {
263 // TODO Auto-generated method stub
264
265 }
266
267 @Override
268 public void removeAppToken(IBinder arg0) throws RemoteException {
269 // TODO Auto-generated method stub
270
271 }
272
273 @Override
274 public void removeWindowToken(IBinder arg0) throws RemoteException {
275 // TODO Auto-generated method stub
276
277 }
278
279 @Override
280 public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
281 // TODO Auto-generated method stub
282
283 }
284
285 @Override
Dianne Hackborn4025c962015-03-17 17:22:33 -0700286 public boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver)
287 throws RemoteException {
288 // TODO Auto-generated method stub
289 return false;
290 }
291
292 @Override
293 public Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth,
294 int maxHeight) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800295 // TODO Auto-generated method stub
296 return null;
297 }
298
299 @Override
300 public void setAnimationScale(int arg0, float arg1) throws RemoteException {
301 // TODO Auto-generated method stub
302
303 }
304
305 @Override
306 public void setAnimationScales(float[] arg0) throws RemoteException {
307 // TODO Auto-generated method stub
308
309 }
310
311 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700312 public float getCurrentAnimatorScale() throws RemoteException {
313 return 0;
314 }
315
316 @Override
Filip Gruszczynski1bca2972015-09-01 09:29:11 -0700317 public void setAppTask(IBinder arg0, int arg1, Rect arg2, Configuration arg3)
318 throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800319 // TODO Auto-generated method stub
Adam Lesinski282e1812014-01-23 18:17:42 -0800320 }
321
322 @Override
323 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
324 // TODO Auto-generated method stub
325 }
326
327 @Override
328 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
329 CharSequence arg4, int arg5, int arg6, int arg7, int arg8, IBinder arg9, boolean arg10)
330 throws RemoteException {
331 // TODO Auto-generated method stub
332 }
333
334 @Override
335 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
336 // TODO Auto-generated method stub
337
338 }
339
340 @Override
341 public void setAppWillBeHidden(IBinder arg0) throws RemoteException {
342 // TODO Auto-generated method stub
343 }
344
345 @Override
346 public void setEventDispatching(boolean arg0) throws RemoteException {
347 // TODO Auto-generated method stub
348 }
349
350 @Override
351 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
352 // TODO Auto-generated method stub
353 }
354
355 @Override
356 public void getInitialDisplaySize(int displayId, Point size) {
357 // TODO Auto-generated method stub
358 }
359
360 @Override
361 public void getBaseDisplaySize(int displayId, Point size) {
362 // TODO Auto-generated method stub
363 }
364
365 @Override
366 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
367 // TODO Auto-generated method stub
368 }
369
370 @Override
371 public int getInitialDisplayDensity(int displayId) {
372 return -1;
373 }
374
375 @Override
376 public int getBaseDisplayDensity(int displayId) {
377 return -1;
378 }
379
380 @Override
381 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
382 // TODO Auto-generated method stub
383 }
384
385 @Override
Jeff Brownd46747a2015-04-15 19:02:36 -0700386 public void setForcedDisplayScalingMode(int displayId, int mode) {
387 }
388
389 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800390 public void setInTouchMode(boolean arg0) throws RemoteException {
391 // TODO Auto-generated method stub
392 }
393
394 @Override
395 public void setNewConfiguration(Configuration arg0) throws RemoteException {
396 // TODO Auto-generated method stub
397 }
398
399 @Override
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100400 public void setScreenCaptureDisabled(int userId, boolean disabled) {
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100401 // TODO Auto-generated method stub
402 }
403
404 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800405 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
406 // TODO Auto-generated method stub
407 }
408
409 @Override
410 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
411 // TODO Auto-generated method stub
412 }
413
414 @Override
415 public void showStrictModeViolation(boolean arg0) throws RemoteException {
416 // TODO Auto-generated method stub
417 }
418
419 @Override
420 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
421 // TODO Auto-generated method stub
422 }
423
424 @Override
425 public boolean startViewServer(int arg0) throws RemoteException {
426 // TODO Auto-generated method stub
427 return false;
428 }
429
430 @Override
431 public void statusBarVisibilityChanged(int arg0) throws RemoteException {
432 // TODO Auto-generated method stub
433 }
434
435 @Override
436 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
437 // TODO Auto-generated method stub
438 }
439
440 @Override
441 public boolean stopViewServer() throws RemoteException {
442 // TODO Auto-generated method stub
443 return false;
444 }
445
446 @Override
447 public void thawRotation() throws RemoteException {
448 // TODO Auto-generated method stub
449 }
450
451 @Override
452 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
453 throws RemoteException {
454 // TODO Auto-generated method stub
455 return null;
456 }
457
458 @Override
459 public int watchRotation(IRotationWatcher arg0) throws RemoteException {
460 // TODO Auto-generated method stub
461 return 0;
462 }
463
464 @Override
465 public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException {
466 }
467
468 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800469 public IBinder asBinder() {
470 // TODO Auto-generated method stub
471 return null;
472 }
473
474 @Override
475 public int getPreferredOptionsPanelGravity() throws RemoteException {
476 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
477 }
478
479 @Override
480 public void dismissKeyguard() {
481 }
482
483 @Override
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200484 public void keyguardGoingAway(boolean disableWindowAnimations,
485 boolean keyguardGoingToNotificationShade) throws RemoteException {
Craig Mautner8bd94d52014-05-29 10:49:10 -0700486 }
487
488 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800489 public void lockNow(Bundle options) {
490 // TODO Auto-generated method stub
491 }
492
493 @Override
494 public boolean isSafeModeEnabled() {
495 return false;
496 }
497
498 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800499 public boolean isRotationFrozen() throws RemoteException {
500 // TODO Auto-generated method stub
501 return false;
502 }
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200503
504 @Override
505 public void enableScreenIfNeeded() throws RemoteException {
Svetoslavdd137a82014-04-10 12:48:07 -0700506 // TODO Auto-generated method stub
507 }
508
509 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700510 public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700511 // TODO Auto-generated method stub
512 return false;
513 }
514
515 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700516 public WindowContentFrameStats getWindowContentFrameStats(IBinder token)
Svetoslavdd137a82014-04-10 12:48:07 -0700517 throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700518 // TODO Auto-generated method stub
519 return null;
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200520 }
Adam Lesinski282e1812014-01-23 18:17:42 -0800521}