Actually draw the drag thumbnail
Now sets the layer and thumbnail dimensions correctly. Also removed the
leftover bits of the now-replaced thumbnail measurement/drawing mechanism.
Fixes bug 3077339
Change-Id: I02983648e0a7ce2ce5fee10825f744e20a3a5b8d
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 6c23e376..def36de 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -555,6 +555,12 @@
}
}
+ int getDragLayerLw() {
+ return mPolicy.windowTypeToLayerLw(WindowManager.LayoutParams.TYPE_DRAG)
+ * TYPE_LAYER_MULTIPLIER
+ + TYPE_LAYER_OFFSET;
+ }
+
/* call out to each visible window/session informing it about the drag
*/
void broadcastDragStartedLw(final float touchX, final float touchY) {
@@ -5533,7 +5539,7 @@
return null;
}
- private void addDragInputWindow(InputWindowList windowList) {
+ private void addDragInputWindowLw(InputWindowList windowList) {
final InputWindow inputWindow = windowList.add();
inputWindow.inputChannel = mDragState.mServerChannel;
inputWindow.name = "drag";
@@ -5545,9 +5551,7 @@
inputWindow.hasFocus = true;
inputWindow.hasWallpaper = false;
inputWindow.paused = false;
- inputWindow.layer = mPolicy.windowTypeToLayerLw(inputWindow.layoutParamsType)
- * TYPE_LAYER_MULTIPLIER
- + TYPE_LAYER_OFFSET;
+ inputWindow.layer = mDragState.getDragLayerLw();
inputWindow.ownerPid = Process.myPid();
inputWindow.ownerUid = Process.myUid();
@@ -5583,7 +5587,7 @@
if (DEBUG_DRAG) {
Log.d(TAG, "Inserting drag window");
}
- addDragInputWindow(mTempInputWindows);
+ addDragInputWindowLw(mTempInputWindows);
}
final int N = windows.size();
@@ -6231,6 +6235,7 @@
surface.setPosition((int)(touchX - thumbCenterX),
(int)(touchY - thumbCenterY));
surface.setAlpha(.5f);
+ surface.setLayer(mDragState.getDragLayerLw());
surface.show();
} finally {
surface.closeTransaction();