Loading include/android/performance_hint.h +41 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,36 @@ typedef struct APerformanceHintManager APerformanceHintManager; */ typedef struct APerformanceHintSession APerformanceHintSession; /** * Hints for the session used by {@link APerformanceHint_sendHint} to signal upcoming changes * in the mode or workload. */ enum SessionHint { /** * This hint indicates a sudden increase in CPU workload intensity. It means * that this hint session needs extra CPU resources immediately to meet the * target duration for the current work cycle. */ CPU_LOAD_UP = 0, /** * This hint indicates a decrease in CPU workload intensity. It means that * this hint session can reduce CPU resources and still meet the target duration. */ CPU_LOAD_DOWN = 1, /* * This hint indicates an upcoming CPU workload that is completely changed and * unknown. It means that the hint session should reset CPU resources to a known * baseline to prepare for an arbitrary load, and must wake up if inactive. */ CPU_LOAD_RESET = 2, /* * This hint indicates that the most recent CPU workload is resuming after a * period of inactivity. It means that the hint session should allocate similar * CPU resources to what was used previously, and must wake up if inactive. */ CPU_LOAD_RESUME = 3, }; /** * Acquire an instance of the performance hint manager. * Loading Loading @@ -159,6 +189,17 @@ int APerformanceHint_reportActualWorkDuration( void APerformanceHint_closeSession( APerformanceHintSession* session) __INTRODUCED_IN(__ANDROID_API_T__); /** * Sends performance hints to inform the hint session of changes in the workload. * * @param session The performance hint session instance to update. * @param hint The hint to send to the session. * @return 0 on success * EPIPE if communication with the system service has failed. */ int APerformanceHint_sendHint( APerformanceHintSession* session, int hint) __INTRODUCED_IN(__ANDROID_API_U__); __END_DECLS #endif // ANDROID_NATIVE_PERFORMANCE_HINT_H services/powermanager/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ cc_library_shared { "android.hardware.power@1.1", "android.hardware.power@1.2", "android.hardware.power@1.3", "android.hardware.power-V3-cpp", "android.hardware.power-V4-cpp", ], cflags: [ Loading services/powermanager/benchmarks/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ cc_benchmark { "android.hardware.power@1.1", "android.hardware.power@1.2", "android.hardware.power@1.3", "android.hardware.power-V3-cpp", "android.hardware.power-V4-cpp", ], static_libs: [ "libtestUtil", Loading services/powermanager/tests/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ cc_test { "android.hardware.power@1.1", "android.hardware.power@1.2", "android.hardware.power@1.3", "android.hardware.power-V3-cpp", "android.hardware.power-V4-cpp", ], static_libs: [ "libgmock", Loading Loading
include/android/performance_hint.h +41 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,36 @@ typedef struct APerformanceHintManager APerformanceHintManager; */ typedef struct APerformanceHintSession APerformanceHintSession; /** * Hints for the session used by {@link APerformanceHint_sendHint} to signal upcoming changes * in the mode or workload. */ enum SessionHint { /** * This hint indicates a sudden increase in CPU workload intensity. It means * that this hint session needs extra CPU resources immediately to meet the * target duration for the current work cycle. */ CPU_LOAD_UP = 0, /** * This hint indicates a decrease in CPU workload intensity. It means that * this hint session can reduce CPU resources and still meet the target duration. */ CPU_LOAD_DOWN = 1, /* * This hint indicates an upcoming CPU workload that is completely changed and * unknown. It means that the hint session should reset CPU resources to a known * baseline to prepare for an arbitrary load, and must wake up if inactive. */ CPU_LOAD_RESET = 2, /* * This hint indicates that the most recent CPU workload is resuming after a * period of inactivity. It means that the hint session should allocate similar * CPU resources to what was used previously, and must wake up if inactive. */ CPU_LOAD_RESUME = 3, }; /** * Acquire an instance of the performance hint manager. * Loading Loading @@ -159,6 +189,17 @@ int APerformanceHint_reportActualWorkDuration( void APerformanceHint_closeSession( APerformanceHintSession* session) __INTRODUCED_IN(__ANDROID_API_T__); /** * Sends performance hints to inform the hint session of changes in the workload. * * @param session The performance hint session instance to update. * @param hint The hint to send to the session. * @return 0 on success * EPIPE if communication with the system service has failed. */ int APerformanceHint_sendHint( APerformanceHintSession* session, int hint) __INTRODUCED_IN(__ANDROID_API_U__); __END_DECLS #endif // ANDROID_NATIVE_PERFORMANCE_HINT_H
services/powermanager/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ cc_library_shared { "android.hardware.power@1.1", "android.hardware.power@1.2", "android.hardware.power@1.3", "android.hardware.power-V3-cpp", "android.hardware.power-V4-cpp", ], cflags: [ Loading
services/powermanager/benchmarks/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ cc_benchmark { "android.hardware.power@1.1", "android.hardware.power@1.2", "android.hardware.power@1.3", "android.hardware.power-V3-cpp", "android.hardware.power-V4-cpp", ], static_libs: [ "libtestUtil", Loading
services/powermanager/tests/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ cc_test { "android.hardware.power@1.1", "android.hardware.power@1.2", "android.hardware.power@1.3", "android.hardware.power-V3-cpp", "android.hardware.power-V4-cpp", ], static_libs: [ "libgmock", Loading