blob: 82012c1e2767d16a176635d9d0863f58e7d6d475 [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;
Dianne Hackborn4025c962015-03-17 17:22:33 -070020import com.android.internal.app.IAssistScreenshotReceiver;
Adam Lesinski282e1812014-01-23 18:17:42 -080021import com.android.internal.view.IInputContext;
22import com.android.internal.view.IInputMethodClient;
23
24import android.content.res.CompatibilityInfo;
25import android.content.res.Configuration;
26import android.graphics.Bitmap;
Adam Lesinski282e1812014-01-23 18:17:42 -080027import android.os.Bundle;
28import android.os.IBinder;
29import android.os.IRemoteCallback;
30import android.os.RemoteException;
31import android.util.DisplayMetrics;
Adam Lesinski282e1812014-01-23 18:17:42 -080032
Svetoslavdd137a82014-04-10 12:48:07 -070033import java.lang.Override;
Adam Lesinski282e1812014-01-23 18:17:42 -080034
35/**
36 * Basic implementation of {@link IWindowManager} so that {@link Display} (and
37 * {@link Display_Delegate}) can return a valid instance.
38 */
39public class IWindowManagerImpl implements IWindowManager {
40
41 private final Configuration mConfig;
42 private final DisplayMetrics mMetrics;
43 private final int mRotation;
44 private final boolean mHasNavigationBar;
45
46 public IWindowManagerImpl(Configuration config, DisplayMetrics metrics, int rotation,
47 boolean hasNavigationBar) {
48 mConfig = config;
49 mMetrics = metrics;
50 mRotation = rotation;
51 mHasNavigationBar = hasNavigationBar;
52 }
53
54 // custom API.
55
56 public DisplayMetrics getMetrics() {
57 return mMetrics;
58 }
59
60 // ---- implementation of IWindowManager that we care about ----
61
62 @Override
63 public int getRotation() throws RemoteException {
64 return mRotation;
65 }
66
67 @Override
68 public boolean hasNavigationBar() {
69 return mHasNavigationBar;
70 }
71
72 // ---- unused implementation of IWindowManager ----
73
74 @Override
75 public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4,
Craig Mautnerbb742462014-07-07 15:28:55 -070076 boolean arg5, boolean arg6, int arg7, int arg8, boolean arg9, boolean arg10)
Adam Lesinski282e1812014-01-23 18:17:42 -080077 throws RemoteException {
78 // TODO Auto-generated method stub
79
80 }
81
82 @Override
83 public void addWindowToken(IBinder arg0, int arg1) throws RemoteException {
84 // TODO Auto-generated method stub
85
86 }
87
88 @Override
89 public void clearForcedDisplaySize(int displayId) throws RemoteException {
90 // TODO Auto-generated method stub
91 }
92
93 @Override
94 public void clearForcedDisplayDensity(int displayId) throws RemoteException {
95 // TODO Auto-generated method stub
96 }
97
98 @Override
99 public void setOverscan(int displayId, int left, int top, int right, int bottom)
100 throws RemoteException {
101 // TODO Auto-generated method stub
102 }
103
104 @Override
105 public void closeSystemDialogs(String arg0) throws RemoteException {
106 // TODO Auto-generated method stub
107
108 }
109
110 @Override
111 public void startFreezingScreen(int exitAnim, int enterAnim) {
112 // TODO Auto-generated method stub
113 }
114
115 @Override
116 public void stopFreezingScreen() {
117 // TODO Auto-generated method stub
118 }
119
120 @Override
121 public void disableKeyguard(IBinder arg0, String arg1) throws RemoteException {
122 // TODO Auto-generated method stub
123
124 }
125
126 @Override
127 public void executeAppTransition() throws RemoteException {
128 // TODO Auto-generated method stub
129
130 }
131
132 @Override
133 public void exitKeyguardSecurely(IOnKeyguardExitResult arg0) throws RemoteException {
134 // TODO Auto-generated method stub
135
136 }
137
138 @Override
139 public void freezeRotation(int arg0) throws RemoteException {
140 // TODO Auto-generated method stub
141
142 }
143
144 @Override
145 public float getAnimationScale(int arg0) throws RemoteException {
146 // TODO Auto-generated method stub
147 return 0;
148 }
149
150 @Override
151 public float[] getAnimationScales() throws RemoteException {
152 // TODO Auto-generated method stub
153 return null;
154 }
155
156 @Override
157 public int getAppOrientation(IApplicationToken arg0) throws RemoteException {
158 // TODO Auto-generated method stub
159 return 0;
160 }
161
162 @Override
163 public int getPendingAppTransition() throws RemoteException {
164 // TODO Auto-generated method stub
165 return 0;
166 }
167
168 @Override
169 public boolean inKeyguardRestrictedInputMode() throws RemoteException {
170 // TODO Auto-generated method stub
171 return false;
172 }
173
174 @Override
175 public boolean inputMethodClientHasFocus(IInputMethodClient arg0) throws RemoteException {
176 // TODO Auto-generated method stub
177 return false;
178 }
179
180 @Override
181 public boolean isKeyguardLocked() throws RemoteException {
182 // TODO Auto-generated method stub
183 return false;
184 }
185
186 @Override
187 public boolean isKeyguardSecure() throws RemoteException {
188 // TODO Auto-generated method stub
189 return false;
190 }
191
192 @Override
193 public boolean isViewServerRunning() throws RemoteException {
194 // TODO Auto-generated method stub
195 return false;
196 }
197
198 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700199 public IWindowSession openSession(IWindowSessionCallback argn1, IInputMethodClient arg0,
200 IInputContext arg1) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800201 // TODO Auto-generated method stub
202 return null;
203 }
204
205 @Override
206 public void overridePendingAppTransition(String arg0, int arg1, int arg2,
207 IRemoteCallback startedCallback) throws RemoteException {
208 // TODO Auto-generated method stub
209
210 }
211
212 @Override
213 public void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth,
214 int startHeight) throws RemoteException {
215 // TODO Auto-generated method stub
216 }
217
218 @Override
Chet Haase10e23ab2015-02-11 15:08:38 -0800219 public void overridePendingAppTransitionClipReveal(int startX, int startY,
220 int startWidth, int startHeight) throws RemoteException {
221 // TODO Auto-generated method stub
222 }
223
224 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800225 public void overridePendingAppTransitionThumb(Bitmap srcThumb, int startX, int startY,
226 IRemoteCallback startedCallback, boolean scaleUp) throws RemoteException {
227 // TODO Auto-generated method stub
228 }
229
230 @Override
Winson Chunga4ccb862014-08-22 15:26:27 -0700231 public void overridePendingAppTransitionAspectScaledThumb(Bitmap srcThumb, int startX,
Winson Chung2e7f3bd2014-09-05 13:17:22 +0200232 int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback,
233 boolean scaleUp) {
Winson Chunga4ccb862014-08-22 15:26:27 -0700234 // TODO Auto-generated method stub
235 }
236
237 @Override
Winson Chung044d5292014-11-06 11:05:19 -0800238 public void overridePendingAppTransitionInPlace(String packageName, int anim) {
239 // TODO Auto-generated method stub
240 }
241
242 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800243 public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
244 // TODO Auto-generated method stub
245
246 }
247
248 @Override
249 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
250 // TODO Auto-generated method stub
251
252 }
253
254 @Override
255 public void reenableKeyguard(IBinder arg0) throws RemoteException {
256 // TODO Auto-generated method stub
257
258 }
259
260 @Override
261 public void removeAppToken(IBinder arg0) throws RemoteException {
262 // TODO Auto-generated method stub
263
264 }
265
266 @Override
267 public void removeWindowToken(IBinder arg0) throws RemoteException {
268 // TODO Auto-generated method stub
269
270 }
271
272 @Override
273 public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
274 // TODO Auto-generated method stub
275
276 }
277
278 @Override
Dianne Hackborn4025c962015-03-17 17:22:33 -0700279 public boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver)
280 throws RemoteException {
281 // TODO Auto-generated method stub
282 return false;
283 }
284
285 @Override
286 public Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth,
287 int maxHeight) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800288 // TODO Auto-generated method stub
289 return null;
290 }
291
292 @Override
293 public void setAnimationScale(int arg0, float arg1) throws RemoteException {
294 // TODO Auto-generated method stub
295
296 }
297
298 @Override
299 public void setAnimationScales(float[] arg0) throws RemoteException {
300 // TODO Auto-generated method stub
301
302 }
303
304 @Override
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700305 public float getCurrentAnimatorScale() throws RemoteException {
306 return 0;
307 }
308
309 @Override
Craig Mautner83162a92015-01-26 14:43:30 -0800310 public void setAppTask(IBinder arg0, int arg1) throws RemoteException {
Adam Lesinski282e1812014-01-23 18:17:42 -0800311 // TODO Auto-generated method stub
312
313 }
314
315 @Override
316 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
317 // TODO Auto-generated method stub
318 }
319
320 @Override
321 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
322 CharSequence arg4, int arg5, int arg6, int arg7, int arg8, IBinder arg9, boolean arg10)
323 throws RemoteException {
324 // TODO Auto-generated method stub
325 }
326
327 @Override
328 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
329 // TODO Auto-generated method stub
330
331 }
332
333 @Override
334 public void setAppWillBeHidden(IBinder arg0) throws RemoteException {
335 // TODO Auto-generated method stub
336 }
337
338 @Override
339 public void setEventDispatching(boolean arg0) throws RemoteException {
340 // TODO Auto-generated method stub
341 }
342
343 @Override
344 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
345 // TODO Auto-generated method stub
346 }
347
348 @Override
349 public void getInitialDisplaySize(int displayId, Point size) {
350 // TODO Auto-generated method stub
351 }
352
353 @Override
354 public void getBaseDisplaySize(int displayId, Point size) {
355 // TODO Auto-generated method stub
356 }
357
358 @Override
359 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException {
360 // TODO Auto-generated method stub
361 }
362
363 @Override
364 public int getInitialDisplayDensity(int displayId) {
365 return -1;
366 }
367
368 @Override
369 public int getBaseDisplayDensity(int displayId) {
370 return -1;
371 }
372
373 @Override
374 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
375 // TODO Auto-generated method stub
376 }
377
378 @Override
Jeff Brownd46747a2015-04-15 19:02:36 -0700379 public void setForcedDisplayScalingMode(int displayId, int mode) {
380 }
381
382 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800383 public void setInTouchMode(boolean arg0) throws RemoteException {
384 // TODO Auto-generated method stub
385 }
386
387 @Override
388 public void setNewConfiguration(Configuration arg0) throws RemoteException {
389 // TODO Auto-generated method stub
390 }
391
392 @Override
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100393 public void setScreenCaptureDisabled(int userId, boolean disabled) {
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100394 // TODO Auto-generated method stub
395 }
396
397 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800398 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
399 // TODO Auto-generated method stub
400 }
401
402 @Override
403 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
404 // TODO Auto-generated method stub
405 }
406
407 @Override
408 public void showStrictModeViolation(boolean arg0) throws RemoteException {
409 // TODO Auto-generated method stub
410 }
411
412 @Override
413 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
414 // TODO Auto-generated method stub
415 }
416
417 @Override
418 public boolean startViewServer(int arg0) throws RemoteException {
419 // TODO Auto-generated method stub
420 return false;
421 }
422
423 @Override
424 public void statusBarVisibilityChanged(int arg0) throws RemoteException {
425 // TODO Auto-generated method stub
426 }
427
428 @Override
429 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
430 // TODO Auto-generated method stub
431 }
432
433 @Override
434 public boolean stopViewServer() throws RemoteException {
435 // TODO Auto-generated method stub
436 return false;
437 }
438
439 @Override
440 public void thawRotation() throws RemoteException {
441 // TODO Auto-generated method stub
442 }
443
444 @Override
445 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
446 throws RemoteException {
447 // TODO Auto-generated method stub
448 return null;
449 }
450
451 @Override
452 public int watchRotation(IRotationWatcher arg0) throws RemoteException {
453 // TODO Auto-generated method stub
454 return 0;
455 }
456
457 @Override
458 public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException {
459 }
460
461 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800462 public IBinder asBinder() {
463 // TODO Auto-generated method stub
464 return null;
465 }
466
467 @Override
468 public int getPreferredOptionsPanelGravity() throws RemoteException {
469 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
470 }
471
472 @Override
473 public void dismissKeyguard() {
474 }
475
476 @Override
Jorim Jaggi84a3e7a2014-08-13 17:58:58 +0200477 public void keyguardGoingAway(boolean disableWindowAnimations,
478 boolean keyguardGoingToNotificationShade) throws RemoteException {
Craig Mautner8bd94d52014-05-29 10:49:10 -0700479 }
480
481 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800482 public void lockNow(Bundle options) {
483 // TODO Auto-generated method stub
484 }
485
486 @Override
487 public boolean isSafeModeEnabled() {
488 return false;
489 }
490
491 @Override
Adam Lesinski282e1812014-01-23 18:17:42 -0800492 public boolean isRotationFrozen() throws RemoteException {
493 // TODO Auto-generated method stub
494 return false;
495 }
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200496
497 @Override
498 public void enableScreenIfNeeded() throws RemoteException {
Svetoslavdd137a82014-04-10 12:48:07 -0700499 // TODO Auto-generated method stub
500 }
501
502 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700503 public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700504 // TODO Auto-generated method stub
505 return false;
506 }
507
508 @Override
Colin Crossd4d46582014-04-10 22:41:05 -0700509 public WindowContentFrameStats getWindowContentFrameStats(IBinder token)
Svetoslavdd137a82014-04-10 12:48:07 -0700510 throws RemoteException {
Svetoslav1376d602014-03-13 11:17:26 -0700511 // TODO Auto-generated method stub
512 return null;
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200513 }
Adam Lesinski282e1812014-01-23 18:17:42 -0800514}