@Override public void handleMessage(Message message) { switch (message.what) { case MESSAGE_NOTIFY_MAGNIFIED_BOUNDS_CHANGED: { Region bounds = (Region) message.obj; try { mCallbacks.onMagnifedBoundsChanged(bounds); } catch (RemoteException re) { /* ignore */ } finally { bounds.recycle(); } } break; case MESSAGE_NOTIFY_RECTANGLE_ON_SCREEN_REQUESTED: { SomeArgs args = (SomeArgs) message.obj; final int left = args.argi1; final int top = args.argi2; final int right = args.argi3; final int bottom = args.argi4; try { mCallbacks.onRectangleOnScreenRequested(left, top, right, bottom); } catch (RemoteException re) { /* ignore */ } finally { args.recycle(); } } break; case MESSAGE_NOTIFY_USER_CONTEXT_CHANGED: { try { mCallbacks.onUserContextChanged(); } catch (RemoteException re) { /* ignore */ } } break; case MESSAGE_NOTIFY_ROTATION_CHANGED: { final int rotation = message.arg1; try { mCallbacks.onRotationChanged(rotation); } catch (RemoteException re) { /* ignore */ } } break; case MESSAGE_SHOW_MAGNIFIED_REGION_BOUNDS_IF_NEEDED: { synchronized (mWindowManagerService.mWindowMap) { if (mMagnifedViewport.isMagnifyingLocked()) { mMagnifedViewport.setMagnifiedRegionBorderShownLocked(true, true); mWindowManagerService.scheduleAnimationLocked(); } } } break; /// M:[ALPS01397351]Fix system server JE @{ case MESSAGE_ON_ROTATION_CHANGED: { synchronized (mWindowManagerService.mWindowMap) { mMagnifedViewport.onRotationChangedLocked(); } } break; /// @} } }