IWindowManagerImpl.java revision ee973c27e339a23e0b93d816a97b33954af66bea
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 IWindowSession openSession(IInputMethodClient arg0, IInputContext arg1) 214 throws RemoteException { 215 // TODO Auto-generated method stub 216 return null; 217 } 218 219 @Override 220 public void overridePendingAppTransition(String arg0, int arg1, int arg2, 221 IRemoteCallback startedCallback) throws RemoteException { 222 // TODO Auto-generated method stub 223 224 } 225 226 @Override 227 public void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth, 228 int startHeight) throws RemoteException { 229 // TODO Auto-generated method stub 230 } 231 232 @Override 233 public void overridePendingAppTransitionThumb(Bitmap srcThumb, int startX, int startY, 234 IRemoteCallback startedCallback, boolean scaleUp) throws RemoteException { 235 // TODO Auto-generated method stub 236 } 237 238 @Override 239 public void pauseKeyDispatching(IBinder arg0) throws RemoteException { 240 // TODO Auto-generated method stub 241 242 } 243 244 @Override 245 public void prepareAppTransition(int arg0, boolean arg1) throws RemoteException { 246 // TODO Auto-generated method stub 247 248 } 249 250 @Override 251 public void reenableKeyguard(IBinder arg0) throws RemoteException { 252 // TODO Auto-generated method stub 253 254 } 255 256 @Override 257 public void removeAppToken(IBinder arg0) throws RemoteException { 258 // TODO Auto-generated method stub 259 260 } 261 262 @Override 263 public void removeWindowToken(IBinder arg0) throws RemoteException { 264 // TODO Auto-generated method stub 265 266 } 267 268 @Override 269 public void resumeKeyDispatching(IBinder arg0) throws RemoteException { 270 // TODO Auto-generated method stub 271 272 } 273 274 @Override 275 public Bitmap screenshotApplications(IBinder arg0, int displayId, int arg1, int arg2) 276 throws RemoteException { 277 // TODO Auto-generated method stub 278 return null; 279 } 280 281 @Override 282 public void setAnimationScale(int arg0, float arg1) throws RemoteException { 283 // TODO Auto-generated method stub 284 285 } 286 287 @Override 288 public void setAnimationScales(float[] arg0) throws RemoteException { 289 // TODO Auto-generated method stub 290 291 } 292 293 @Override 294 public void setAppGroupId(IBinder arg0, int arg1) throws RemoteException { 295 // TODO Auto-generated method stub 296 297 } 298 299 @Override 300 public void setAppOrientation(IApplicationToken arg0, int arg1) throws RemoteException { 301 // TODO Auto-generated method stub 302 } 303 304 @Override 305 public void setAppStartingWindow(IBinder arg0, String arg1, int arg2, CompatibilityInfo arg3, 306 CharSequence arg4, int arg5, int arg6, int arg7, IBinder arg8, boolean arg9) 307 throws RemoteException { 308 // TODO Auto-generated method stub 309 } 310 311 @Override 312 public void setAppVisibility(IBinder arg0, boolean arg1) throws RemoteException { 313 // TODO Auto-generated method stub 314 315 } 316 317 @Override 318 public void setAppWillBeHidden(IBinder arg0) throws RemoteException { 319 // TODO Auto-generated method stub 320 } 321 322 @Override 323 public void setEventDispatching(boolean arg0) throws RemoteException { 324 // TODO Auto-generated method stub 325 } 326 327 @Override 328 public void setFocusedApp(IBinder arg0, boolean arg1) throws RemoteException { 329 // TODO Auto-generated method stub 330 } 331 332 @Override 333 public void setForcedDisplaySize(int displayId, int arg0, int arg1) throws RemoteException { 334 // TODO Auto-generated method stub 335 } 336 337 @Override 338 public void setForcedDisplayDensity(int displayId, int density) throws RemoteException { 339 // TODO Auto-generated method stub 340 } 341 342 @Override 343 public void setInTouchMode(boolean arg0) throws RemoteException { 344 // TODO Auto-generated method stub 345 } 346 347 @Override 348 public void setNewConfiguration(Configuration arg0) throws RemoteException { 349 // TODO Auto-generated method stub 350 } 351 352 @Override 353 public void updateRotation(boolean arg0, boolean arg1) throws RemoteException { 354 // TODO Auto-generated method stub 355 } 356 357 @Override 358 public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException { 359 // TODO Auto-generated method stub 360 } 361 362 @Override 363 public void showStrictModeViolation(boolean arg0) throws RemoteException { 364 // TODO Auto-generated method stub 365 } 366 367 @Override 368 public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException { 369 // TODO Auto-generated method stub 370 } 371 372 @Override 373 public boolean startViewServer(int arg0) throws RemoteException { 374 // TODO Auto-generated method stub 375 return false; 376 } 377 378 @Override 379 public void statusBarVisibilityChanged(int arg0) throws RemoteException { 380 // TODO Auto-generated method stub 381 } 382 383 @Override 384 public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException { 385 // TODO Auto-generated method stub 386 } 387 388 @Override 389 public boolean stopViewServer() throws RemoteException { 390 // TODO Auto-generated method stub 391 return false; 392 } 393 394 @Override 395 public void thawRotation() throws RemoteException { 396 // TODO Auto-generated method stub 397 } 398 399 @Override 400 public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1) 401 throws RemoteException { 402 // TODO Auto-generated method stub 403 return null; 404 } 405 406 @Override 407 public int watchRotation(IRotationWatcher arg0) throws RemoteException { 408 // TODO Auto-generated method stub 409 return 0; 410 } 411 412 @Override 413 public boolean waitForWindowDrawn(IBinder token, IRemoteCallback callback) { 414 return false; 415 } 416 417 @Override 418 public IBinder asBinder() { 419 // TODO Auto-generated method stub 420 return null; 421 } 422 423 @Override 424 public int getPreferredOptionsPanelGravity() throws RemoteException { 425 return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM; 426 } 427 428 @Override 429 public void dismissKeyguard() { 430 } 431 432 @Override 433 public void lockNow(Bundle options) { 434 // TODO Auto-generated method stub 435 } 436 437 @Override 438 public boolean isSafeModeEnabled() { 439 return false; 440 } 441 442 @Override 443 public void showAssistant() { 444 445 } 446 447 @Override 448 public IBinder getFocusedWindowToken() { 449 // TODO Auto-generated method stub 450 return null; 451 } 452 453 @Override 454 public void setInputFilter(IInputFilter filter) throws RemoteException { 455 // TODO Auto-generated method stub 456 } 457 458 @Override 459 public void getWindowFrame(IBinder token, Rect outFrame) { 460 // TODO Auto-generated method stub 461 } 462 463 @Override 464 public void setMagnificationCallbacks(IMagnificationCallbacks callbacks) { 465 // TODO Auto-generated method stub 466 } 467 468 @Override 469 public void setMagnificationSpec(MagnificationSpec spec) { 470 // TODO Auto-generated method stub 471 } 472 473 @Override 474 public MagnificationSpec getCompatibleMagnificationSpecForWindow(IBinder windowToken) { 475 // TODO Auto-generated method stub 476 return null; 477 } 478 479 @Override 480 public boolean isRotationFrozen() throws RemoteException { 481 // TODO Auto-generated method stub 482 return false; 483 } 484} 485