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

Commit 9db409b0 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Add __INTRODUCED_IN to core <android/*.h> APIs.

Bug: https://github.com/android-ndk/ndk/issues/706
Test: builds
Change-Id: I23db5a2180517045bafabe6fbf783456cbddf21a
parent 5d51a061
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -30,8 +30,6 @@

__BEGIN_DECLS

#if __ANDROID_API__ >= 24

struct AChoreographer;
typedef struct AChoreographer AChoreographer;

@@ -49,23 +47,23 @@ typedef void (*AChoreographer_frameCallback)(long frameTimeNanos, void* data);
 * Get the AChoreographer instance for the current thread. This must be called
 * on an ALooper thread.
 */
AChoreographer* AChoreographer_getInstance();
AChoreographer* AChoreographer_getInstance() __INTRODUCED_IN(24);

/**
 * Post a callback to be run on the next frame. The data pointer provided will
 * be passed to the callback function when it's called.
 */
void AChoreographer_postFrameCallback(AChoreographer* choreographer,
                AChoreographer_frameCallback callback, void* data);
                AChoreographer_frameCallback callback, void* data) __INTRODUCED_IN(24);

/**
 * Post a callback to be run on the frame following the specified delay. The
 * data pointer provided will be passed to the callback function when it's
 * called.
 */
void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer,
                AChoreographer_frameCallback callback, void* data, long delayMillis);

#endif /* __ANDROID_API__ >= 24 */
                AChoreographer_frameCallback callback, void* data,
                long delayMillis) __INTRODUCED_IN(24);

__END_DECLS

+12 −12
Original line number Diff line number Diff line
@@ -30,6 +30,10 @@

#include <android/asset_manager.h>

#if !defined(__INTRODUCED_IN)
#define __INTRODUCED_IN(__api_level) /* nothing */
#endif

#ifdef __cplusplus
extern "C" {
#endif
@@ -671,53 +675,49 @@ int32_t AConfiguration_getUiModeNight(AConfiguration* config);
 */
void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);

#if __ANDROID_API__ >= 13
/**
 * Return the current configuration screen width in dp units, or
 * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
 */
int32_t AConfiguration_getScreenWidthDp(AConfiguration* config);
int32_t AConfiguration_getScreenWidthDp(AConfiguration* config) __INTRODUCED_IN(13);

/**
 * Set the configuration's current screen width in dp units.
 */
void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value);
void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value) __INTRODUCED_IN(13);

/**
 * Return the current configuration screen height in dp units, or
 * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
 */
int32_t AConfiguration_getScreenHeightDp(AConfiguration* config);
int32_t AConfiguration_getScreenHeightDp(AConfiguration* config) __INTRODUCED_IN(13);

/**
 * Set the configuration's current screen width in dp units.
 */
void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value);
void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value) __INTRODUCED_IN(13);

/**
 * Return the configuration's smallest screen width in dp units, or
 * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
 */
int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config);
int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config) __INTRODUCED_IN(13);

/**
 * Set the configuration's smallest screen width in dp units.
 */
void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
#endif /* __ANDROID_API__ >= 13 */
void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value) __INTRODUCED_IN(13);

#if __ANDROID_API__ >= 17
/**
 * Return the configuration's layout direction, or
 * ACONFIGURATION_LAYOUTDIR_ANY if not set.
 */
int32_t AConfiguration_getLayoutDirection(AConfiguration* config);
int32_t AConfiguration_getLayoutDirection(AConfiguration* config) __INTRODUCED_IN(17);

/**
 * Set the configuration's layout direction.
 */
void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value);
#endif /* __ANDROID_API__ >= 17 */
void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value) __INTRODUCED_IN(17);

/**
 * Perform a diff between two configurations.  Returns a bit mask of
+8 −12
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@
#include <android/keycodes.h>
#include <android/looper.h>

#if !defined(__INTRODUCED_IN)
#define __INTRODUCED_IN(__api_level) /* nothing */
#endif

#ifdef __cplusplus
extern "C" {
#endif
@@ -982,10 +986,8 @@ int32_t AMotionEvent_getFlags(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. */
int32_t AMotionEvent_getButtonState(const AInputEvent* motion_event);
#endif
int32_t AMotionEvent_getButtonState(const AInputEvent* motion_event) __INTRODUCED_IN(14);

/**
 * Get a bitfield indicating which edges, if any, were touched by this motion event.
@@ -1050,14 +1052,12 @@ size_t AMotionEvent_getPointerCount(const AInputEvent* motion_event);
 */
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.
 * The tool type indicates the type of tool used to make contact such as a
 * finger or stylus, if known.
 */
int32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index);
#endif
int32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index) __INTRODUCED_IN(14);

/**
 * Get the original raw X coordinate of this event.
@@ -1147,11 +1147,9 @@ float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_
 */
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. */
float AMotionEvent_getAxisValue(const AInputEvent* motion_event,
        int32_t axis, size_t pointer_index);
#endif
        int32_t axis, size_t pointer_index) __INTRODUCED_IN(13);

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

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


struct AInputQueue;
+3 −7
Original line number Diff line number Diff line
@@ -60,8 +60,6 @@ typedef uint64_t net_handle_t;
 * on failure with an appropriate errno value set.
 */

#if __ANDROID_API__ >= 24

/**
 * Set the network to be used by the given socket file descriptor.
 *
@@ -70,7 +68,7 @@ typedef uint64_t net_handle_t;
 * This is the equivalent of: [android.net.Network#bindSocket()](https://developer.android.com/reference/android/net/Network.html#bindSocket(java.net.Socket))
 *
 */
int android_setsocknetwork(net_handle_t network, int fd);
int android_setsocknetwork(net_handle_t network, int fd) __INTRODUCED_IN(23);


/**
@@ -87,7 +85,7 @@ int android_setsocknetwork(net_handle_t network, int fd);
 * This is the equivalent of: [android.net.ConnectivityManager#setProcessDefaultNetwork()](https://developer.android.com/reference/android/net/ConnectivityManager.html#setProcessDefaultNetwork(android.net.Network))
 *
 */
int android_setprocnetwork(net_handle_t network);
int android_setprocnetwork(net_handle_t network) __INTRODUCED_IN(23);


/**
@@ -106,9 +104,7 @@ int android_setprocnetwork(net_handle_t network);
 */
int android_getaddrinfofornetwork(net_handle_t network,
        const char *node, const char *service,
        const struct addrinfo *hints, struct addrinfo **res);

#endif /* __ANDROID_API__ >= 24 */
        const struct addrinfo *hints, struct addrinfo **res) __INTRODUCED_IN(23);

__END_DECLS

+1 −3
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ extern "C" {
 */
ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface);

#if __ANDROID_API__ >= 26
/**
 * Return a Java Surface object derived from the ANativeWindow, for interacting
 * with it through Java code. The returned Java object acquires a reference on
@@ -52,8 +51,7 @@ ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface);
 * and will automatically release the reference when the Java object gets garbage
 * collected.
 */
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
#endif
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window) __INTRODUCED_IN(26);

#ifdef __cplusplus
};
Loading