2323
2424import android .content .ClipData ;
2525import android .content .ClipDescription ;
26+ import android .graphics .Point ;
2627import android .graphics .Region ;
2728import android .os .IBinder ;
2829import android .os .Message ;
2930import android .os .Process ;
3031import android .os .RemoteException ;
3132import android .util .Slog ;
32- import android .view .DisplayInfo ;
33+ import android .view .Display ;
3334import android .view .DragEvent ;
3435import android .view .InputChannel ;
3536import android .view .Surface ;
@@ -59,7 +60,7 @@ class DragState {
5960 WindowState mTargetWindow ;
6061 ArrayList <WindowState > mNotifiedWindows ;
6162 boolean mDragInProgress ;
62- DisplayContent mDisplayContent ;
63+ Display mDisplay ;
6364
6465 private final Region mTmpRegion = new Region ();
6566
@@ -87,10 +88,10 @@ void reset() {
8788 }
8889
8990 /**
90- * @param displayContent The display parameters associated with the window being dragged.
91+ * @param display The Display that the window being dragged is on .
9192 */
92- void register (DisplayContent displayContent ) {
93- mDisplayContent = displayContent ;
93+ void register (Display display ) {
94+ mDisplay = display ;
9495 if (WindowManagerService .DEBUG_DRAG ) Slog .d (WindowManagerService .TAG , "registering drag input channel" );
9596 if (mClientChannel != null ) {
9697 Slog .e (WindowManagerService .TAG , "Duplicate register of drag input channel" );
@@ -108,7 +109,7 @@ void register(DisplayContent displayContent) {
108109 WindowManagerService .DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS ;
109110
110111 mDragWindowHandle = new InputWindowHandle (mDragApplicationHandle , null ,
111- mDisplayContent .getDisplayId ());
112+ mDisplay .getDisplayId ());
112113 mDragWindowHandle .name = "drag" ;
113114 mDragWindowHandle .inputChannel = mServerChannel ;
114115 mDragWindowHandle .layer = getDragLayerLw ();
@@ -132,9 +133,10 @@ void register(DisplayContent displayContent) {
132133 // The drag window covers the entire display
133134 mDragWindowHandle .frameLeft = 0 ;
134135 mDragWindowHandle .frameTop = 0 ;
135- DisplayInfo displayInfo = mDisplayContent .getDisplayInfo ();
136- mDragWindowHandle .frameRight = displayInfo .logicalWidth ;
137- mDragWindowHandle .frameBottom = displayInfo .logicalHeight ;
136+ Point p = new Point ();
137+ mDisplay .getRealSize (p );
138+ mDragWindowHandle .frameRight = p .x ;
139+ mDragWindowHandle .frameBottom = p .y ;
138140
139141 // Pause rotations before a drag.
140142 if (WindowManagerService .DEBUG_ORIENTATION ) {
@@ -187,7 +189,7 @@ void broadcastDragStartedLw(final float touchX, final float touchY) {
187189 Slog .d (WindowManagerService .TAG , "broadcasting DRAG_STARTED at (" + touchX + ", " + touchY + ")" );
188190 }
189191
190- final WindowList windows = mDisplayContent .getWindowList ();
192+ final WindowList windows = mService .getWindowList (mDisplay );
191193 final int N = windows .size ();
192194 for (int i = 0 ; i < N ; i ++) {
193195 sendDragStartedLw (windows .get (i ), touchX , touchY , mDataDescription );
@@ -390,7 +392,7 @@ private WindowState getTouchedWinAtPointLw(float xf, float yf) {
390392 final int x = (int ) xf ;
391393 final int y = (int ) yf ;
392394
393- final WindowList windows = mDisplayContent .getWindowList ();
395+ final WindowList windows = mService .getWindowList (mDisplay );
394396 final int N = windows .size ();
395397 for (int i = N - 1 ; i >= 0 ; i --) {
396398 WindowState child = windows .get (i );
0 commit comments