Skip to content
Commit bb28efb6 authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Add pre/post callback to IDragDropCallback

Previoulsy we uses mWriteLock to avoid race condition between
DragDropController and IDragDropCallback. However it turns out we have
dead lock here.

1. DragDropController invokes performDrag for drag operation B with
   holding write lock.
2. The Callback initiates other drag operation A before processing B.
3. A does not complete because DragDropController holding write lock for
   B. B does not complete because the callback try to process request A
   before B.

The CL removes write lock and separates the existing callback methods
into two: pre and post callbacks.

1. DragDropController invokes prePerfromDrag for drag operaiton B, which
   blocks.
2. The callback initiates other drag operation A before processing B.
3. DragDropController invokes prePerfromDrag for drag operaiton A, which
   returns immediately. DragDropController processes A and invokes
   postPefromCallback for A.
4. The Callback unblocks prePerfromDrag for B.

Bug: 65564090
Test: android.server.wm.CrossAppDragAndDropTests, manually check the
      drag and drop behavior on test app.
Change-Id: I393a031cb276d6fa7ea56909959d0f2c5d621125
parent 3952e256
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment