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