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

Commit c59b54ca authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Set the AVRCP absolute volume control initial volume to 50% for all devices"

parents 2ce04d33 b8cff95f
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -58,11 +58,15 @@

    <bool name="headset_client_initial_audio_route_allowed">true</bool>

    <!-- For AVRCP absolute volume feature. If the threshold is non-zero,
         restrict the initial volume to the threshold.
         Valid value is 1-14, and recommended value is 8 -->
    <!-- @deprecated: use a2dp_absolute_volume_initial_threshold_percent
         instead. -->
    <integer name="a2dp_absolute_volume_initial_threshold">8</integer>

    <!-- AVRCP absolute volume initial value as percent of the maximum value.
         Valid values are in the interval [0, 100].
         Recommended value is 50. -->
    <integer name="a2dp_absolute_volume_initial_threshold_percent">50</integer>

    <!-- For A2DP sink ducking volume feature. -->
    <integer name="a2dp_sink_duck_percent">25</integer>

+7 −0
Original line number Diff line number Diff line
@@ -279,6 +279,13 @@ public final class Avrcp {
        Resources resources = context.getResources();
        if (resources != null) {
            mAbsVolThreshold = resources.getInteger(R.integer.a2dp_absolute_volume_initial_threshold);

            // Update the threshold if the threshold_percent is valid
            int threshold_percent =
                    resources.getInteger(R.integer.a2dp_absolute_volume_initial_threshold_percent);
            if (threshold_percent >= 0 && threshold_percent <= 100) {
                mAbsVolThreshold = (threshold_percent * mAudioStreamMax) / 100;
            }
        }

        // Register for package removal intent broadcasts for media button receiver persistence