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

Commit fd9d1fb5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Migrate libandroid headers to ndk_headers."

parents b32a59e7 494ed550
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
ndk_headers {
    name: "libandroid_headers",
    from: "include/android",
    to: "android",
    srcs: ["include/android/**/*.h"],
}

subdirs = [
subdirs = [
    "cmds/*",
    "cmds/*",
    "libs/*",
    "libs/*",
+10 −0
Original line number Original line Diff line number Diff line
@@ -26,6 +26,8 @@
#ifndef ANDROID_ASSET_MANAGER_H
#ifndef ANDROID_ASSET_MANAGER_H
#define ANDROID_ASSET_MANAGER_H
#define ANDROID_ASSET_MANAGER_H


#include <sys/cdefs.h>

#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#endif
@@ -131,6 +133,7 @@ int AAsset_read(AAsset* asset, void* buf, size_t count);
 */
 */
off_t AAsset_seek(AAsset* asset, off_t offset, int whence);
off_t AAsset_seek(AAsset* asset, off_t offset, int whence);


#if __ANDROID_API__ >= 13
/**
/**
 * Seek to the specified offset within the asset data.  'whence' uses the
 * Seek to the specified offset within the asset data.  'whence' uses the
 * same constants as lseek()/fseek().
 * same constants as lseek()/fseek().
@@ -141,6 +144,7 @@ off_t AAsset_seek(AAsset* asset, off_t offset, int whence);
 * Returns the new position on success, or (off64_t) -1 on error.
 * Returns the new position on success, or (off64_t) -1 on error.
 */
 */
off64_t AAsset_seek64(AAsset* asset, off64_t offset, int whence);
off64_t AAsset_seek64(AAsset* asset, off64_t offset, int whence);
#endif


/**
/**
 * Close the asset, freeing all associated resources.
 * Close the asset, freeing all associated resources.
@@ -159,23 +163,27 @@ const void* AAsset_getBuffer(AAsset* asset);
 */
 */
off_t AAsset_getLength(AAsset* asset);
off_t AAsset_getLength(AAsset* asset);


#if __ANDROID_API__ >= 13
/**
/**
 * Report the total size of the asset data. Reports the size using a 64-bit
 * Report the total size of the asset data. Reports the size using a 64-bit
 * number insted of 32-bit as AAsset_getLength.
 * number insted of 32-bit as AAsset_getLength.
 */
 */
off64_t AAsset_getLength64(AAsset* asset);
off64_t AAsset_getLength64(AAsset* asset);
#endif


/**
/**
 * Report the total amount of asset data that can be read from the current position.
 * Report the total amount of asset data that can be read from the current position.
 */
 */
off_t AAsset_getRemainingLength(AAsset* asset);
off_t AAsset_getRemainingLength(AAsset* asset);


#if __ANDROID_API__ >= 13
/**
/**
 * Report the total amount of asset data that can be read from the current position.
 * Report the total amount of asset data that can be read from the current position.
 *
 *
 * Uses a 64-bit number instead of a 32-bit number as AAsset_getRemainingLength does.
 * Uses a 64-bit number instead of a 32-bit number as AAsset_getRemainingLength does.
 */
 */
off64_t AAsset_getRemainingLength64(AAsset* asset);
off64_t AAsset_getRemainingLength64(AAsset* asset);
#endif


/**
/**
 * Open a new file descriptor that can be used to read the asset data. If the
 * Open a new file descriptor that can be used to read the asset data. If the
@@ -187,6 +195,7 @@ off64_t AAsset_getRemainingLength64(AAsset* asset);
 */
 */
int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);
int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);


#if __ANDROID_API__ >= 13
/**
/**
 * Open a new file descriptor that can be used to read the asset data.
 * Open a new file descriptor that can be used to read the asset data.
 *
 *
@@ -197,6 +206,7 @@ int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);
 * compressed).
 * compressed).
 */
 */
int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength);
int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength);
#endif


/**
/**
 * Returns whether this asset's internal buffer is allocated in ordinary RAM (i.e. not
 * Returns whether this asset's internal buffer is allocated in ordinary RAM (i.e. not
+5 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,8 @@


__BEGIN_DECLS
__BEGIN_DECLS


#if __ANDROID_API__ >= 24

struct AChoreographer;
struct AChoreographer;
typedef struct AChoreographer AChoreographer;
typedef struct AChoreographer AChoreographer;


@@ -62,6 +64,9 @@ void AChoreographer_postFrameCallback(AChoreographer* choreographer,
 */
 */
void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer,
void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer,
                AChoreographer_frameCallback callback, void* data, long delayMillis);
                AChoreographer_frameCallback callback, void* data, long delayMillis);

#endif /* __ANDROID_API__ >= 24 */

__END_DECLS
__END_DECLS


#endif // ANDROID_CHOREOGRAPHER_H
#endif // ANDROID_CHOREOGRAPHER_H
+6 −0
Original line number Original line Diff line number Diff line
@@ -26,6 +26,8 @@
#ifndef ANDROID_CONFIGURATION_H
#ifndef ANDROID_CONFIGURATION_H
#define ANDROID_CONFIGURATION_H
#define ANDROID_CONFIGURATION_H


#include <sys/cdefs.h>

#include <android/asset_manager.h>
#include <android/asset_manager.h>


#ifdef __cplusplus
#ifdef __cplusplus
@@ -628,6 +630,7 @@ int32_t AConfiguration_getUiModeNight(AConfiguration* config);
 */
 */
void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);
void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);


#if __ANDROID_API__ >= 13
/**
/**
 * Return the current configuration screen width in dp units, or
 * Return the current configuration screen width in dp units, or
 * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
 * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
@@ -660,7 +663,9 @@ int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config);
 * Set the configuration's smallest screen width in dp units.
 * Set the configuration's smallest screen width in dp units.
 */
 */
void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
#endif /* __ANDROID_API__ >= 13 */


#if __ANDROID_API__ >= 17
/**
/**
 * Return the configuration's layout direction, or
 * Return the configuration's layout direction, or
 * ACONFIGURATION_LAYOUTDIR_ANY if not set.
 * ACONFIGURATION_LAYOUTDIR_ANY if not set.
@@ -671,6 +676,7 @@ int32_t AConfiguration_getLayoutDirection(AConfiguration* config);
 * Set the configuration's layout direction.
 * Set the configuration's layout direction.
 */
 */
void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value);
void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value);
#endif /* __ANDROID_API__ >= 17 */


/**
/**
 * Perform a diff between two configurations.  Returns a bit mask of
 * Perform a diff between two configurations.  Returns a bit mask of
+10 −0
Original line number Original line Diff line number Diff line
@@ -26,6 +26,8 @@
#ifndef _ANDROID_INPUT_H
#ifndef _ANDROID_INPUT_H
#define _ANDROID_INPUT_H
#define _ANDROID_INPUT_H


#include <sys/cdefs.h>

/******************************************************************
/******************************************************************
 *
 *
 * IMPORTANT NOTICE:
 * IMPORTANT NOTICE:
@@ -978,8 +980,10 @@ int32_t AMotionEvent_getFlags(const AInputEvent* motion_event);
 */
 */
int32_t AMotionEvent_getMetaState(const AInputEvent* motion_event);
int32_t AMotionEvent_getMetaState(const AInputEvent* motion_event);


#if __ANDROID_API__ >= 14
/** Get the button state of all buttons that are pressed. */
/** Get the button state of all buttons that are pressed. */
int32_t AMotionEvent_getButtonState(const AInputEvent* motion_event);
int32_t AMotionEvent_getButtonState(const AInputEvent* motion_event);
#endif


/**
/**
 * Get a bitfield indicating which edges, if any, were touched by this motion event.
 * Get a bitfield indicating which edges, if any, were touched by this motion event.
@@ -1044,12 +1048,14 @@ size_t AMotionEvent_getPointerCount(const AInputEvent* motion_event);
 */
 */
int32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index);
int32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index);


#if __ANDROID_API__ >= 14
/**
/**
 * Get the tool type of a pointer for the given pointer index.
 * Get the tool type of a pointer for the given pointer index.
 * The tool type indicates the type of tool used to make contact such as a
 * The tool type indicates the type of tool used to make contact such as a
 * finger or stylus, if known.
 * finger or stylus, if known.
 */
 */
int32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index);
int32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index);
#endif


/**
/**
 * Get the original raw X coordinate of this event.
 * Get the original raw X coordinate of this event.
@@ -1139,9 +1145,11 @@ float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_
 */
 */
float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index);


#if __ANDROID_API__ >= 13
/** Get the value of the request axis for the given pointer index. */
/** Get the value of the request axis for the given pointer index. */
float AMotionEvent_getAxisValue(const AInputEvent* motion_event,
float AMotionEvent_getAxisValue(const AInputEvent* motion_event,
        int32_t axis, size_t pointer_index);
        int32_t axis, size_t pointer_index);
#endif


/**
/**
 * Get the number of historical points in this event.  These are movements that
 * Get the number of historical points in this event.  These are movements that
@@ -1272,12 +1280,14 @@ float AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_
float AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index,
float AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index,
        size_t history_index);
        size_t history_index);


#if __ANDROID_API__ >= 13
/**
/**
 * Get the historical value of the request axis for the given pointer index
 * Get the historical value of the request axis for the given pointer index
 * that occurred between this event and the previous motion event.
 * that occurred between this event and the previous motion event.
 */
 */
float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event,
float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event,
        int32_t axis, size_t pointer_index, size_t history_index);
        int32_t axis, size_t pointer_index, size_t history_index);
#endif




struct AInputQueue;
struct AInputQueue;
Loading