Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e71a3213 authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev
Browse files

Fix drag and drop URI permission grants

Currently cross app drag and drop with content URIs
only works for Owner. This is because the source Uid
is initialized after a Binder.clearCallingIdentity call.
The real source app identity is lost and things work
by accident for Owner only.

Bug: 25232077
Change-Id: Iaaaa735a04909a3b05fae7a7a421dbf02206cd68
parent 05e6287b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@ class DragState {
        mSurfaceControl = surface;
        mFlags = flags;
        mLocalWin = localWin;
        mUid = Binder.getCallingUid();
        mNotifiedWindows = new ArrayList<WindowState>();
    }

+2 −1
Original line number Diff line number Diff line
@@ -6970,7 +6970,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    + " asbinder=" + window.asBinder());
        }

        final int callerPid = Binder.getCallingPid();
        final int callerUid = Binder.getCallingUid();
        final long origId = Binder.clearCallingIdentity();
        IBinder token = null;

@@ -6995,6 +6995,7 @@ public class WindowManagerService extends IWindowManager.Stub
                        final IBinder winBinder = window.asBinder();
                        token = new Binder();
                        mDragState = new DragState(this, token, surface, flags, winBinder);
                        mDragState.mUid = callerUid;
                        token = mDragState.mToken = new Binder();

                        // 5 second timeout for this window to actually begin the drag