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

Commit 132c50ea authored by Amy Zhang's avatar Amy Zhang Committed by Android (Google) Code Review
Browse files

Merge "Allow Tuner to update client priority without override the default priority"

parents c8c707c1 fc174636
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -454,10 +454,12 @@ public class Tuner implements AutoCloseable {
     *
     * <p>Tuner resource manager (TRM) uses the client priority value to decide whether it is able
     * to reclaim insufficient resources from another client.
     *
     * <p>The nice value represents how much the client intends to give up the resource when an
     * insufficient resource situation happens.
     *
     * @param priority the new priority.
     * @param priority the new priority. Any negative value would cause no-op on priority setting
     *                 and the API would only process nice value setting in that case.
     * @param niceValue the nice value.
     */
    public void updateResourcePriority(int priority, int niceValue) {
+3 −0
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@ public final class ClientProfile {
    }

    public void setPriority(int priority) {
        if (priority < 0) {
            return;
        }
        mPriority = priority;
    }

+8 −0
Original line number Diff line number Diff line
@@ -815,6 +815,14 @@ public class TunerResourceManagerServiceTest {
                shareClientId1[0],
                400/*priority*/,
                0/*niceValue*/);
        mTunerResourceManagerService.updateClientPriorityInternal(
                shareClientId1[0],
                -1/*invalid priority*/,
                0/*niceValue*/);
        assertThat(mTunerResourceManagerService
                .getClientProfile(shareClientId1[0])
                .getPriority())
                .isEqualTo(400);

        /**** Init Frontend Resources ****/