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

Commit 65254c0f authored by Matt Buckley's avatar Matt Buckley
Browse files

Update performance_hint to follow NDK API guidance

This patch updates the performance_hint NDK in response to API guidance,
and updates the tests accordingly.

Additionally, this patch updates the documentation and ergonomics of a
few related methods to better accomodate these changes, and to downgrade
going over the graphics pipeline limit from a breakage to a very severe
warning.

Flag: EXEMPT NDK
Test: atest
cts/tests/tests/os/src/android/os/cts/PerformanceHintManagerTest.java
Test: atest PerformanceHintNativeTestCases
Test: atest HintManagerServiceTest
Bug: 380299912
Bug: 381269529

Change-Id: I31f1c1db4ee4846a8aca63243f61ac1672aac309
parent a484d236
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -39,12 +39,18 @@ interface IHintManager {
     * Throws UnsupportedOperationException if ADPF is not supported, and IllegalStateException
     * if creation is supported but fails.
     */
    IHintSession createHintSessionWithConfig(in IBinder token, in SessionTag tag,
    SessionCreationReturn createHintSessionWithConfig(in IBinder token, in SessionTag tag,
            in SessionCreationConfig creationConfig, out SessionConfig config);

    void setHintSessionThreads(in IHintSession hintSession, in int[] tids);
    int[] getHintSessionThreadIds(in IHintSession hintSession);

    parcelable SessionCreationReturn {
        IHintSession session;
        // True if the graphics pipeline thread limit is being exceeded
        boolean pipelineThreadLimitExceeded = false;
    }

    /**
     * Returns FMQ channel information for the caller, which it associates to a binder token.
     *
+1 −1
Original line number Diff line number Diff line
@@ -396,6 +396,7 @@ LIBANDROID {
    APerformanceHint_notifyWorkloadSpike; # introduced=36
    APerformanceHint_borrowSessionFromJava; # introduced=36
    APerformanceHint_setNativeSurfaces; # introduced=36
    APerformanceHint_isFeatureSupported; # introduced=36
    AWorkDuration_create; # introduced=VanillaIceCream
    AWorkDuration_release; # introduced=VanillaIceCream
    AWorkDuration_setWorkPeriodStartTimestampNanos; # introduced=VanillaIceCream
@@ -419,7 +420,6 @@ LIBANDROID_PLATFORM {
    AThermal_setIThermalServiceForTesting;
    APerformanceHint_setIHintManagerForTesting;
    APerformanceHint_sendHint;
    APerformanceHint_setUseGraphicsPipelineForTesting;
    APerformanceHint_getThreadIds;
    APerformanceHint_createSessionInternal;
    APerformanceHint_createSessionUsingConfigInternal;
Loading