Search in sources :

Example 1 with DragInputEventReceiver

use of com.android.server.wm.WindowManagerService.DragInputEventReceiver in project android_frameworks_base by ParanoidAndroid.

the class DragState method register.

/**
     * @param display The Display that the window being dragged is on.
     */
void register(Display display) {
    mDisplay = display;
    if (WindowManagerService.DEBUG_DRAG)
        Slog.d(WindowManagerService.TAG, "registering drag input channel");
    if (mClientChannel != null) {
        Slog.e(WindowManagerService.TAG, "Duplicate register of drag input channel");
    } else {
        InputChannel[] channels = InputChannel.openInputChannelPair("drag");
        mServerChannel = channels[0];
        mClientChannel = channels[1];
        mService.mInputManager.registerInputChannel(mServerChannel, null);
        mInputEventReceiver = mService.new DragInputEventReceiver(mClientChannel, mService.mH.getLooper());
        mDragApplicationHandle = new InputApplicationHandle(null);
        mDragApplicationHandle.name = "drag";
        mDragApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null, mDisplay.getDisplayId());
        mDragWindowHandle.name = "drag";
        mDragWindowHandle.inputChannel = mServerChannel;
        mDragWindowHandle.layer = getDragLayerLw();
        mDragWindowHandle.layoutParamsFlags = 0;
        mDragWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG;
        mDragWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle.visible = true;
        mDragWindowHandle.canReceiveKeys = false;
        mDragWindowHandle.hasFocus = true;
        mDragWindowHandle.hasWallpaper = false;
        mDragWindowHandle.paused = false;
        mDragWindowHandle.ownerPid = Process.myPid();
        mDragWindowHandle.ownerUid = Process.myUid();
        mDragWindowHandle.inputFeatures = 0;
        mDragWindowHandle.scaleFactor = 1.0f;
        // The drag window cannot receive new touches.
        mDragWindowHandle.touchableRegion.setEmpty();
        // The drag window covers the entire display
        mDragWindowHandle.frameLeft = 0;
        mDragWindowHandle.frameTop = 0;
        Point p = new Point();
        mDisplay.getRealSize(p);
        mDragWindowHandle.frameRight = p.x;
        mDragWindowHandle.frameBottom = p.y;
        // Pause rotations before a drag.
        if (WindowManagerService.DEBUG_ORIENTATION) {
            Slog.d(WindowManagerService.TAG, "Pausing rotation during drag");
        }
        mService.pauseRotationLocked();
    }
}
Also used : InputApplicationHandle(com.android.server.input.InputApplicationHandle) DragInputEventReceiver(com.android.server.wm.WindowManagerService.DragInputEventReceiver) InputChannel(android.view.InputChannel) Point(android.graphics.Point) InputWindowHandle(com.android.server.input.InputWindowHandle)

Example 2 with DragInputEventReceiver

use of com.android.server.wm.WindowManagerService.DragInputEventReceiver in project android_frameworks_base by DirtyUnicorns.

the class DragState method register.

/**
     * @param display The Display that the window being dragged is on.
     */
void register(Display display) {
    if (DEBUG_DRAG)
        Slog.d(TAG_WM, "registering drag input channel");
    if (mClientChannel != null) {
        Slog.e(TAG_WM, "Duplicate register of drag input channel");
    } else {
        mDisplayContent = mService.getDisplayContentLocked(display.getDisplayId());
        InputChannel[] channels = InputChannel.openInputChannelPair("drag");
        mServerChannel = channels[0];
        mClientChannel = channels[1];
        mService.mInputManager.registerInputChannel(mServerChannel, null);
        mInputEventReceiver = mService.new DragInputEventReceiver(mClientChannel, mService.mH.getLooper());
        mDragApplicationHandle = new InputApplicationHandle(null);
        mDragApplicationHandle.name = "drag";
        mDragApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null, display.getDisplayId());
        mDragWindowHandle.name = "drag";
        mDragWindowHandle.inputChannel = mServerChannel;
        mDragWindowHandle.layer = getDragLayerLw();
        mDragWindowHandle.layoutParamsFlags = 0;
        mDragWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG;
        mDragWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle.visible = true;
        mDragWindowHandle.canReceiveKeys = false;
        mDragWindowHandle.hasFocus = true;
        mDragWindowHandle.hasWallpaper = false;
        mDragWindowHandle.paused = false;
        mDragWindowHandle.ownerPid = Process.myPid();
        mDragWindowHandle.ownerUid = Process.myUid();
        mDragWindowHandle.inputFeatures = 0;
        mDragWindowHandle.scaleFactor = 1.0f;
        // The drag window cannot receive new touches.
        mDragWindowHandle.touchableRegion.setEmpty();
        // The drag window covers the entire display
        mDragWindowHandle.frameLeft = 0;
        mDragWindowHandle.frameTop = 0;
        Point p = new Point();
        display.getRealSize(p);
        mDragWindowHandle.frameRight = p.x;
        mDragWindowHandle.frameBottom = p.y;
        // Pause rotations before a drag.
        if (DEBUG_ORIENTATION) {
            Slog.d(TAG_WM, "Pausing rotation during drag");
        }
        mService.pauseRotationLocked();
    }
}
Also used : InputApplicationHandle(com.android.server.input.InputApplicationHandle) DragInputEventReceiver(com.android.server.wm.WindowManagerService.DragInputEventReceiver) InputChannel(android.view.InputChannel) Point(android.graphics.Point) InputWindowHandle(com.android.server.input.InputWindowHandle)

Example 3 with DragInputEventReceiver

use of com.android.server.wm.WindowManagerService.DragInputEventReceiver in project android_frameworks_base by ResurrectionRemix.

the class DragState method register.

/**
     * @param display The Display that the window being dragged is on.
     */
void register(Display display) {
    if (DEBUG_DRAG)
        Slog.d(TAG_WM, "registering drag input channel");
    if (mClientChannel != null) {
        Slog.e(TAG_WM, "Duplicate register of drag input channel");
    } else {
        mDisplayContent = mService.getDisplayContentLocked(display.getDisplayId());
        InputChannel[] channels = InputChannel.openInputChannelPair("drag");
        mServerChannel = channels[0];
        mClientChannel = channels[1];
        mService.mInputManager.registerInputChannel(mServerChannel, null);
        mInputEventReceiver = mService.new DragInputEventReceiver(mClientChannel, mService.mH.getLooper());
        mDragApplicationHandle = new InputApplicationHandle(null);
        mDragApplicationHandle.name = "drag";
        mDragApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null, display.getDisplayId());
        mDragWindowHandle.name = "drag";
        mDragWindowHandle.inputChannel = mServerChannel;
        mDragWindowHandle.layer = getDragLayerLw();
        mDragWindowHandle.layoutParamsFlags = 0;
        mDragWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG;
        mDragWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle.visible = true;
        mDragWindowHandle.canReceiveKeys = false;
        mDragWindowHandle.hasFocus = true;
        mDragWindowHandle.hasWallpaper = false;
        mDragWindowHandle.paused = false;
        mDragWindowHandle.ownerPid = Process.myPid();
        mDragWindowHandle.ownerUid = Process.myUid();
        mDragWindowHandle.inputFeatures = 0;
        mDragWindowHandle.scaleFactor = 1.0f;
        // The drag window cannot receive new touches.
        mDragWindowHandle.touchableRegion.setEmpty();
        // The drag window covers the entire display
        mDragWindowHandle.frameLeft = 0;
        mDragWindowHandle.frameTop = 0;
        Point p = new Point();
        display.getRealSize(p);
        mDragWindowHandle.frameRight = p.x;
        mDragWindowHandle.frameBottom = p.y;
        // Pause rotations before a drag.
        if (DEBUG_ORIENTATION) {
            Slog.d(TAG_WM, "Pausing rotation during drag");
        }
        mService.pauseRotationLocked();
    }
}
Also used : InputApplicationHandle(com.android.server.input.InputApplicationHandle) DragInputEventReceiver(com.android.server.wm.WindowManagerService.DragInputEventReceiver) InputChannel(android.view.InputChannel) Point(android.graphics.Point) InputWindowHandle(com.android.server.input.InputWindowHandle)

Example 4 with DragInputEventReceiver

use of com.android.server.wm.WindowManagerService.DragInputEventReceiver in project platform_frameworks_base by android.

the class DragState method register.

/**
     * @param display The Display that the window being dragged is on.
     */
void register(Display display) {
    if (DEBUG_DRAG)
        Slog.d(TAG_WM, "registering drag input channel");
    if (mClientChannel != null) {
        Slog.e(TAG_WM, "Duplicate register of drag input channel");
    } else {
        mDisplayContent = mService.getDisplayContentLocked(display.getDisplayId());
        InputChannel[] channels = InputChannel.openInputChannelPair("drag");
        mServerChannel = channels[0];
        mClientChannel = channels[1];
        mService.mInputManager.registerInputChannel(mServerChannel, null);
        mInputEventReceiver = mService.new DragInputEventReceiver(mClientChannel, mService.mH.getLooper());
        mDragApplicationHandle = new InputApplicationHandle(null);
        mDragApplicationHandle.name = "drag";
        mDragApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null, display.getDisplayId());
        mDragWindowHandle.name = "drag";
        mDragWindowHandle.inputChannel = mServerChannel;
        mDragWindowHandle.layer = getDragLayerLw();
        mDragWindowHandle.layoutParamsFlags = 0;
        mDragWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG;
        mDragWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle.visible = true;
        mDragWindowHandle.canReceiveKeys = false;
        mDragWindowHandle.hasFocus = true;
        mDragWindowHandle.hasWallpaper = false;
        mDragWindowHandle.paused = false;
        mDragWindowHandle.ownerPid = Process.myPid();
        mDragWindowHandle.ownerUid = Process.myUid();
        mDragWindowHandle.inputFeatures = 0;
        mDragWindowHandle.scaleFactor = 1.0f;
        // The drag window cannot receive new touches.
        mDragWindowHandle.touchableRegion.setEmpty();
        // The drag window covers the entire display
        mDragWindowHandle.frameLeft = 0;
        mDragWindowHandle.frameTop = 0;
        Point p = new Point();
        display.getRealSize(p);
        mDragWindowHandle.frameRight = p.x;
        mDragWindowHandle.frameBottom = p.y;
        // Pause rotations before a drag.
        if (DEBUG_ORIENTATION) {
            Slog.d(TAG_WM, "Pausing rotation during drag");
        }
        mService.pauseRotationLocked();
    }
}
Also used : InputApplicationHandle(com.android.server.input.InputApplicationHandle) DragInputEventReceiver(com.android.server.wm.WindowManagerService.DragInputEventReceiver) InputChannel(android.view.InputChannel) Point(android.graphics.Point) InputWindowHandle(com.android.server.input.InputWindowHandle)

Example 5 with DragInputEventReceiver

use of com.android.server.wm.WindowManagerService.DragInputEventReceiver in project android_frameworks_base by crdroidandroid.

the class DragState method register.

/**
     * @param display The Display that the window being dragged is on.
     */
void register(Display display) {
    if (DEBUG_DRAG)
        Slog.d(TAG_WM, "registering drag input channel");
    if (mClientChannel != null) {
        Slog.e(TAG_WM, "Duplicate register of drag input channel");
    } else {
        mDisplayContent = mService.getDisplayContentLocked(display.getDisplayId());
        InputChannel[] channels = InputChannel.openInputChannelPair("drag");
        mServerChannel = channels[0];
        mClientChannel = channels[1];
        mService.mInputManager.registerInputChannel(mServerChannel, null);
        mInputEventReceiver = mService.new DragInputEventReceiver(mClientChannel, mService.mH.getLooper());
        mDragApplicationHandle = new InputApplicationHandle(null);
        mDragApplicationHandle.name = "drag";
        mDragApplicationHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle = new InputWindowHandle(mDragApplicationHandle, null, display.getDisplayId());
        mDragWindowHandle.name = "drag";
        mDragWindowHandle.inputChannel = mServerChannel;
        mDragWindowHandle.layer = getDragLayerLw();
        mDragWindowHandle.layoutParamsFlags = 0;
        mDragWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG;
        mDragWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        mDragWindowHandle.visible = true;
        mDragWindowHandle.canReceiveKeys = false;
        mDragWindowHandle.hasFocus = true;
        mDragWindowHandle.hasWallpaper = false;
        mDragWindowHandle.paused = false;
        mDragWindowHandle.ownerPid = Process.myPid();
        mDragWindowHandle.ownerUid = Process.myUid();
        mDragWindowHandle.inputFeatures = 0;
        mDragWindowHandle.scaleFactor = 1.0f;
        // The drag window cannot receive new touches.
        mDragWindowHandle.touchableRegion.setEmpty();
        // The drag window covers the entire display
        mDragWindowHandle.frameLeft = 0;
        mDragWindowHandle.frameTop = 0;
        Point p = new Point();
        display.getRealSize(p);
        mDragWindowHandle.frameRight = p.x;
        mDragWindowHandle.frameBottom = p.y;
        // Pause rotations before a drag.
        if (DEBUG_ORIENTATION) {
            Slog.d(TAG_WM, "Pausing rotation during drag");
        }
        mService.pauseRotationLocked();
    }
}
Also used : InputApplicationHandle(com.android.server.input.InputApplicationHandle) DragInputEventReceiver(com.android.server.wm.WindowManagerService.DragInputEventReceiver) InputChannel(android.view.InputChannel) Point(android.graphics.Point) InputWindowHandle(com.android.server.input.InputWindowHandle)

Aggregations

Point (android.graphics.Point)5 InputChannel (android.view.InputChannel)5 InputApplicationHandle (com.android.server.input.InputApplicationHandle)5 InputWindowHandle (com.android.server.input.InputWindowHandle)5 DragInputEventReceiver (com.android.server.wm.WindowManagerService.DragInputEventReceiver)5