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

Commit 5a7bd55f authored by android-build-prod (mdb)'s avatar android-build-prod (mdb) Committed by Gerrit Code Review
Browse files

Merge "HFP: Fix phone state change in Telecom and VoIP calls"

parents 4908d5b9 0fe02ad0
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -382,4 +382,13 @@ public final class Utils {
            throw new IllegalStateException("Not in BluetoothInstrumentationTest");
        }
    }

    /**
     * Get uid/pid string in a binder call
     *
     * @return "uid/pid=xxxx/yyyy"
     */
    public static String getUidPidString() {
        return "uid/pid=" + Binder.getCallingUid() + "/" + Binder.getCallingPid();
    }
}
+22 −1
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package com.android.bluetooth.hfp;

import java.util.Objects;

/**
 * A blob of data representing an overall call state on the phone
 */
@@ -59,7 +61,7 @@ class HeadsetCallState extends HeadsetMessageObject {
                .append(mNumActive)
                .append(", numHeld=")
                .append(mNumHeld)
                .append(", callState")
                .append(", callState=")
                .append(mCallState)
                .append(", number=");
        if (mNumber == null) {
@@ -69,4 +71,23 @@ class HeadsetCallState extends HeadsetMessageObject {
        }
        builder.append(mNumber).append(", type=").append(mType).append("]");
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (!(object instanceof HeadsetCallState)) {
            return false;
        }
        HeadsetCallState that = (HeadsetCallState) object;
        return mNumActive == that.mNumActive && mNumHeld == that.mNumHeld
                && mCallState == that.mCallState && Objects.equals(mNumber, that.mNumber)
                && mType == that.mType;
    }

    @Override
    public int hashCode() {
        return Objects.hash(mNumActive, mNumHeld, mCallState, mNumber, mType);
    }
}
+7 −3
Original line number Diff line number Diff line
@@ -192,7 +192,8 @@ public class HeadsetPhoneState {
        return mNumActive;
    }

    void setNumActiveCall(int numActive) {
    @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
    public void setNumActiveCall(int numActive) {
        mNumActive = numActive;
    }

@@ -200,7 +201,8 @@ public class HeadsetPhoneState {
        return mCallState;
    }

    void setCallState(int callState) {
    @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
    public void setCallState(int callState) {
        mCallState = callState;
    }

@@ -208,7 +210,8 @@ public class HeadsetPhoneState {
        return mNumHeld;
    }

    void setNumHeldCall(int numHeldCall) {
    @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
    public void setNumHeldCall(int numHeldCall) {
        mNumHeld = numHeldCall;
    }

@@ -225,6 +228,7 @@ public class HeadsetPhoneState {
     *
     * @param batteryLevel battery level value
     */
    @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
    public void setCindBatteryCharge(int batteryLevel) {
        if (mCindBatteryCharge != batteryLevel) {
            mCindBatteryCharge = batteryLevel;
+297 −75

File changed.

Preview size limit exceeded, changes collapsed.

+68 −239

File changed.

Preview size limit exceeded, changes collapsed.

Loading