Remove __ANDROID_API__ #if checks.
__INTRODUCED_IN() does the right thing automatically now.
Bug: http://b/178449269
Test: treehugger
Change-Id: I9c0776bb4868f7f6a083dd52ca7ebedfffcc8f4c
Merged-In: I9c0776bb4868f7f6a083dd52ca7ebedfffcc8f4c
diff --git a/camera/ndk/include/camera/NdkCameraCaptureSession.h b/camera/ndk/include/camera/NdkCameraCaptureSession.h
index 07176cf..6c1cf33 100644
--- a/camera/ndk/include/camera/NdkCameraCaptureSession.h
+++ b/camera/ndk/include/camera/NdkCameraCaptureSession.h
@@ -45,8 +45,6 @@
__BEGIN_DECLS
-#if __ANDROID_API__ >= 24
-
/**
* ACameraCaptureSession is an opaque type that manages frame captures of a camera device.
*
@@ -593,10 +591,6 @@
camera_status_t ACameraCaptureSession_abortCaptures(ACameraCaptureSession* session)
__INTRODUCED_IN(24);
-#endif /* __ANDROID_API__ >= 24 */
-
-#if __ANDROID_API__ >= 28
-
typedef struct ACaptureSessionOutput ACaptureSessionOutput;
/**
@@ -641,9 +635,7 @@
*/
camera_status_t ACameraCaptureSession_updateSharedOutput(ACameraCaptureSession* session,
ACaptureSessionOutput* output) __INTRODUCED_IN(28);
-#endif /* __ANDROID_API__ >= 28 */
-#if __ANDROID_API__ >= 29
/**
* The definition of final capture result callback with logical multi-camera support.
*
@@ -788,8 +780,6 @@
int numRequests, ACaptureRequest** requests,
/*optional*/int* captureSequenceId) __INTRODUCED_IN(29);
-#endif /* __ANDROID_API__ >= 29 */
-
__END_DECLS
#endif /* _NDK_CAMERA_CAPTURE_SESSION_H */
diff --git a/camera/ndk/include/camera/NdkCameraDevice.h b/camera/ndk/include/camera/NdkCameraDevice.h
index 1537bde..f72fe8d 100644
--- a/camera/ndk/include/camera/NdkCameraDevice.h
+++ b/camera/ndk/include/camera/NdkCameraDevice.h
@@ -44,8 +44,6 @@
__BEGIN_DECLS
-#if __ANDROID_API__ >= 24
-
/**
* ACameraDevice is opaque type that provides access to a camera device.
*
@@ -687,10 +685,6 @@
const ACameraCaptureSession_stateCallbacks* callbacks,
/*out*/ACameraCaptureSession** session) __INTRODUCED_IN(24);
-#endif /* __ANDROID_API__ >= 24 */
-
-#if __ANDROID_API__ >= 28
-
/**
* Create a shared ACaptureSessionOutput object.
*
@@ -782,10 +776,6 @@
const ACameraCaptureSession_stateCallbacks* callbacks,
/*out*/ACameraCaptureSession** session) __INTRODUCED_IN(28);
-#endif /* __ANDROID_API__ >= 28 */
-
-#if __ANDROID_API__ >= 29
-
/**
* Create a ACaptureSessionOutput object used for streaming from a physical
* camera as part of a logical camera device.
@@ -890,8 +880,6 @@
const ACameraDevice* device,
const ACaptureSessionOutputContainer* sessionOutputContainer) __INTRODUCED_IN(29);
-#endif /* __ANDROID_API__ >= 29 */
-
__END_DECLS
#endif /* _NDK_CAMERA_DEVICE_H */
diff --git a/camera/ndk/include/camera/NdkCameraError.h b/camera/ndk/include/camera/NdkCameraError.h
index fc618ee..9d77eb4 100644
--- a/camera/ndk/include/camera/NdkCameraError.h
+++ b/camera/ndk/include/camera/NdkCameraError.h
@@ -40,8 +40,6 @@
__BEGIN_DECLS
-#if __ANDROID_API__ >= 24
-
typedef enum {
ACAMERA_OK = 0,
@@ -138,8 +136,6 @@
ACAMERA_ERROR_UNSUPPORTED_OPERATION = ACAMERA_ERROR_BASE - 14,
} camera_status_t;
-#endif /* __ANDROID_API__ >= 24 */
-
__END_DECLS
#endif /* _NDK_CAMERA_ERROR_H */
diff --git a/camera/ndk/include/camera/NdkCameraManager.h b/camera/ndk/include/camera/NdkCameraManager.h
index 0a2ee57..be32b11 100644
--- a/camera/ndk/include/camera/NdkCameraManager.h
+++ b/camera/ndk/include/camera/NdkCameraManager.h
@@ -44,8 +44,6 @@
__BEGIN_DECLS
-#if __ANDROID_API__ >= 24
-
/**
* ACameraManager is opaque type that provides access to camera service.
*
@@ -293,10 +291,6 @@
ACameraDevice_StateCallbacks* callback,
/*out*/ACameraDevice** device) __INTRODUCED_IN(24);
-#endif /* __ANDROID_API__ >= 24 */
-
-#if __ANDROID_API__ >= 29
-
/**
* Definition of camera access permission change callback.
*
@@ -419,8 +413,6 @@
__INTRODUCED_IN(29);
#endif
-#endif /* __ANDROID_API__ >= 29 */
-
__END_DECLS
#endif /* _NDK_CAMERA_MANAGER_H */
diff --git a/camera/ndk/include/camera/NdkCameraMetadata.h b/camera/ndk/include/camera/NdkCameraMetadata.h
index a840bd1..0d5e6c4 100644
--- a/camera/ndk/include/camera/NdkCameraMetadata.h
+++ b/camera/ndk/include/camera/NdkCameraMetadata.h
@@ -41,9 +41,7 @@
#include <sys/cdefs.h>
#ifndef __ANDROID_VNDK__
-#if __ANDROID_API__ >= 30
#include "jni.h"
-#endif /* __ANDROID_API__ >= 30 */
#endif /* __ANDROID_VNDK__ */
#include "NdkCameraError.h"
@@ -51,8 +49,6 @@
__BEGIN_DECLS
-#if __ANDROID_API__ >= 24
-
/**
* ACameraMetadata is opaque type that provides access to read-only camera metadata like camera
* characteristics (via {@link ACameraManager_getCameraCharacteristics}) or capture results (via
@@ -238,10 +234,6 @@
*/
void ACameraMetadata_free(ACameraMetadata* metadata) __INTRODUCED_IN(24);
-#endif /* __ANDROID_API__ >= 24 */
-
-#if __ANDROID_API__ >= 29
-
/**
* Helper function to check if a camera is logical multi-camera.
*
@@ -260,10 +252,7 @@
/*out*/size_t* numPhysicalCameras, /*out*/const char* const** physicalCameraIds)
__INTRODUCED_IN(29);
-#endif /* __ANDROID_API__ >= 29 */
-
#ifndef __ANDROID_VNDK__
-#if __ANDROID_API__ >= 30
/**
* Return a {@link ACameraMetadata} that references the same data as
@@ -290,7 +279,6 @@
ACameraMetadata* ACameraMetadata_fromCameraMetadata(JNIEnv* env, jobject cameraMetadata)
__INTRODUCED_IN(30);
-#endif /* __ANDROID_API__ >= 30 */
#endif /* __ANDROID_VNDK__ */
__END_DECLS
diff --git a/camera/ndk/include/camera/NdkCameraMetadataTags.h b/camera/ndk/include/camera/NdkCameraMetadataTags.h
index 1354fce..af12354 100644
--- a/camera/ndk/include/camera/NdkCameraMetadataTags.h
+++ b/camera/ndk/include/camera/NdkCameraMetadataTags.h
@@ -40,8 +40,6 @@
__BEGIN_DECLS
-#if __ANDROID_API__ >= 24
-
typedef enum acamera_metadata_section {
ACAMERA_COLOR_CORRECTION,
ACAMERA_CONTROL,
@@ -8993,8 +8991,6 @@
-#endif /* __ANDROID_API__ >= 24 */
-
__END_DECLS
#endif /* _NDK_CAMERA_METADATA_TAGS_H */
diff --git a/camera/ndk/include/camera/NdkCaptureRequest.h b/camera/ndk/include/camera/NdkCaptureRequest.h
index d3f8826..a4dc374 100644
--- a/camera/ndk/include/camera/NdkCaptureRequest.h
+++ b/camera/ndk/include/camera/NdkCaptureRequest.h
@@ -44,8 +44,6 @@
__BEGIN_DECLS
-#if __ANDROID_API__ >= 24
-
// Container for output targets
typedef struct ACameraOutputTargets ACameraOutputTargets;
@@ -304,10 +302,6 @@
*/
void ACaptureRequest_free(ACaptureRequest* request) __INTRODUCED_IN(24);
-#endif /* __ANDROID_API__ >= 24 */
-
-#if __ANDROID_API__ >= 28
-
/**
* Associate an arbitrary user context pointer to the {@link ACaptureRequest}
*
@@ -356,10 +350,6 @@
*/
ACaptureRequest* ACaptureRequest_copy(const ACaptureRequest* src) __INTRODUCED_IN(28);
-#endif /* __ANDROID_API__ >= 28 */
-
-#if __ANDROID_API__ >= 29
-
/**
* Get a metadata entry from input {@link ACaptureRequest} for
* a physical camera backing a logical multi-camera device.
@@ -569,8 +559,6 @@
ACaptureRequest* request, const char* physicalId, uint32_t tag,
uint32_t count, const ACameraMetadata_rational* data) __INTRODUCED_IN(29);
-#endif /* __ANDROID_API__ >= 29 */
-
__END_DECLS
#endif /* _NDK_CAPTURE_REQUEST_H */
diff --git a/media/libaaudio/include/aaudio/AAudio.h b/media/libaaudio/include/aaudio/AAudio.h
index e0ac7e5..709c656 100644
--- a/media/libaaudio/include/aaudio/AAudio.h
+++ b/media/libaaudio/include/aaudio/AAudio.h
@@ -1024,7 +1024,6 @@
// Stream Control
// ============================================================
-#if __ANDROID_API__ >= 30
/**
* Free the audio resources associated with a stream created by
* AAudioStreamBuilder_openStream().
@@ -1042,11 +1041,12 @@
* On other "Legacy" streams some audio resources will still be in use
* and some callbacks may still be in process after this call.
*
+ * Available since API level 30.
+ *
* @param stream reference provided by AAudioStreamBuilder_openStream()
* @return {@link #AAUDIO_OK} or a negative error.
*/
AAUDIO_API aaudio_result_t AAudioStream_release(AAudioStream* stream) __INTRODUCED_IN(30);
-#endif // __ANDROID_API__
/**
* Delete the internal data structures associated with the stream created
@@ -1054,6 +1054,8 @@
*
* If AAudioStream_release() has not been called then it will be called automatically.
*
+ * Available since API level 26.
+ *
* @param stream reference provided by AAudioStreamBuilder_openStream()
* @return {@link #AAUDIO_OK} or a negative error.
*/
diff --git a/media/ndk/include/media/NdkImage.h b/media/ndk/include/media/NdkImage.h
index 62b8624..e19dd3a 100644
--- a/media/ndk/include/media/NdkImage.h
+++ b/media/ndk/include/media/NdkImage.h
@@ -559,8 +559,6 @@
int32_t bottom;
} AImageCropRect;
-#if __ANDROID_API__ >= 24
-
/**
* Return the image back the the system and delete the AImage object from memory.
*
@@ -777,10 +775,6 @@
const AImage* image, int planeIdx,
/*out*/uint8_t** data, /*out*/int* dataLength) __INTRODUCED_IN(24);
-#endif /* __ANDROID_API__ >= 24 */
-
-#if __ANDROID_API__ >= 26
-
/**
* Return the image back the the system and delete the AImage object from memory asynchronously.
*
@@ -829,8 +823,6 @@
*/
media_status_t AImage_getHardwareBuffer(const AImage* image, /*out*/AHardwareBuffer** buffer) __INTRODUCED_IN(26);
-#endif /* __ANDROID_API__ >= 26 */
-
__END_DECLS
#endif //_NDK_IMAGE_H
diff --git a/media/ndk/include/media/NdkImageReader.h b/media/ndk/include/media/NdkImageReader.h
index 600ffc9..d86f3c7 100644
--- a/media/ndk/include/media/NdkImageReader.h
+++ b/media/ndk/include/media/NdkImageReader.h
@@ -53,8 +53,6 @@
*/
typedef struct AImageReader AImageReader;
-#if __ANDROID_API__ >= 24
-
/**
* Create a new reader for images of the desired size and format.
*
@@ -320,10 +318,6 @@
media_status_t AImageReader_setImageListener(
AImageReader* reader, AImageReader_ImageListener* listener) __INTRODUCED_IN(24);
-#endif /* __ANDROID_API__ >= 24 */
-
-#if __ANDROID_API__ >= 26
-
/**
* AImageReader constructor similar to {@link AImageReader_new} that takes an additional parameter
* for the consumer usage. All other parameters and the return values are identical to those passed
@@ -510,8 +504,6 @@
AImageReader *reader, /* out */native_handle_t **handle);
#endif
-#endif /* __ANDROID_API__ >= 26 */
-
__END_DECLS
#endif //_NDK_IMAGE_READER_H
diff --git a/media/ndk/include/media/NdkMediaCodec.h b/media/ndk/include/media/NdkMediaCodec.h
index 80d5d50..60cdd32 100644
--- a/media/ndk/include/media/NdkMediaCodec.h
+++ b/media/ndk/include/media/NdkMediaCodec.h
@@ -121,8 +121,6 @@
AMediaCodecOnAsyncError onAsyncError;
} AMediaCodecOnAsyncNotifyCallback;
-#if __ANDROID_API__ >= 21
-
/**
* Create codec by name. Use this if you know the exact codec you want to use.
* When configuring, you will need to specify whether to use the codec as an
@@ -311,8 +309,6 @@
media_status_t AMediaCodec_releaseOutputBufferAtTime(
AMediaCodec *mData, size_t idx, int64_t timestampNs) __INTRODUCED_IN(21);
-#if __ANDROID_API__ >= 26
-
/**
* Creates a Surface that can be used as the input to encoder, in place of input buffers
*
@@ -393,10 +389,6 @@
*/
media_status_t AMediaCodec_signalEndOfInputStream(AMediaCodec *mData) __INTRODUCED_IN(26);
-#endif /* __ANDROID_API__ >= 26 */
-
-#if __ANDROID_API__ >= 28
-
/**
* Get format of the buffer. The specified buffer index must have been previously obtained from
* dequeueOutputBuffer.
@@ -482,8 +474,6 @@
*/
bool AMediaCodecActionCode_isTransient(int32_t actionCode) __INTRODUCED_IN(28);
-#endif /* __ANDROID_API__ >= 28 */
-
typedef enum {
AMEDIACODECRYPTOINFO_MODE_CLEAR = 0,
AMEDIACODECRYPTOINFO_MODE_AES_CTR = 1,
@@ -580,8 +570,6 @@
*/
media_status_t AMediaCodecCryptoInfo_getEncryptedBytes(AMediaCodecCryptoInfo*, size_t *dst) __INTRODUCED_IN(21);
-#endif /* __ANDROID_API__ >= 21 */
-
__END_DECLS
#endif //_NDK_MEDIA_CODEC_H
diff --git a/media/ndk/include/media/NdkMediaCrypto.h b/media/ndk/include/media/NdkMediaCrypto.h
index 3fa07c7..590d51d 100644
--- a/media/ndk/include/media/NdkMediaCrypto.h
+++ b/media/ndk/include/media/NdkMediaCrypto.h
@@ -47,8 +47,6 @@
typedef uint8_t AMediaUUID[16];
-#if __ANDROID_API__ >= 21
-
/**
* Available since API level 21.
*/
@@ -69,8 +67,6 @@
*/
void AMediaCrypto_delete(AMediaCrypto* crypto) __INTRODUCED_IN(21);
-#endif /* __ANDROID_API__ >= 21 */
-
__END_DECLS
#endif // _NDK_MEDIA_CRYPTO_H
diff --git a/media/ndk/include/media/NdkMediaDataSource.h b/media/ndk/include/media/NdkMediaDataSource.h
index 0577df2..4158a97 100644
--- a/media/ndk/include/media/NdkMediaDataSource.h
+++ b/media/ndk/include/media/NdkMediaDataSource.h
@@ -38,8 +38,6 @@
struct AMediaDataSource;
typedef struct AMediaDataSource AMediaDataSource;
-#if __ANDROID_API__ >= 28
-
/*
* AMediaDataSource's callbacks will be invoked on an implementation-defined thread
* or thread pool. No guarantees are provided about which thread(s) will be used for
@@ -93,8 +91,6 @@
*/
AMediaDataSource* AMediaDataSource_new() __INTRODUCED_IN(28);
-#if __ANDROID_API__ >= 29
-
/**
* Called to get an estimate of the number of bytes that can be read from this data source
* starting at |offset| without blocking for I/O.
@@ -124,8 +120,6 @@
int numheaders,
const char * const *key_values) __INTRODUCED_IN(29);
-#endif /*__ANDROID_API__ >= 29 */
-
/**
* Delete a previously created media data source.
*
@@ -185,10 +179,6 @@
AMediaDataSource*,
AMediaDataSourceClose) __INTRODUCED_IN(28);
-#endif /*__ANDROID_API__ >= 28 */
-
-#if __ANDROID_API__ >= 29
-
/**
* Close the data source, unblock reads, and release associated resources.
*
@@ -213,8 +203,6 @@
AMediaDataSource*,
AMediaDataSourceGetAvailableSize) __INTRODUCED_IN(29);
-#endif /*__ANDROID_API__ >= 29 */
-
__END_DECLS
#endif // _NDK_MEDIA_DATASOURCE_H
diff --git a/media/ndk/include/media/NdkMediaDrm.h b/media/ndk/include/media/NdkMediaDrm.h
index 31f5c7d..849a8f9 100644
--- a/media/ndk/include/media/NdkMediaDrm.h
+++ b/media/ndk/include/media/NdkMediaDrm.h
@@ -165,8 +165,6 @@
const AMediaDrmSessionId *sessionId, const AMediaDrmKeyStatus *keyStatus,
size_t numKeys, bool hasNewUsableKey);
-#if __ANDROID_API__ >= 21
-
/**
* Query if the given scheme identified by its UUID is supported on this device, and
* whether the drm plugin is able to handle the media container format specified by mimeType.
@@ -576,8 +574,6 @@
const char *macAlgorithm, uint8_t *keyId, const uint8_t *message, size_t messageSize,
const uint8_t *signature, size_t signatureSize) __INTRODUCED_IN(21);
-#endif /* __ANDROID_API__ >= 21 */
-
__END_DECLS
#endif //_NDK_MEDIA_DRM_H
diff --git a/media/ndk/include/media/NdkMediaExtractor.h b/media/ndk/include/media/NdkMediaExtractor.h
index a1cd9e3..e429820 100644
--- a/media/ndk/include/media/NdkMediaExtractor.h
+++ b/media/ndk/include/media/NdkMediaExtractor.h
@@ -50,8 +50,6 @@
struct AMediaExtractor;
typedef struct AMediaExtractor AMediaExtractor;
-#if __ANDROID_API__ >= 21
-
/**
* Create new media extractor.
*
@@ -82,8 +80,6 @@
media_status_t AMediaExtractor_setDataSource(AMediaExtractor*,
const char *location) __INTRODUCED_IN(21);
-#if __ANDROID_API__ >= 28
-
/**
* Set the custom data source implementation from which the extractor will read.
*
@@ -92,8 +88,6 @@
media_status_t AMediaExtractor_setDataSourceCustom(AMediaExtractor*,
AMediaDataSource *src) __INTRODUCED_IN(28);
-#endif /* __ANDROID_API__ >= 28 */
-
/**
* Return the number of tracks in the previously specified media file
*
@@ -211,8 +205,6 @@
AMEDIAEXTRACTOR_SAMPLE_FLAG_ENCRYPTED = 2,
};
-#if __ANDROID_API__ >= 28
-
/**
* Returns the format of the extractor. The caller must free the returned format
* using AMediaFormat_delete(format).
@@ -266,10 +258,6 @@
media_status_t AMediaExtractor_getSampleFormat(AMediaExtractor *ex,
AMediaFormat *fmt) __INTRODUCED_IN(28);
-#endif /* __ANDROID_API__ >= 28 */
-
-#endif /* __ANDROID_API__ >= 21 */
-
__END_DECLS
#endif // _NDK_MEDIA_EXTRACTOR_H
diff --git a/media/ndk/include/media/NdkMediaFormat.h b/media/ndk/include/media/NdkMediaFormat.h
index 6371de4..fbc5553 100644
--- a/media/ndk/include/media/NdkMediaFormat.h
+++ b/media/ndk/include/media/NdkMediaFormat.h
@@ -61,8 +61,6 @@
struct AMediaFormat;
typedef struct AMediaFormat AMediaFormat;
-#if __ANDROID_API__ >= 21
-
/**
* Available since API level 21.
*/
@@ -205,9 +203,7 @@
extern const char* AMEDIAFORMAT_KEY_TRACK_ID __INTRODUCED_IN(28);
extern const char* AMEDIAFORMAT_KEY_TRACK_INDEX __INTRODUCED_IN(28);
extern const char* AMEDIAFORMAT_KEY_WIDTH __INTRODUCED_IN(21);
-#endif /* __ANDROID_API__ >= 21 */
-#if __ANDROID_API__ >= 28
/**
* Available since API level 28.
*/
@@ -231,9 +227,7 @@
*/
void AMediaFormat_setRect(AMediaFormat*, const char* name,
int32_t left, int32_t top, int32_t right, int32_t bottom) __INTRODUCED_IN(28);
-#endif /* __ANDROID_API__ >= 28 */
-#if __ANDROID_API__ >= 29
/**
* Remove all key/value pairs from the given AMediaFormat.
*
@@ -307,9 +301,6 @@
extern const char* AMEDIAFORMAT_KEY_VALID_SAMPLES __INTRODUCED_IN(29);
extern const char* AMEDIAFORMAT_KEY_YEAR __INTRODUCED_IN(29);
-#endif /* __ANDROID_API__ >= 29 */
-
-#if __ANDROID_API__ >= 30
/**
* An optional key describing the low latency decoding mode. This is an optional parameter
* that applies only to decoders. If enabled, the decoder doesn't hold input and output
@@ -320,7 +311,6 @@
* Available since API level 30.
*/
extern const char* AMEDIAFORMAT_KEY_LOW_LATENCY __INTRODUCED_IN(30);
-#endif /* __ANDROID_API__ >= 30 */
__END_DECLS
diff --git a/media/ndk/include/media/NdkMediaMuxer.h b/media/ndk/include/media/NdkMediaMuxer.h
index 9de3fbf..519e249 100644
--- a/media/ndk/include/media/NdkMediaMuxer.h
+++ b/media/ndk/include/media/NdkMediaMuxer.h
@@ -54,8 +54,6 @@
AMEDIAMUXER_OUTPUT_FORMAT_THREE_GPP = 2,
} OutputFormat;
-#if __ANDROID_API__ >= 21
-
/**
* Create new media muxer.
*
@@ -140,8 +138,6 @@
size_t trackIdx, const uint8_t *data,
const AMediaCodecBufferInfo *info) __INTRODUCED_IN(21);
-#endif /* __ANDROID_API__ >= 21 */
-
__END_DECLS
#endif // _NDK_MEDIA_MUXER_H