IWindowManagerImpl.java revision 2ad920759b1981eaf526fd37a314fbc5a3ed90ae
1/*
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 com.android.internal.view.IInputContext;
20import com.android.internal.view.IInputMethodClient;
21
22import android.content.res.CompatibilityInfo;
23import android.content.res.Configuration;
24import android.graphics.Bitmap;
25import android.graphics.Rect;
26import android.os.Bundle;
27import android.os.IBinder;
28import android.os.IRemoteCallback;
29import android.os.RemoteException;
30import android.util.DisplayMetrics;
31import android.view.Display;
32import android.view.Gravity;
33import android.view.IApplicationToken;
34import android.view.IInputFilter;
35import android.view.IOnKeyguardExitResult;
36import android.view.IRotationWatcher;
37import android.view.IWindowManager;
38import android.view.IWindowSession;
39
40import java.util.List;
41
42/**
43 * Basic implementation of {@link IWindowManager} so that {@link Display} (and
44 * {@link Display_Delegate}) can return a valid instance.
45 */
46public class IWindowManagerImpl implements IWindowManager {
47
48    private final Configuration mConfig;
49    private final DisplayMetrics mMetrics;
50    private final int mRotation;
51    private final boolean mHasSystemNavBar;
52    private final boolean mHasNavigationBar;
53
54    public IWindowManagerImpl(Configuration config, DisplayMetrics metrics, int rotation,
55            boolean hasSystemNavBar, boolean hasNavigationBar) {
56        mConfig = config;
57        mMetrics = metrics;
58        mRotation = rotation;
59        mHasSystemNavBar = hasSystemNavBar;
60        mHasNavigationBar = hasNavigationBar;
61    }
62
63    // custom API.
64
65    public DisplayMetrics getMetrics() {
66        return mMetrics;
67    }
68
69    // ---- implementation of IWindowManager that we care about ----
70
71    @Override
72    public int getRotation() throws RemoteException {
73        return mRotation;
74    }
75
76    @Override
77    public boolean hasNavigationBar() {
78        return mHasNavigationBar;
79    }
80
81    @Override
82    public boolean hasSystemNavBar() throws RemoteException {
83        return mHasSystemNavBar;
84    }
85
86    // ---- unused implementation of IWindowManager ----
87
88    @Override
89    public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, boolean arg4,
90                            boolean arg5)
91            throws RemoteException {
92        // TODO Auto-generated method stub
93
94    }
95
96    @Override
97    public void addWindowToken(IBinder arg0, int arg1) throws RemoteException {
98        // TODO Auto-generated method stub
99
100    }
101
102    @Override
103    public void clearForcedDisplaySize(int displayId) throws RemoteException {
104        // TODO Auto-generated method stub
105    }
106
107    @Override
108    public void clearForcedDisplayDensity(int displayId) throws RemoteException {
109        // TODO Auto-generated method stub
110    }
111
112    @Override
113    public void setOverscan(int displayId, int left, int top, int right, int bottom)
114            throws RemoteException {
115        // TODO Auto-generated method stub
116    }
117
118    @Override
119    public void closeSystemDialogs(String arg0) throws RemoteException {
120        // TODO Auto-generated method stub
121
122    }
123
124    @Override
125    public void startFreezingScreen(int exitAnim, int enterAnim) {
126        // TODO Auto-generated method stub
127    }
128
129    @Override
130    public void stopFreezingScreen() {
131        // TODO Auto-generated method stub
132    }
133
134    @Override
135    public void disableKeyguard(IBinder arg0, String arg1) throws RemoteException {
136        // TODO Auto-generated method stub
137
138    }
139
140    @Override
141    public void executeAppTransition() throws RemoteException {
142        // TODO Auto-generated method stub
143
144    }
145
146    @Override
147    public void exitKeyguardSecurely(IOnKeyguardExitResult arg0) throws RemoteException {
148        // TODO Auto-generated method stub
149
150    }
151
152    @Override
153    public void freezeRotation(int arg0) throws RemoteException {
154        // TODO Auto-generated method stub
155
156    }
157
158    @Override
159    public float getAnimationScale(int arg0) throws RemoteException {
160        // TODO Auto-generated method stub
161        return 0;
162    }
163
164    @Override
165    public float[] getAnimationScales() throws RemoteException {
166        // TODO Auto-generated method stub
167        return null;
168    }
169
170    @Override
171    public int getAppOrientation(IApplicationToken arg0) throws RemoteException {
172        // TODO Auto-generated method stub
173        return 0;
174    }
175
176    @Override
177    public int getPendingAppTransition() throws RemoteException {
178        // TODO Auto-generated method stub
179        return 0;
180    }
181
182    @Override
183    public boolean inKeyguardRestrictedInputMode() throws RemoteException {
184        // TODO Auto-generated method stub
185        return false;
186    }
187
188    @Override
189    public boolean inputMethodClientHasFocus(IInputMethodClient arg0) throws RemoteException {
190        // TODO Auto-generated method stub
191        return false;
192    }
193
194    @Override
195    public boolean isKeyguardLocked() throws RemoteException {
196        // TODO Auto-generated method stub
197        return false;
198    }
199
200    @Override
201    public boolean isKeyguardSecure() throws RemoteException {
202        // TODO Auto-generated method stub
203        return false;
204    }
205
206    @Override
207    public boolean isViewServerRunning() throws RemoteException {
208        // TODO Auto-generated method stub
209        return false;
210    }
211
212    @Override
213    public void moveAppToken(int arg0, IBinder arg1) throws RemoteException {
214        // TODO Auto-generated method stub
215
216    }
217
218    @Override
219    public void moveAppTokensToBottom(List<IBinder> arg0) throws RemoteException {
220        // TODO Auto-generated method stub
221
222    }
223
224    @Override
225    public void moveAppTokensToTop(List<IBinder> arg0) throws RemoteException {
226        // TODO Auto-generated method stub
227
228    }
229
230    @Override
231    public IWindowSession openSession(IInputMethodClient arg0, IInputContext arg1)
232            throws RemoteException {
233        // TODO Auto-generated method stub
234        return null;
235    }
236
237    @Override
238    public void overridePendingAppTransition(String arg0, int arg1, int arg2,
239            IRemoteCallback startedCallback) throws RemoteException {
240        // TODO Auto-generated method stub
241
242    }
243
244    @Override
245    public void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth,
246            int startHeight) throws RemoteException {
247        // TODO Auto-generated method stub
248    }
249
250    @Override
251    public void overridePendingAppTransitionThumb(Bitmap srcThumb, int startX, int startY,
252            IRemoteCallback startedCallback, boolean scaleUp) throws RemoteException {
253        // TODO Auto-generated method stub
254    }
255
256    @Override
257    public void pauseKeyDispatching(IBinder arg0) throws RemoteException {
258        // TODO Auto-generated method stub
259
260    }
261
262    @Override
263    public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException {
264        // TODO Auto-generated method stub
265
266    }
267
268    @Override
269    public void reenableKeyguard(IBinder arg0) throws RemoteException {
270        // TODO Auto-generated method stub
271
272    }
273
274    @Override
275    public void removeAppToken(IBinder arg0) throws RemoteException {
276        // TODO Auto-generated method stub
277
278    }
279
280    @Override
281    public void removeWindowToken(IBinder arg0) throws RemoteException {
282        // TODO Auto-generated method stub
283
284    }
285
286    @Override
287    public void resumeKeyDispatching(IBinder arg0) throws RemoteException {
288        // TODO Auto-generated method stub
289
290    }
291
292    @Override
293    public Bitmap screenshotApplications(IBinder arg0, int displayId, int arg1, int arg2)
294            throws RemoteException {
295        // 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
312    public void setAppGroupId(IBinder arg0, int arg1) throws RemoteException {
313        // TODO Auto-generated method stub
314
315    }
316
317    @Override
318    public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException {
319        // TODO Auto-generated method stub
320    }
321
322    @Override
323    public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3,
324            CharSequence arg4, int arg5, int arg6, int arg7, IBinder arg8, boolean arg9)
325            throws RemoteException {
326        // TODO Auto-generated method stub
327    }
328
329    @Override
330    public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException {
331        // TODO Auto-generated method stub
332
333    }
334
335    @Override
336    public void setAppWillBeHidden(IBinder arg0) throws RemoteException {
337        // TODO Auto-generated method stub
338    }
339
340    @Override
341    public void setEventDispatching(boolean arg0) throws RemoteException {
342        // TODO Auto-generated method stub
343    }
344
345    @Override
346    public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException {
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 void setForcedDisplayDensity(int displayId, int density) throws RemoteException {
357        // TODO Auto-generated method stub
358    }
359
360    @Override
361    public void setInTouchMode(boolean arg0) throws RemoteException {
362        // TODO Auto-generated method stub
363    }
364
365    @Override
366    public void setNewConfiguration(Configuration arg0) throws RemoteException {
367        // TODO Auto-generated method stub
368    }
369
370    @Override
371    public void updateRotation(boolean arg0, boolean arg1) throws RemoteException {
372        // TODO Auto-generated method stub
373    }
374
375    @Override
376    public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException {
377        // TODO Auto-generated method stub
378    }
379
380    @Override
381    public void showStrictModeViolation(boolean arg0) throws RemoteException {
382        // TODO Auto-generated method stub
383    }
384
385    @Override
386    public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException {
387        // TODO Auto-generated method stub
388    }
389
390    @Override
391    public boolean startViewServer(int arg0) throws RemoteException {
392        // TODO Auto-generated method stub
393        return false;
394    }
395
396    @Override
397    public void statusBarVisibilityChanged(int arg0) throws RemoteException {
398        // TODO Auto-generated method stub
399    }
400
401    @Override
402    public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException {
403        // TODO Auto-generated method stub
404    }
405
406    @Override
407    public boolean stopViewServer() throws RemoteException {
408        // TODO Auto-generated method stub
409        return false;
410    }
411
412    @Override
413    public void thawRotation() throws RemoteException {
414        // TODO Auto-generated method stub
415    }
416
417    @Override
418    public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1)
419            throws RemoteException {
420        // TODO Auto-generated method stub
421        return null;
422    }
423
424    @Override
425    public int watchRotation(IRotationWatcher arg0) throws RemoteException {
426        // TODO Auto-generated method stub
427        return 0;
428    }
429
430    @Override
431    public boolean waitForWindowDrawn(IBinder token, IRemoteCallback callback) {
432        return false;
433    }
434
435    @Override
436    public IBinder asBinder() {
437        // TODO Auto-generated method stub
438        return null;
439    }
440
441    @Override
442    public int getPreferredOptionsPanelGravity() throws RemoteException {
443        return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
444    }
445
446    @Override
447    public void dismissKeyguard() {
448    }
449
450    @Override
451    public void lockNow(Bundle options) {
452        // TODO Auto-generated method stub
453    }
454
455    @Override
456    public boolean isSafeModeEnabled() {
457        return false;
458    }
459
460    @Override
461    public void showAssistant() {
462
463    }
464
465    @Override
466    public IBinder getFocusedWindowToken() {
467        // TODO Auto-generated method stub
468        return null;
469    }
470
471    @Override
472    public void setInputFilter(IInputFilter filter) throws RemoteException {
473        // TODO Auto-generated method stub
474    }
475
476    @Override
477    public void getWindowFrame(IBinder token, Rect outFrame) {
478        // TODO Auto-generated method stub
479    }
480
481    @Override
482    public void setMagnificationCallbacks(IMagnificationCallbacks callbacks) {
483        // TODO Auto-generated method stub
484    }
485
486    @Override
487    public void setMagnificationSpec(MagnificationSpec spec) {
488        // TODO Auto-generated method stub
489    }
490
491    @Override
492    public MagnificationSpec getCompatibleMagnificationSpecForWindow(IBinder windowToken) {
493        // TODO Auto-generated method stub
494        return null;
495    }
496
497    @Override
498    public boolean isRotationFrozen() throws RemoteException {
499        // TODO Auto-generated method stub
500        return false;
501    }
502}
503