Loading core/java/com/android/internal/widget/PointerLocationView.java +7 −4 Original line number Diff line number Diff line Loading @@ -31,11 +31,13 @@ import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; import android.view.WindowManagerPolicy.PointerEventListener; import android.view.MotionEvent.PointerCoords; import java.util.ArrayList; public class PointerLocationView extends View implements InputDeviceListener { public class PointerLocationView extends View implements InputDeviceListener, PointerEventListener { private static final String TAG = "Pointer"; // The system property key used to specify an alternate velocity tracker strategy Loading Loading @@ -520,7 +522,8 @@ public class PointerLocationView extends View implements InputDeviceListener { .toString()); } public void addPointerEvent(MotionEvent event) { @Override public void onPointerEvent(MotionEvent event) { final int action = event.getAction(); int NP = mPointers.size(); Loading Loading @@ -648,7 +651,7 @@ public class PointerLocationView extends View implements InputDeviceListener { @Override public boolean onTouchEvent(MotionEvent event) { addPointerEvent(event); onPointerEvent(event); if (event.getAction() == MotionEvent.ACTION_DOWN && !isFocused()) { requestFocus(); Loading @@ -660,7 +663,7 @@ public class PointerLocationView extends View implements InputDeviceListener { public boolean onGenericMotionEvent(MotionEvent event) { final int source = event.getSource(); if ((source & InputDevice.SOURCE_CLASS_POINTER) != 0) { addPointerEvent(event); onPointerEvent(event); } else if ((source & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { logMotionEvent("Joystick", event); } else if ((source & InputDevice.SOURCE_CLASS_POSITION) != 0) { Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +3 −23 Original line number Diff line number Diff line Loading @@ -308,17 +308,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { WindowState mFocusedWindow; IApplicationToken mFocusedApp; private final class PointerLocationPointerEventListener implements PointerEventListener { @Override public void onPointerEvent(MotionEvent motionEvent) { if (mPointerLocationView != null) { mPointerLocationView.addPointerEvent(motionEvent); } } } // Pointer location view state, only modified on the mHandler Looper. PointerLocationPointerEventListener mPointerLocationPointerEventListener; PointerLocationView mPointerLocationView; // The current size of the screen; really; extends into the overscan area of Loading Loading @@ -1190,7 +1179,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mPointerLocationView == null) { mPointerLocationView = new PointerLocationView(mContext); mPointerLocationView.setPrintCoords(false); WindowManager.LayoutParams lp = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT); Loading @@ -1210,22 +1198,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { mContext.getSystemService(Context.WINDOW_SERVICE); lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL; wm.addView(mPointerLocationView, lp); mPointerLocationPointerEventListener = new PointerLocationPointerEventListener(); mWindowManagerFuncs.registerPointerEventListener(mPointerLocationPointerEventListener); mWindowManagerFuncs.registerPointerEventListener(mPointerLocationView); } } private void disablePointerLocation() { if (mPointerLocationPointerEventListener != null) { mWindowManagerFuncs.unregisterPointerEventListener( mPointerLocationPointerEventListener); mPointerLocationPointerEventListener = null; } if (mPointerLocationView != null) { WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mWindowManagerFuncs.unregisterPointerEventListener(mPointerLocationView); WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); wm.removeView(mPointerLocationView); mPointerLocationView = null; } Loading Loading
core/java/com/android/internal/widget/PointerLocationView.java +7 −4 Original line number Diff line number Diff line Loading @@ -31,11 +31,13 @@ import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; import android.view.WindowManagerPolicy.PointerEventListener; import android.view.MotionEvent.PointerCoords; import java.util.ArrayList; public class PointerLocationView extends View implements InputDeviceListener { public class PointerLocationView extends View implements InputDeviceListener, PointerEventListener { private static final String TAG = "Pointer"; // The system property key used to specify an alternate velocity tracker strategy Loading Loading @@ -520,7 +522,8 @@ public class PointerLocationView extends View implements InputDeviceListener { .toString()); } public void addPointerEvent(MotionEvent event) { @Override public void onPointerEvent(MotionEvent event) { final int action = event.getAction(); int NP = mPointers.size(); Loading Loading @@ -648,7 +651,7 @@ public class PointerLocationView extends View implements InputDeviceListener { @Override public boolean onTouchEvent(MotionEvent event) { addPointerEvent(event); onPointerEvent(event); if (event.getAction() == MotionEvent.ACTION_DOWN && !isFocused()) { requestFocus(); Loading @@ -660,7 +663,7 @@ public class PointerLocationView extends View implements InputDeviceListener { public boolean onGenericMotionEvent(MotionEvent event) { final int source = event.getSource(); if ((source & InputDevice.SOURCE_CLASS_POINTER) != 0) { addPointerEvent(event); onPointerEvent(event); } else if ((source & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { logMotionEvent("Joystick", event); } else if ((source & InputDevice.SOURCE_CLASS_POSITION) != 0) { Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +3 −23 Original line number Diff line number Diff line Loading @@ -308,17 +308,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { WindowState mFocusedWindow; IApplicationToken mFocusedApp; private final class PointerLocationPointerEventListener implements PointerEventListener { @Override public void onPointerEvent(MotionEvent motionEvent) { if (mPointerLocationView != null) { mPointerLocationView.addPointerEvent(motionEvent); } } } // Pointer location view state, only modified on the mHandler Looper. PointerLocationPointerEventListener mPointerLocationPointerEventListener; PointerLocationView mPointerLocationView; // The current size of the screen; really; extends into the overscan area of Loading Loading @@ -1190,7 +1179,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mPointerLocationView == null) { mPointerLocationView = new PointerLocationView(mContext); mPointerLocationView.setPrintCoords(false); WindowManager.LayoutParams lp = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT); Loading @@ -1210,22 +1198,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { mContext.getSystemService(Context.WINDOW_SERVICE); lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL; wm.addView(mPointerLocationView, lp); mPointerLocationPointerEventListener = new PointerLocationPointerEventListener(); mWindowManagerFuncs.registerPointerEventListener(mPointerLocationPointerEventListener); mWindowManagerFuncs.registerPointerEventListener(mPointerLocationView); } } private void disablePointerLocation() { if (mPointerLocationPointerEventListener != null) { mWindowManagerFuncs.unregisterPointerEventListener( mPointerLocationPointerEventListener); mPointerLocationPointerEventListener = null; } if (mPointerLocationView != null) { WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mWindowManagerFuncs.unregisterPointerEventListener(mPointerLocationView); WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); wm.removeView(mPointerLocationView); mPointerLocationView = null; } Loading