summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/android/looper.h10
-rw-r--r--include/android/performance_hint.h9
-rw-r--r--include/android/system_health.h48
3 files changed, 35 insertions, 32 deletions
diff --git a/include/android/looper.h b/include/android/looper.h
index 8cf13965bb..409db848f8 100644
--- a/include/android/looper.h
+++ b/include/android/looper.h
@@ -106,7 +106,7 @@ enum {
/**
* Result from ALooper_pollOnce() and ALooper_pollAll():
* An error occurred. The poll may also have been explicitly woken by
- * ALooper_wake(()).
+ * ALooper_wake().
*/
ALOOPER_POLL_ERROR = -4,
};
@@ -224,11 +224,11 @@ int ALooper_pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outDa
* hidden and callers should migrate to ALooper_pollOnce. Binary compatibility
* is preserved to support already-compiled apps.
*
- * \bug ALooper_pollAll will not wake in response to ALooper_wake calls if it
+ * \bug ALooper_pollAll() will not wake in response to ALooper_wake() calls if it
* also handles another event at the same time.
*
- * \deprecated Calls to ALooper_pollAll should be replaced with
- * ALooper_pollOnce. If you call ALooper_pollOnce in a loop, you *must* treat
+ * \deprecated Calls to ALooper_pollAll() should be replaced with
+ * ALooper_pollOnce(). If you call ALooper_pollOnce() in a loop, you *must* treat
* all return values as if they also indicate ALOOPER_POLL_WAKE.
*/
int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData)
@@ -242,7 +242,7 @@ int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outDat
* This method can be called on any thread.
* This method returns immediately.
*
- * \bug ALooper_pollAll will not reliably wake in response to ALooper_wake.
+ * \bug ALooper_pollAll() will not reliably wake in response to ALooper_wake().
*/
void ALooper_wake(ALooper* looper);
diff --git a/include/android/performance_hint.h b/include/android/performance_hint.h
index 2b4a5f5f53..9ea6549e8a 100644
--- a/include/android/performance_hint.h
+++ b/include/android/performance_hint.h
@@ -478,8 +478,13 @@ void AWorkDuration_setActualGpuDurationNanos(AWorkDuration* _Nonnull aWorkDurati
/**
* Return the APerformanceHintSession wrapped by a Java PerformanceHintManager.Session object.
*
- * The Java session maintains ownership over the wrapped native session, so it cannot be
- * closed using {@link APerformanceHint_closeSession}.
+ * The Java session maintains ownership over the wrapped native session, so it cannot be closed
+ * using {@link APerformanceHint_closeSession}. The return value is valid until the Java object
+ * containing this value dies.
+ *
+ * The returned pointer is intended to be used by JNI calls to access native performance APIs using
+ * a Java hint session wrapper, and then immediately discarded. Using the pointer after the death of
+ * the Java container results in undefined behavior.
*
* @param env The Java environment where the PerformanceHintManager.Session lives.
* @param sessionObj The Java Session to unwrap.
diff --git a/include/android/system_health.h b/include/android/system_health.h
index 69620df16e..352eb72b0c 100644
--- a/include/android/system_health.h
+++ b/include/android/system_health.h
@@ -81,10 +81,10 @@ typedef struct AGpuHeadroomParams AGpuHeadroomParams;
*
* @return A new instance of ACpuHeadroomParams.
*/
-ACpuHeadroomParams *_Nonnull ACpuHeadroomParams_create()
+ACpuHeadroomParams* _Nonnull ACpuHeadroomParams_create(void)
__INTRODUCED_IN(36);
-enum ACpuHeadroomCalculationType {
+typedef enum ACpuHeadroomCalculationType : int32_t {
/**
* Use the minimum headroom value within the calculation window.
* Introduced in API level 36.
@@ -95,10 +95,9 @@ enum ACpuHeadroomCalculationType {
* Introduced in API level 36.
*/
ACPU_HEADROOM_CALCULATION_TYPE_AVERAGE = 1,
-};
-typedef enum ACpuHeadroomCalculationType ACpuHeadroomCalculationType;
+} ACpuHeadroomCalculationType;
-enum AGpuHeadroomCalculationType {
+typedef enum AGpuHeadroomCalculationType : int32_t {
/**
* Use the minimum headroom value within the calculation window.
* Introduced in API level 36.
@@ -109,8 +108,7 @@ enum AGpuHeadroomCalculationType {
* Introduced in API level 36.
*/
AGPU_HEADROOM_CALCULATION_TYPE_AVERAGE = 1,
-};
-typedef enum AGpuHeadroomCalculationType AGpuHeadroomCalculationType;
+} AGpuHeadroomCalculationType;
/**
* Sets the headroom calculation window size in ACpuHeadroomParams.
@@ -124,7 +122,7 @@ typedef enum AGpuHeadroomCalculationType AGpuHeadroomCalculationType;
* {@link #ACpuHeadroomParams_getCalculationWindowMillis} if not set. The device
* will try to use the closest feasible window size to this param.
*/
-void ACpuHeadroomParams_setCalculationWindowMillis(ACpuHeadroomParams *_Nonnull params,
+void ACpuHeadroomParams_setCalculationWindowMillis(ACpuHeadroomParams* _Nonnull params,
int windowMillis)
__INTRODUCED_IN(36);
@@ -136,7 +134,7 @@ __INTRODUCED_IN(36);
* @param params The params to be set.
* @return This will return the default value chosen by the device if the params is not set.
*/
-int ACpuHeadroomParams_getCalculationWindowMillis(ACpuHeadroomParams *_Nonnull params)
+int ACpuHeadroomParams_getCalculationWindowMillis(ACpuHeadroomParams* _Nonnull params)
__INTRODUCED_IN(36);
/**
@@ -151,7 +149,7 @@ __INTRODUCED_IN(36);
* {@link #AGpuHeadroomParams_getCalculationWindowMillis} if not set. The device
* will try to use the closest feasible window size to this param.
*/
-void AGpuHeadroomParams_setCalculationWindowMillis(AGpuHeadroomParams *_Nonnull params,
+void AGpuHeadroomParams_setCalculationWindowMillis(AGpuHeadroomParams* _Nonnull params,
int windowMillis)
__INTRODUCED_IN(36);
@@ -163,7 +161,7 @@ __INTRODUCED_IN(36);
* @param params The params to be set.
* @return This will return the default value chosen by the device if the params is not set.
*/
-int AGpuHeadroomParams_getCalculationWindowMillis(AGpuHeadroomParams *_Nonnull params)
+int AGpuHeadroomParams_getCalculationWindowMillis(AGpuHeadroomParams* _Nonnull params)
__INTRODUCED_IN(36);
/**
@@ -174,7 +172,7 @@ __INTRODUCED_IN(36);
* @param params The params to be set.
* @param calculationType The headroom calculation type.
*/
-void ACpuHeadroomParams_setCalculationType(ACpuHeadroomParams *_Nonnull params,
+void ACpuHeadroomParams_setCalculationType(ACpuHeadroomParams* _Nonnull params,
ACpuHeadroomCalculationType calculationType)
__INTRODUCED_IN(36);
@@ -187,7 +185,7 @@ __INTRODUCED_IN(36);
* @return The headroom calculation type.
*/
ACpuHeadroomCalculationType
-ACpuHeadroomParams_getCalculationType(ACpuHeadroomParams *_Nonnull params)
+ACpuHeadroomParams_getCalculationType(ACpuHeadroomParams* _Nonnull params)
__INTRODUCED_IN(36);
/**
@@ -198,7 +196,7 @@ __INTRODUCED_IN(36);
* @param params The params to be set.
* @param calculationType The headroom calculation type.
*/
-void AGpuHeadroomParams_setCalculationType(AGpuHeadroomParams *_Nonnull params,
+void AGpuHeadroomParams_setCalculationType(AGpuHeadroomParams* _Nonnull params,
AGpuHeadroomCalculationType calculationType)
__INTRODUCED_IN(36);
@@ -211,7 +209,7 @@ __INTRODUCED_IN(36);
* @return The headroom calculation type.
*/
AGpuHeadroomCalculationType
-AGpuHeadroomParams_getCalculationType(AGpuHeadroomParams *_Nonnull params)
+AGpuHeadroomParams_getCalculationType(AGpuHeadroomParams* _Nonnull params)
__INTRODUCED_IN(36);
/**
@@ -223,7 +221,7 @@ __INTRODUCED_IN(36);
* @param tids Non-null array of TIDs, maximum 5.
* @param tidsSize The size of the tids array.
*/
-void ACpuHeadroomParams_setTids(ACpuHeadroomParams *_Nonnull params, const int *_Nonnull tids,
+void ACpuHeadroomParams_setTids(ACpuHeadroomParams* _Nonnull params, const int* _Nonnull tids,
int tidsSize)
__INTRODUCED_IN(36);
@@ -238,7 +236,7 @@ __INTRODUCED_IN(36);
*
* @return A new instance of AGpuHeadroomParams.
*/
-AGpuHeadroomParams *_Nonnull AGpuHeadroomParams_create()
+AGpuHeadroomParams* _Nonnull AGpuHeadroomParams_create(void)
__INTRODUCED_IN(36);
/**
@@ -248,7 +246,7 @@ __INTRODUCED_IN(36);
*
* @param params The params to be deleted.
*/
-void ACpuHeadroomParams_destroy(ACpuHeadroomParams *_Nonnull params)
+void ACpuHeadroomParams_destroy(ACpuHeadroomParams* _Nonnull params)
__INTRODUCED_IN(36);
/**
@@ -258,7 +256,7 @@ __INTRODUCED_IN(36);
*
* @param params The params to be deleted.
*/
-void AGpuHeadroomParams_destroy(AGpuHeadroomParams *_Nonnull params)
+void AGpuHeadroomParams_destroy(AGpuHeadroomParams* _Nonnull params)
__INTRODUCED_IN(36);
/**
@@ -282,8 +280,8 @@ __INTRODUCED_IN(36);
* EPERM if the TIDs do not belong to the same process.
* ENOTSUP if API or requested params is unsupported.
*/
-int ASystemHealth_getCpuHeadroom(const ACpuHeadroomParams *_Nullable params,
- float *_Nonnull outHeadroom)
+int ASystemHealth_getCpuHeadroom(const ACpuHeadroomParams* _Nullable params,
+ float* _Nonnull outHeadroom)
__INTRODUCED_IN(36);
/**
@@ -306,8 +304,8 @@ __INTRODUCED_IN(36);
* EPIPE if failed to get the GPU headroom.
* ENOTSUP if API or requested params is unsupported.
*/
-int ASystemHealth_getGpuHeadroom(const AGpuHeadroomParams *_Nullable params,
- float *_Nonnull outHeadroom)
+int ASystemHealth_getGpuHeadroom(const AGpuHeadroomParams* _Nullable params,
+ float* _Nonnull outHeadroom)
__INTRODUCED_IN(36);
/**
@@ -323,7 +321,7 @@ __INTRODUCED_IN(36);
* EPIPE if failed to get the minimum polling interval.
* ENOTSUP if API is unsupported.
*/
-int ASystemHealth_getCpuHeadroomMinIntervalMillis(int64_t *_Nonnull outMinIntervalMillis)
+int ASystemHealth_getCpuHeadroomMinIntervalMillis(int64_t* _Nonnull outMinIntervalMillis)
__INTRODUCED_IN(36);
/**
@@ -339,7 +337,7 @@ __INTRODUCED_IN(36);
* EPIPE if failed to get the minimum polling interval.
* ENOTSUP if API is unsupported.
*/
-int ASystemHealth_getGpuHeadroomMinIntervalMillis(int64_t *_Nonnull outMinIntervalMillis)
+int ASystemHealth_getGpuHeadroomMinIntervalMillis(int64_t* _Nonnull outMinIntervalMillis)
__INTRODUCED_IN(36);
#ifdef __cplusplus