1 /*
2  * Copyright 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  * @addtogroup NativeActivity Native Activity
18  * @{
19  */
20 /**
21  * @file input_transfer_token_jni.h
22  */
23 
24 #pragma once
25 
26 #include <sys/cdefs.h>
27 #include <jni.h>
28 
29 __BEGIN_DECLS
30 struct AInputTransferToken;
31 
32 /**
33  * AInputTransferToken can be used to request focus on or to transfer touch gesture to and from
34  * an embedded SurfaceControl
35  */
36 typedef struct AInputTransferToken AInputTransferToken;
37 
38 /**
39  * Return the AInputTransferToken wrapped by a Java InputTransferToken object. This must be released
40  * using AInputTransferToken_release
41  *
42  * inputTransferTokenObj must be a non-null instance of android.window.InputTransferToken.
43  *
44  * Available since API level 35.
45  */
46 AInputTransferToken* _Nonnull AInputTransferToken_fromJava(JNIEnv* _Nonnull env,
47         jobject _Nonnull inputTransferTokenObj) __INTRODUCED_IN(__ANDROID_API_V__);
48 /**
49  * Return the Java InputTransferToken object that wraps AInputTransferToken
50  *
51  * aInputTransferToken must be non null and the returned value is an object of instance
52  * android.window.InputTransferToken.
53  *
54  * Available since API level 35.
55  */
56 jobject _Nonnull AInputTransferToken_toJava(JNIEnv* _Nonnull env,
57         const AInputTransferToken* _Nonnull aInputTransferToken) __INTRODUCED_IN(__ANDROID_API_V__);
58 
59 /**
60  * Removes a reference that was previously acquired in native.
61  *
62  * Available since API level 35.
63  */
64 void AInputTransferToken_release(AInputTransferToken* _Nullable aInputTransferToken)
65         __INTRODUCED_IN(__ANDROID_API_V__);
66 
67 __END_DECLS
68 /** @} */
69