Loading services/core/java/com/android/server/wm/DragDropController.java +0 −11 Original line number Diff line number Diff line Loading @@ -73,17 +73,6 @@ class DragDropController { return mDragState != null && !mDragState.isClosing(); } void showInputSurface(SurfaceControl.Transaction t, int displayId) { mDragState.showInputSurface(t, displayId); } void hideInputSurface(SurfaceControl.Transaction t, int displayId) { if (mDragState != null) { // TODO: Are we guaranteed to get here? mDragState.hideInputSurface(t, displayId); } } void registerCallback(IDragDropCallback callback) { Preconditions.checkNotNull(callback); mCallback.set(callback); Loading services/core/java/com/android/server/wm/DragState.java +18 −22 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ class DragState { // A surface used to catch input events for the drag-and-drop operation. SurfaceControl mInputSurface; private final SurfaceControl.Transaction mTransaction = new SurfaceControl.Transaction(); private final SurfaceControl.Transaction mTransaction; private final Rect mTmpClipRect = new Rect(); Loading @@ -140,31 +140,24 @@ class DragState { mFlags = flags; mLocalWin = localWin; mNotifiedWindows = new ArrayList<WindowState>(); mTransaction = service.mTransactionFactory.make(); } boolean isClosing() { return mIsClosing; } void hideInputSurface(SurfaceControl.Transaction t, int displayId) { if (displayId != mDisplayContent.getDisplayId()) { return; } private void hideInputSurface() { if (mInputSurface != null) { t.hide(mInputSurface); mTransaction.hide(mInputSurface).apply(); } } void showInputSurface(SurfaceControl.Transaction t, int displayId) { if (displayId != mDisplayContent.getDisplayId()) { return; } private void showInputSurface() { if (mInputSurface == null) { mInputSurface = mService.makeSurfaceBuilder(mService.mRoot.getDisplayContent(displayId) .getSession()).setContainerLayer() mInputSurface = mService.makeSurfaceBuilder( mService.mRoot.getDisplayContent(mDisplayContent.getDisplayId()).getSession()) .setContainerLayer() .setName("Drag and Drop Input Consumer").build(); } final InputWindowHandle h = getInputWindowHandle(); Loading @@ -174,14 +167,16 @@ class DragState { return; } t.show(mInputSurface); t.setInputWindowInfo(mInputSurface, h); t.setLayer(mInputSurface, Integer.MAX_VALUE); mTransaction.show(mInputSurface); mTransaction.setInputWindowInfo(mInputSurface, h); mTransaction.setLayer(mInputSurface, Integer.MAX_VALUE); mTmpClipRect.set(0, 0, mDisplaySize.x, mDisplaySize.y); t.setWindowCrop(mInputSurface, mTmpClipRect); t.transferTouchFocus(mTransferTouchFromToken, h.token); mTransaction.setWindowCrop(mInputSurface, mTmpClipRect); mTransaction.transferTouchFocus(mTransferTouchFromToken, h.token); mTransferTouchFromToken = null; mTransaction.apply(); } /** Loading @@ -199,9 +194,10 @@ class DragState { mDragDropController.sendHandlerMessage( MSG_TEAR_DOWN_DRAG_AND_DROP_INPUT, mInputInterceptor); mInputInterceptor = null; mDisplayContent.getInputMonitor().updateInputWindowsLw(true /*force*/); } hideInputSurface(); // Send drag end broadcast if drag start has been sent. if (mDragInProgress) { final int myPid = Process.myPid(); Loading Loading @@ -352,7 +348,7 @@ class DragState { Slog.e(TAG_WM, "Duplicate register of drag input channel"); } else { mInputInterceptor = new InputInterceptor(display); mDisplayContent.getInputMonitor().updateInputWindowsLw(true /*force*/); showInputSurface(); } } Loading services/core/java/com/android/server/wm/InputMonitor.java +0 −10 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLP import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DRAG; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING; Loading Loading @@ -129,15 +128,6 @@ final class InputMonitor { // If there's a drag in flight, provide a pseudo-window to catch drag input final boolean inDrag = mService.mDragDropController.dragDropActiveLocked(); if (inDrag) { if (DEBUG_DRAG) { Log.d(TAG_WM, "Inserting drag window"); } mService.mDragDropController.showInputSurface(mInputTransaction, mDisplayId); } else { mService.mDragDropController.hideInputSurface(mInputTransaction, mDisplayId); } final boolean inPositioning = mService.mTaskPositioningController.isPositioningLocked(); if (inPositioning) { Loading Loading
services/core/java/com/android/server/wm/DragDropController.java +0 −11 Original line number Diff line number Diff line Loading @@ -73,17 +73,6 @@ class DragDropController { return mDragState != null && !mDragState.isClosing(); } void showInputSurface(SurfaceControl.Transaction t, int displayId) { mDragState.showInputSurface(t, displayId); } void hideInputSurface(SurfaceControl.Transaction t, int displayId) { if (mDragState != null) { // TODO: Are we guaranteed to get here? mDragState.hideInputSurface(t, displayId); } } void registerCallback(IDragDropCallback callback) { Preconditions.checkNotNull(callback); mCallback.set(callback); Loading
services/core/java/com/android/server/wm/DragState.java +18 −22 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ class DragState { // A surface used to catch input events for the drag-and-drop operation. SurfaceControl mInputSurface; private final SurfaceControl.Transaction mTransaction = new SurfaceControl.Transaction(); private final SurfaceControl.Transaction mTransaction; private final Rect mTmpClipRect = new Rect(); Loading @@ -140,31 +140,24 @@ class DragState { mFlags = flags; mLocalWin = localWin; mNotifiedWindows = new ArrayList<WindowState>(); mTransaction = service.mTransactionFactory.make(); } boolean isClosing() { return mIsClosing; } void hideInputSurface(SurfaceControl.Transaction t, int displayId) { if (displayId != mDisplayContent.getDisplayId()) { return; } private void hideInputSurface() { if (mInputSurface != null) { t.hide(mInputSurface); mTransaction.hide(mInputSurface).apply(); } } void showInputSurface(SurfaceControl.Transaction t, int displayId) { if (displayId != mDisplayContent.getDisplayId()) { return; } private void showInputSurface() { if (mInputSurface == null) { mInputSurface = mService.makeSurfaceBuilder(mService.mRoot.getDisplayContent(displayId) .getSession()).setContainerLayer() mInputSurface = mService.makeSurfaceBuilder( mService.mRoot.getDisplayContent(mDisplayContent.getDisplayId()).getSession()) .setContainerLayer() .setName("Drag and Drop Input Consumer").build(); } final InputWindowHandle h = getInputWindowHandle(); Loading @@ -174,14 +167,16 @@ class DragState { return; } t.show(mInputSurface); t.setInputWindowInfo(mInputSurface, h); t.setLayer(mInputSurface, Integer.MAX_VALUE); mTransaction.show(mInputSurface); mTransaction.setInputWindowInfo(mInputSurface, h); mTransaction.setLayer(mInputSurface, Integer.MAX_VALUE); mTmpClipRect.set(0, 0, mDisplaySize.x, mDisplaySize.y); t.setWindowCrop(mInputSurface, mTmpClipRect); t.transferTouchFocus(mTransferTouchFromToken, h.token); mTransaction.setWindowCrop(mInputSurface, mTmpClipRect); mTransaction.transferTouchFocus(mTransferTouchFromToken, h.token); mTransferTouchFromToken = null; mTransaction.apply(); } /** Loading @@ -199,9 +194,10 @@ class DragState { mDragDropController.sendHandlerMessage( MSG_TEAR_DOWN_DRAG_AND_DROP_INPUT, mInputInterceptor); mInputInterceptor = null; mDisplayContent.getInputMonitor().updateInputWindowsLw(true /*force*/); } hideInputSurface(); // Send drag end broadcast if drag start has been sent. if (mDragInProgress) { final int myPid = Process.myPid(); Loading Loading @@ -352,7 +348,7 @@ class DragState { Slog.e(TAG_WM, "Duplicate register of drag input channel"); } else { mInputInterceptor = new InputInterceptor(display); mDisplayContent.getInputMonitor().updateInputWindowsLw(true /*force*/); showInputSurface(); } } Loading
services/core/java/com/android/server/wm/InputMonitor.java +0 −10 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLP import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DRAG; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING; Loading Loading @@ -129,15 +128,6 @@ final class InputMonitor { // If there's a drag in flight, provide a pseudo-window to catch drag input final boolean inDrag = mService.mDragDropController.dragDropActiveLocked(); if (inDrag) { if (DEBUG_DRAG) { Log.d(TAG_WM, "Inserting drag window"); } mService.mDragDropController.showInputSurface(mInputTransaction, mDisplayId); } else { mService.mDragDropController.hideInputSurface(mInputTransaction, mDisplayId); } final boolean inPositioning = mService.mTaskPositioningController.isPositioningLocked(); if (inPositioning) { Loading