Loading core/java/com/android/internal/widget/PointerLocationView.java +28 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.graphics.Path; import android.graphics.PorterDuff; import android.graphics.RectF; import android.graphics.Region; import android.hardware.display.DisplayManager; import android.hardware.input.InputManager; import android.hardware.input.InputManager.InputDeviceListener; import android.os.Handler; Loading Loading @@ -123,6 +124,7 @@ public class PointerLocationView extends View implements InputDeviceListener, } private final InputManager mIm; private final DisplayManager mDisplayManager; private final ViewConfiguration mVC; private final Paint mTextPaint; Loading Loading @@ -170,11 +172,35 @@ public class PointerLocationView extends View implements InputDeviceListener, private float mDensity; private final DisplayManager.DisplayListener mDisplayListener = new DisplayManager.DisplayListener() { @Override public void onDisplayAdded(int displayId) { onDisplayChanged(displayId); } @Override public void onDisplayRemoved(int displayId) { } @Override public void onDisplayChanged(int displayId) { if (displayId != mContext.getDisplayId()) { return; } // Reconfigure the trace bitmap whenever there are changes to the display, since // the bitmap depends on display size. configureTraceBitmap(); } }; public PointerLocationView(Context c) { super(c); setFocusableInTouchMode(true); mIm = c.getSystemService(InputManager.class); mDisplayManager = c.getSystemService(DisplayManager.class); mVC = ViewConfiguration.get(c); mTextPaint = new Paint(); Loading Loading @@ -798,6 +824,7 @@ public class PointerLocationView extends View implements InputDeviceListener, super.onAttachedToWindow(); mIm.registerInputDeviceListener(this, getHandler()); mDisplayManager.registerDisplayListener(mDisplayListener, getHandler()); if (shouldShowSystemGestureExclusion()) { try { WindowManagerGlobal.getWindowManagerService() Loading @@ -820,6 +847,7 @@ public class PointerLocationView extends View implements InputDeviceListener, super.onDetachedFromWindow(); mIm.unregisterInputDeviceListener(this); mDisplayManager.unregisterDisplayListener(mDisplayListener); try { WindowManagerGlobal.getWindowManagerService().unregisterSystemGestureExclusionListener( mSystemGestureExclusionListener, mContext.getDisplayId()); Loading Loading
core/java/com/android/internal/widget/PointerLocationView.java +28 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.graphics.Path; import android.graphics.PorterDuff; import android.graphics.RectF; import android.graphics.Region; import android.hardware.display.DisplayManager; import android.hardware.input.InputManager; import android.hardware.input.InputManager.InputDeviceListener; import android.os.Handler; Loading Loading @@ -123,6 +124,7 @@ public class PointerLocationView extends View implements InputDeviceListener, } private final InputManager mIm; private final DisplayManager mDisplayManager; private final ViewConfiguration mVC; private final Paint mTextPaint; Loading Loading @@ -170,11 +172,35 @@ public class PointerLocationView extends View implements InputDeviceListener, private float mDensity; private final DisplayManager.DisplayListener mDisplayListener = new DisplayManager.DisplayListener() { @Override public void onDisplayAdded(int displayId) { onDisplayChanged(displayId); } @Override public void onDisplayRemoved(int displayId) { } @Override public void onDisplayChanged(int displayId) { if (displayId != mContext.getDisplayId()) { return; } // Reconfigure the trace bitmap whenever there are changes to the display, since // the bitmap depends on display size. configureTraceBitmap(); } }; public PointerLocationView(Context c) { super(c); setFocusableInTouchMode(true); mIm = c.getSystemService(InputManager.class); mDisplayManager = c.getSystemService(DisplayManager.class); mVC = ViewConfiguration.get(c); mTextPaint = new Paint(); Loading Loading @@ -798,6 +824,7 @@ public class PointerLocationView extends View implements InputDeviceListener, super.onAttachedToWindow(); mIm.registerInputDeviceListener(this, getHandler()); mDisplayManager.registerDisplayListener(mDisplayListener, getHandler()); if (shouldShowSystemGestureExclusion()) { try { WindowManagerGlobal.getWindowManagerService() Loading @@ -820,6 +847,7 @@ public class PointerLocationView extends View implements InputDeviceListener, super.onDetachedFromWindow(); mIm.unregisterInputDeviceListener(this); mDisplayManager.unregisterDisplayListener(mDisplayListener); try { WindowManagerGlobal.getWindowManagerService().unregisterSystemGestureExclusionListener( mSystemGestureExclusionListener, mContext.getDisplayId()); Loading