blob: 62859ecca9d4958cad93550387bccab1e9add22f [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;
Adam Lesinski282e1812014-01-23 18:17:42 -080033
Svetoslavdd137a82014-04-10 12:48:07 -070034import java.lang.Override;
Adam Lesinski282e1812014-01-23 18:17:42 -080035
36/**
37 * Basic implementation of {@link IWindowManager} so that {@link Display} (and
38 * {@link Display_Delegate}) can return a valid instance.
39 */
40public class IWindowManagerImpl implements IWindowManager {
41
42 private final Configuration mConfig;
43 private final DisplayMetrics mMetrics;
44 private final int mRotation;
45 private final boolean mHasNavigationBar;
46
47 public IWindowManagerImpl(Configuration config, DisplayMetrics metrics, int rotation,
48 boolean hasNavigationBar) {
49 mConfig = config;
50 mMetrics = metrics;
51 mRotation = rotation;
52 mHasNavigationBar = hasNavigationBar;
53 }
54
55 // custom API.
56
57 public DisplayMetrics getMetrics() {
58 return mMetrics;
59 }
60
61 // ---- implementation of IWindowManager that we care about ----
62
63 @Override
64 public int getRotation() throws RemoteException {
65 return mRotation;
66 }
67
68 @Override
69 public boolean hasNavigationBar() {
70 return mHasNavigationBar;
71 }
72
73 // ---- unused implementation of IWindowManager ----
74
75 @Override
Wale Ogunwale861aaa92015-08-06 12:34:44 -070076 public Configuration addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4,
77 boolean arg5, boolean arg6, int arg7, int arg8, boolean arg9, boolean arg10,
78 Rect arg11) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -080079 // TODO Auto-generated method stub
Wale Ogunwale861aaa92015-08-06 12:34:44 -070080 return Configuration.EMPTY;
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
Adam Lesinski282e1812014-01-23 18:17:42 -0800244 public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
245 // TODO Auto-generated method stub
246
247 }
248
249 @Override
250 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
251 // TODO Auto-generated method stub
252
253 }
254
255 @Override
256 public void reenableKeyguard(IBinder arg0) throws RemoteException {
257 // TODO Auto-generated method stub
258
259 }
260
261 @Override
262 public void removeAppToken(IBinder arg0) throws RemoteException {
263 // TODO Auto-generated method stub
264
265 }
266
267 @Override
268 public void removeWindowToken(IBinder arg0) throws RemoteException {
269 // TODO Auto-generated method stub
270
271 }
272
273 @Override
274 public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
275 // TODO Auto-generated method stub
276
277 }
278
279 @Override
Dianne Hackborn4025c962015-03-17 17:22:33 -0700280 public boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver)
281 throws RemoteException {
282 // TODO Auto-generated method stub
283 return false;
284 }
285
286 @Override
287 public Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth,
288 int maxHeight) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800289 // TODO Auto-generated method stub
290 return null;
291 }
292
293 @Override
294 public void setAnimationScale(int arg0, float arg1) throws RemoteException {
295 // TODO Auto-generated method stub
296
297 }
298
299 @Override
300 public void setAnimationScales(float[] arg0) throws RemoteException {
301 // TODO Auto-generated method stub
302
303 }
304
305 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700306 public float getCurrentAnimatorScale() throws RemoteException {
307 return 0;
308 }
309
310 @Override
Wale Ogunwale861aaa92015-08-06 12:34:44 -0700311 public Configuration setAppTask(IBinder arg0, int arg1, Rect arg2) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800312 // TODO Auto-generated method stub
Wale Ogunwale861aaa92015-08-06 12:34:44 -0700313 return Configuration.EMPTY;
Adam Lesinski282e1812014-01-23 18:17:42 -0800314 }
315
316 @Override
317 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
318 // TODO Auto-generated method stub
319 }
320
321 @Override
322 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
323 CharSequence arg4, int arg5, int arg6, int arg7, int arg8, IBinder arg9, boolean arg10)
324 throws RemoteException {
325 // TODO Auto-generated method stub
326 }
327
328 @Override
329 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
330 // TODO Auto-generated method stub
331
332 }
333
334 @Override
335 public void setAppWillBeHidden(IBinder arg0) throws RemoteException {
336 // TODO Auto-generated method stub
337 }
338
339 @Override
340 public void setEventDispatching(boolean arg0) throws RemoteException {
341 // TODO Auto-generated method stub
342 }
343
344 @Override
345 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
346 // TODO Auto-generated method stub
347 }
348
349 @Override
350 public void getInitialDisplaySize(int displayId, Point size) {
351 // TODO Auto-generated method stub
352 }
353
354 @Override
355 public void getBaseDisplaySize(int displayId, Point size) {
356 // TODO Auto-generated method stub
357 }
358
359 @Override
360 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
361 // TODO Auto-generated method stub
362 }
363
364 @Override
365 public int getInitialDisplayDensity(int displayId) {
366 return -1;
367 }
368
369 @Override
370 public int getBaseDisplayDensity(int displayId) {
371 return -1;
372 }
373
374 @Override
375 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
376 // TODO Auto-generated method stub
377 }
378
379 @Override
Jeff Brownd46747a2015-04-15 19:02:36 -0700380 public void setForcedDisplayScalingMode(int displayId, int mode) {
381 }
382
383 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800384 public void setInTouchMode(boolean arg0) throws RemoteException {
385 // TODO Auto-generated method stub
386 }
387
388 @Override
389 public void setNewConfiguration(Configuration arg0) throws RemoteException {
390 // TODO Auto-generated method stub
391 }
392
393 @Override
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100394 public void setScreenCaptureDisabled(int userId, boolean disabled) {
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100395 // TODO Auto-generated method stub
396 }
397
398 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800399 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
400 // TODO Auto-generated method stub
401 }
402
403 @Override
404 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
405 // TODO Auto-generated method stub
406 }
407
408 @Override
409 public void showStrictModeViolation(boolean arg0) throws RemoteException {
410 // TODO Auto-generated method stub
411 }
412
413 @Override
414 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
415 // TODO Auto-generated method stub
416 }
417
418 @Override
419 public boolean startViewServer(int arg0) throws RemoteException {
420 // TODO Auto-generated method stub
421 return false;
422 }
423
424 @Override
425 public void statusBarVisibilityChanged(int arg0) throws RemoteException {
426 // TODO Auto-generated method stub
427 }
428
429 @Override
430 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
431 // TODO Auto-generated method stub
432 }
433
434 @Override
435 public boolean stopViewServer() throws RemoteException {
436 // TODO Auto-generated method stub
437 return false;
438 }
439
440 @Override
441 public void thawRotation() throws RemoteException {
442 // TODO Auto-generated method stub
443 }
444
445 @Override
446 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
447 throws RemoteException {
448 // TODO Auto-generated method stub
449 return null;
450 }
451
452 @Override
453 public int watchRotation(IRotationWatcher arg0) throws RemoteException {
454 // TODO Auto-generated method stub
455 return 0;
456 }
457
458 @Override
459 public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException {
460 }
461
462 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800463 public IBinder asBinder() {
464 // TODO Auto-generated method stub
465 return null;
466 }
467
468 @Override
469 public int getPreferredOptionsPanelGravity() throws RemoteException {
470 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
471 }
472
473 @Override
474 public void dismissKeyguard() {
475 }
476
477 @Override
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200478 public void keyguardGoingAway(boolean disableWindowAnimations,
479 boolean keyguardGoingToNotificationShade) throws RemoteException {
Craig Mautner8bd94d52014-05-29 10:49:10 -0700480 }
481
482 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800483 public void lockNow(Bundle options) {
484 // TODO Auto-generated method stub
485 }
486
487 @Override
488 public boolean isSafeModeEnabled() {
489 return false;
490 }
491
492 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800493 public boolean isRotationFrozen() throws RemoteException {
494 // TODO Auto-generated method stub
495 return false;
496 }
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200497
498 @Override
499 public void enableScreenIfNeeded() throws RemoteException {
Svetoslavdd137a82014-04-10 12:48:07 -0700500 // TODO Auto-generated method stub
501 }
502
503 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700504 public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700505 // TODO Auto-generated method stub
506 return false;
507 }
508
509 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700510 public WindowContentFrameStats getWindowContentFrameStats(IBinder token)
Svetoslavdd137a82014-04-10 12:48:07 -0700511 throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700512 // TODO Auto-generated method stub
513 return null;
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200514 }
Adam Lesinski282e1812014-01-23 18:17:42 -0800515}