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

Commit 479f86d9 authored by Liejun Tao's avatar Liejun Tao Committed by Andre Eisenbach
Browse files

Absolute volume: Black list device if remote can't change volume

If remote device failed to change volume too many times, black list it
to avoid using Absolute volume feature.

Bug: 26694114
Change-Id: Idb7a772b0ef936b2351bfc92722ec3c0d748822c
parent 36cd4ed2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ public final class Avrcp {
    private static final int SKIP_DOUBLE_INTERVAL = 3000;
    private static final long MAX_MULTIPLIER_VALUE = 128L;
    private static final int CMD_TIMEOUT_DELAY = 2000;
    private static final int MAX_ERROR_RETRY_TIMES = 3;
    private static final int MAX_ERROR_RETRY_TIMES = 6;
    private static final int AVRCP_MAX_VOL = 127;
    private static final int AVRCP_BASE_VOLUME_STEP = 1;

@@ -532,6 +532,8 @@ public final class Avrcp {
                mVolCmdSetInProgress = false;
                if (mAbsVolRetryTimes >= MAX_ERROR_RETRY_TIMES) {
                    mAbsVolRetryTimes = 0;
                    /* too many volume change failures, black list the device */
                    blackListCurrentDevice();
                } else {
                    mAbsVolRetryTimes += 1;
                    if (setVolumeNative(mLastRemoteVolume)) {