1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.window;
18 
19 import android.app.ActivityManager;
20 import android.view.DragEvent;
21 import android.window.IUnhandledDragCallback;
22 
23 /**
24  * An interface to a handler for global drags.
25  * {@hide}
26  */
27 oneway interface IGlobalDragListener {
28     /**
29      * Called when a cross-window drag is handled by another window.
30      * @param taskInfo the task containing the window that consumed the drop
31      */
onCrossWindowDrop(in ActivityManager.RunningTaskInfo taskInfo)32     void onCrossWindowDrop(in ActivityManager.RunningTaskInfo taskInfo);
33 
34     /**
35      * Called when the user finishes the drag gesture but no windows have reported handling the
36      * drop.  The DragEvent is populated with the drag surface for the listener to animate.  The
37      * listener *MUST* call the provided callback exactly once when it has finished handling the
38      * drop.  If the listener calls the callback with `true` then it is responsible for removing
39      * and releasing the drag surface passed through the DragEvent.
40      */
onUnhandledDrop(in DragEvent event, in IUnhandledDragCallback callback)41     void onUnhandledDrop(in DragEvent event, in IUnhandledDragCallback callback);
42 }
43