Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 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 | |
| 17 | package android.view; |
| 18 | |
| 19 | import android.graphics.Point; |
Dianne Hackborn | 4025c96 | 2015-03-17 17:22:33 -0700 | [diff] [blame^] | 20 | import com.android.internal.app.IAssistScreenshotReceiver; |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 21 | import com.android.internal.view.IInputContext; |
| 22 | import com.android.internal.view.IInputMethodClient; |
| 23 | |
| 24 | import android.content.res.CompatibilityInfo; |
| 25 | import android.content.res.Configuration; |
| 26 | import android.graphics.Bitmap; |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 27 | import android.os.Bundle; |
| 28 | import android.os.IBinder; |
| 29 | import android.os.IRemoteCallback; |
| 30 | import android.os.RemoteException; |
| 31 | import android.util.DisplayMetrics; |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 32 | |
Svetoslav | dd137a8 | 2014-04-10 12:48:07 -0700 | [diff] [blame] | 33 | import java.lang.Override; |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * Basic implementation of {@link IWindowManager} so that {@link Display} (and |
| 37 | * {@link Display_Delegate}) can return a valid instance. |
| 38 | */ |
| 39 | public 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 Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 76 | boolean arg5, boolean arg6, int arg7, int arg8, boolean arg9, boolean arg10) |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 77 | 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 Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 199 | public IWindowSession openSession(IWindowSessionCallback argn1, IInputMethodClient arg0, |
| 200 | IInputContext arg1) throws RemoteException { |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 201 | // 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 Haase | 10e23ab | 2015-02-11 15:08:38 -0800 | [diff] [blame] | 219 | 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 Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 225 | 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 Chung | a4ccb86 | 2014-08-22 15:26:27 -0700 | [diff] [blame] | 231 | public void overridePendingAppTransitionAspectScaledThumb(Bitmap srcThumb, int startX, |
Winson Chung | 2e7f3bd | 2014-09-05 13:17:22 +0200 | [diff] [blame] | 232 | int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback, |
| 233 | boolean scaleUp) { |
Winson Chung | a4ccb86 | 2014-08-22 15:26:27 -0700 | [diff] [blame] | 234 | // TODO Auto-generated method stub |
| 235 | } |
| 236 | |
| 237 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 238 | public void overridePendingAppTransitionInPlace(String packageName, int anim) { |
| 239 | // TODO Auto-generated method stub |
| 240 | } |
| 241 | |
| 242 | @Override |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 243 | 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 Hackborn | 4025c96 | 2015-03-17 17:22:33 -0700 | [diff] [blame^] | 279 | 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 Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 288 | // 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 Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 305 | public float getCurrentAnimatorScale() throws RemoteException { |
| 306 | return 0; |
| 307 | } |
| 308 | |
| 309 | @Override |
Craig Mautner | 83162a9 | 2015-01-26 14:43:30 -0800 | [diff] [blame] | 310 | public void setAppTask(IBinder arg0, int arg1) throws RemoteException { |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 311 | // 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 |
| 379 | public void setInTouchMode(boolean arg0) throws RemoteException { |
| 380 | // TODO Auto-generated method stub |
| 381 | } |
| 382 | |
| 383 | @Override |
| 384 | public void setNewConfiguration(Configuration arg0) throws RemoteException { |
| 385 | // TODO Auto-generated method stub |
| 386 | } |
| 387 | |
| 388 | @Override |
Sander Alewijnse | a87863a | 2014-07-29 12:01:38 +0100 | [diff] [blame] | 389 | public void setScreenCaptureDisabled(int userId, boolean disabled) { |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 390 | // TODO Auto-generated method stub |
| 391 | } |
| 392 | |
| 393 | @Override |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 394 | public void updateRotation(boolean arg0, boolean arg1) throws RemoteException { |
| 395 | // TODO Auto-generated method stub |
| 396 | } |
| 397 | |
| 398 | @Override |
| 399 | public void setStrictModeVisualIndicatorPreference(String arg0) throws RemoteException { |
| 400 | // TODO Auto-generated method stub |
| 401 | } |
| 402 | |
| 403 | @Override |
| 404 | public void showStrictModeViolation(boolean arg0) throws RemoteException { |
| 405 | // TODO Auto-generated method stub |
| 406 | } |
| 407 | |
| 408 | @Override |
| 409 | public void startAppFreezingScreen(IBinder arg0, int arg1) throws RemoteException { |
| 410 | // TODO Auto-generated method stub |
| 411 | } |
| 412 | |
| 413 | @Override |
| 414 | public boolean startViewServer(int arg0) throws RemoteException { |
| 415 | // TODO Auto-generated method stub |
| 416 | return false; |
| 417 | } |
| 418 | |
| 419 | @Override |
| 420 | public void statusBarVisibilityChanged(int arg0) throws RemoteException { |
| 421 | // TODO Auto-generated method stub |
| 422 | } |
| 423 | |
| 424 | @Override |
| 425 | public void stopAppFreezingScreen(IBinder arg0, boolean arg1) throws RemoteException { |
| 426 | // TODO Auto-generated method stub |
| 427 | } |
| 428 | |
| 429 | @Override |
| 430 | public boolean stopViewServer() throws RemoteException { |
| 431 | // TODO Auto-generated method stub |
| 432 | return false; |
| 433 | } |
| 434 | |
| 435 | @Override |
| 436 | public void thawRotation() throws RemoteException { |
| 437 | // TODO Auto-generated method stub |
| 438 | } |
| 439 | |
| 440 | @Override |
| 441 | public Configuration updateOrientationFromAppTokens(Configuration arg0, IBinder arg1) |
| 442 | throws RemoteException { |
| 443 | // TODO Auto-generated method stub |
| 444 | return null; |
| 445 | } |
| 446 | |
| 447 | @Override |
| 448 | public int watchRotation(IRotationWatcher arg0) throws RemoteException { |
| 449 | // TODO Auto-generated method stub |
| 450 | return 0; |
| 451 | } |
| 452 | |
| 453 | @Override |
| 454 | public void removeRotationWatcher(IRotationWatcher arg0) throws RemoteException { |
| 455 | } |
| 456 | |
| 457 | @Override |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 458 | public IBinder asBinder() { |
| 459 | // TODO Auto-generated method stub |
| 460 | return null; |
| 461 | } |
| 462 | |
| 463 | @Override |
| 464 | public int getPreferredOptionsPanelGravity() throws RemoteException { |
| 465 | return Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM; |
| 466 | } |
| 467 | |
| 468 | @Override |
| 469 | public void dismissKeyguard() { |
| 470 | } |
| 471 | |
| 472 | @Override |
Jorim Jaggi | 84a3e7a | 2014-08-13 17:58:58 +0200 | [diff] [blame] | 473 | public void keyguardGoingAway(boolean disableWindowAnimations, |
| 474 | boolean keyguardGoingToNotificationShade) throws RemoteException { |
Craig Mautner | 8bd94d5 | 2014-05-29 10:49:10 -0700 | [diff] [blame] | 475 | } |
| 476 | |
| 477 | @Override |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 478 | public void lockNow(Bundle options) { |
| 479 | // TODO Auto-generated method stub |
| 480 | } |
| 481 | |
| 482 | @Override |
| 483 | public boolean isSafeModeEnabled() { |
| 484 | return false; |
| 485 | } |
| 486 | |
| 487 | @Override |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 488 | public boolean isRotationFrozen() throws RemoteException { |
| 489 | // TODO Auto-generated method stub |
| 490 | return false; |
| 491 | } |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 492 | |
| 493 | @Override |
| 494 | public void enableScreenIfNeeded() throws RemoteException { |
Svetoslav | dd137a8 | 2014-04-10 12:48:07 -0700 | [diff] [blame] | 495 | // TODO Auto-generated method stub |
| 496 | } |
| 497 | |
| 498 | @Override |
Colin Cross | d4d4658 | 2014-04-10 22:41:05 -0700 | [diff] [blame] | 499 | public boolean clearWindowContentFrameStats(IBinder token) throws RemoteException { |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 500 | // TODO Auto-generated method stub |
| 501 | return false; |
| 502 | } |
| 503 | |
| 504 | @Override |
Colin Cross | d4d4658 | 2014-04-10 22:41:05 -0700 | [diff] [blame] | 505 | public WindowContentFrameStats getWindowContentFrameStats(IBinder token) |
Svetoslav | dd137a8 | 2014-04-10 12:48:07 -0700 | [diff] [blame] | 506 | throws RemoteException { |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 507 | // TODO Auto-generated method stub |
| 508 | return null; |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 509 | } |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 510 | } |