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

Commit 822acc9e authored by Matt Buckley's avatar Matt Buckley
Browse files

Update documentation on "borrowSessionFromJava"

Update the "APerformanceHint_borrowSessionFromJava" documentation
to specify the lifetime of the returned pointer (it lives until the
Java wrapper dies)

Test: n/a
Bug: 380300424
Flag: EXEMPT NDK
Change-Id: I90c74893cdc6febf49cfde5eaa6a88d796660779
parent 921e6125
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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.