Loading android/app/src/com/android/bluetooth/Utils.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -382,4 +382,13 @@ public final class Utils { throw new IllegalStateException("Not in BluetoothInstrumentationTest"); 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(); } } } android/app/src/com/android/bluetooth/hfp/HeadsetCallState.java +22 −1 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ */ package com.android.bluetooth.hfp; package com.android.bluetooth.hfp; import java.util.Objects; /** /** * A blob of data representing an overall call state on the phone * A blob of data representing an overall call state on the phone */ */ Loading Loading @@ -59,7 +61,7 @@ class HeadsetCallState extends HeadsetMessageObject { .append(mNumActive) .append(mNumActive) .append(", numHeld=") .append(", numHeld=") .append(mNumHeld) .append(mNumHeld) .append(", callState") .append(", callState=") .append(mCallState) .append(mCallState) .append(", number="); .append(", number="); if (mNumber == null) { if (mNumber == null) { Loading @@ -69,4 +71,23 @@ class HeadsetCallState extends HeadsetMessageObject { } } builder.append(mNumber).append(", type=").append(mType).append("]"); 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); } } } android/app/src/com/android/bluetooth/hfp/HeadsetPhoneState.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -192,7 +192,8 @@ public class HeadsetPhoneState { return mNumActive; return mNumActive; } } void setNumActiveCall(int numActive) { @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public void setNumActiveCall(int numActive) { mNumActive = numActive; mNumActive = numActive; } } Loading @@ -200,7 +201,8 @@ public class HeadsetPhoneState { return mCallState; return mCallState; } } void setCallState(int callState) { @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public void setCallState(int callState) { mCallState = callState; mCallState = callState; } } Loading @@ -208,7 +210,8 @@ public class HeadsetPhoneState { return mNumHeld; return mNumHeld; } } void setNumHeldCall(int numHeldCall) { @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public void setNumHeldCall(int numHeldCall) { mNumHeld = numHeldCall; mNumHeld = numHeldCall; } } Loading @@ -225,6 +228,7 @@ public class HeadsetPhoneState { * * * @param batteryLevel battery level value * @param batteryLevel battery level value */ */ @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public void setCindBatteryCharge(int batteryLevel) { public void setCindBatteryCharge(int batteryLevel) { if (mCindBatteryCharge != batteryLevel) { if (mCindBatteryCharge != batteryLevel) { mCindBatteryCharge = batteryLevel; mCindBatteryCharge = batteryLevel; Loading Loading
android/app/src/com/android/bluetooth/Utils.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -382,4 +382,13 @@ public final class Utils { throw new IllegalStateException("Not in BluetoothInstrumentationTest"); 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(); } } }
android/app/src/com/android/bluetooth/hfp/HeadsetCallState.java +22 −1 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ */ package com.android.bluetooth.hfp; package com.android.bluetooth.hfp; import java.util.Objects; /** /** * A blob of data representing an overall call state on the phone * A blob of data representing an overall call state on the phone */ */ Loading Loading @@ -59,7 +61,7 @@ class HeadsetCallState extends HeadsetMessageObject { .append(mNumActive) .append(mNumActive) .append(", numHeld=") .append(", numHeld=") .append(mNumHeld) .append(mNumHeld) .append(", callState") .append(", callState=") .append(mCallState) .append(mCallState) .append(", number="); .append(", number="); if (mNumber == null) { if (mNumber == null) { Loading @@ -69,4 +71,23 @@ class HeadsetCallState extends HeadsetMessageObject { } } builder.append(mNumber).append(", type=").append(mType).append("]"); 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); } } }
android/app/src/com/android/bluetooth/hfp/HeadsetPhoneState.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -192,7 +192,8 @@ public class HeadsetPhoneState { return mNumActive; return mNumActive; } } void setNumActiveCall(int numActive) { @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public void setNumActiveCall(int numActive) { mNumActive = numActive; mNumActive = numActive; } } Loading @@ -200,7 +201,8 @@ public class HeadsetPhoneState { return mCallState; return mCallState; } } void setCallState(int callState) { @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public void setCallState(int callState) { mCallState = callState; mCallState = callState; } } Loading @@ -208,7 +210,8 @@ public class HeadsetPhoneState { return mNumHeld; return mNumHeld; } } void setNumHeldCall(int numHeldCall) { @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public void setNumHeldCall(int numHeldCall) { mNumHeld = numHeldCall; mNumHeld = numHeldCall; } } Loading @@ -225,6 +228,7 @@ public class HeadsetPhoneState { * * * @param batteryLevel battery level value * @param batteryLevel battery level value */ */ @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public void setCindBatteryCharge(int batteryLevel) { public void setCindBatteryCharge(int batteryLevel) { if (mCindBatteryCharge != batteryLevel) { if (mCindBatteryCharge != batteryLevel) { mCindBatteryCharge = batteryLevel; mCindBatteryCharge = batteryLevel; Loading