diff options
| author | 2017-12-06 11:52:02 -0800 | |
|---|---|---|
| committer | 2017-12-06 14:24:50 -0800 | |
| commit | d1a6d1eb81b14966a30a68b67996916ee27afb6f (patch) | |
| tree | f5100ca72ea06d172b17fd11f8403549315740d8 /include/android | |
| parent | 68686bd15198f64db633a757718b918895a1ca71 (diff) | |
| parent | 60175af9c8938d2362ec8a8b06543ce8c41b2338 (diff) | |
DO NOT MERGE: Merge Oreo MR1 into master
Exempt-From-Owner-Approval: Changes already landed internally
Change-Id: I37c19d77fbf144fb30cc2a2877247a855684d4ad
Diffstat (limited to 'include/android')
| -rw-r--r-- | include/android/keycodes.h | 4 | ||||
| -rw-r--r-- | include/android/sensor.h | 4 | ||||
| -rw-r--r-- | include/android/sharedmem_jni.h | 83 |
3 files changed, 88 insertions, 3 deletions
diff --git a/include/android/keycodes.h b/include/android/keycodes.h index e202060f16..2164d6163e 100644 --- a/include/android/keycodes.h +++ b/include/android/keycodes.h @@ -765,7 +765,9 @@ enum { /** fingerprint navigation key, left. */ AKEYCODE_SYSTEM_NAVIGATION_LEFT = 282, /** fingerprint navigation key, right. */ - AKEYCODE_SYSTEM_NAVIGATION_RIGHT = 283 + AKEYCODE_SYSTEM_NAVIGATION_RIGHT = 283, + /** all apps */ + AKEYCODE_ALL_APPS = 284 // NOTE: If you add a new keycode here you must also add it to several other files. // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. diff --git a/include/android/sensor.h b/include/android/sensor.h index 2db0ee7fd9..a88733cac7 100644 --- a/include/android/sensor.h +++ b/include/android/sensor.h @@ -197,7 +197,7 @@ enum { * A sensor event. */ -/* NOTE: changes to these structs have to be backward compatible */ +/* NOTE: Must match hardware/sensors.h */ typedef struct ASensorVector { union { float v[3]; @@ -259,7 +259,7 @@ typedef struct { }; } AAdditionalInfoEvent; -/* NOTE: changes to this struct has to be backward compatible */ +/* NOTE: Must match hardware/sensors.h */ typedef struct ASensorEvent { int32_t version; /* sizeof(struct ASensorEvent) */ int32_t sensor; diff --git a/include/android/sharedmem_jni.h b/include/android/sharedmem_jni.h new file mode 100644 index 0000000000..85ac78f9b1 --- /dev/null +++ b/include/android/sharedmem_jni.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup Memory + * @{ + */ + +/** + * @file sharedmem_jni.h + */ + +#ifndef ANDROID_SHARED_MEMORY_JNI_H +#define ANDROID_SHARED_MEMORY_JNI_H + +#include <jni.h> +#include <android/sharedmem.h> +#include <stddef.h> + +/****************************************************************** + * + * IMPORTANT NOTICE: + * + * This file is part of Android's set of stable system headers + * exposed by the Android NDK (Native Development Kit). + * + * Third-party source AND binary code relies on the definitions + * here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES. + * + * - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES) + * - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS + * - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY + * - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES + */ + +/** + * Structures and functions for a shared memory buffer that can be shared across process. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if __ANDROID_API__ >= __ANDROID_API_O_MR1__ + +/** + * Returns a dup'd FD from the given Java android.os.SharedMemory object. The returned file + * descriptor has all the same properties & capabilities as the FD returned from + * ASharedMemory_create(), however the protection flags will be the same as those of the + * android.os.SharedMemory object. + * + * Use close() to release the shared memory region. + * + * \param env The JNIEnv* pointer + * \param sharedMemory The Java android.os.SharedMemory object + * \return file descriptor that denotes the shared memory; -1 if the shared memory object is + * already closed, if the JNIEnv or jobject is NULL, or if there are too many open file + * descriptors (errno=EMFILE) + */ +int ASharedMemory_dupFromJava(JNIEnv* env, jobject sharedMemory); + +#endif + +#ifdef __cplusplus +}; +#endif + +#endif // ANDROID_SHARED_MEMORY_JNI_H + +/** @} */ |