summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java
diff options
context:
space:
mode:
authorJoseph Pirozzo <pirozzoj@google.com>2018-01-03 08:59:57 -0800
committerJoseph Pirozzo <pirozzoj@google.com>2018-01-11 14:09:25 -0800
commit4a50680fe838d0b1b2390833ff0661427ef9c8d6 (patch)
tree2b6f3bb5a9ea1beef9436d6520d6f7a826e87716 /framework/java/android/bluetooth/BluetoothHeadsetClientCall.java
parenta3fb7fd95e3814371411c60fc4fc966c62417725 (diff)
Bluetooth in band ring
Add a flag to the BluetoothHeadsetClientCall indicating the current status of in band ring on the connected phone. Bug: 65673832 Test: runtest bluetooth -c com.android.bluetooth.hfpclient.HeadsetClientStateMachineTest Change-Id: I7e839f2790b1a27d336528e93bc8a4c8d8ff3036 (cherry picked from commit f780364a9a1f6171860cbdf4e1b41a01ee7d88c6)
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothHeadsetClientCall.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothHeadsetClientCall.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java b/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java
index dc00d63043..d46b2e3746 100644
--- a/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java
+++ b/framework/java/android/bluetooth/BluetoothHeadsetClientCall.java
@@ -73,17 +73,18 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
private final boolean mOutgoing;
private final UUID mUUID;
private final long mCreationElapsedMilli;
+ private final boolean mInBandRing;
/**
* Creates BluetoothHeadsetClientCall instance.
*/
public BluetoothHeadsetClientCall(BluetoothDevice device, int id, int state, String number,
- boolean multiParty, boolean outgoing) {
- this(device, id, UUID.randomUUID(), state, number, multiParty, outgoing);
+ boolean multiParty, boolean outgoing, boolean inBandRing) {
+ this(device, id, UUID.randomUUID(), state, number, multiParty, outgoing, inBandRing);
}
public BluetoothHeadsetClientCall(BluetoothDevice device, int id, UUID uuid, int state,
- String number, boolean multiParty, boolean outgoing) {
+ String number, boolean multiParty, boolean outgoing, boolean inBandRing) {
mDevice = device;
mId = id;
mUUID = uuid;
@@ -91,6 +92,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
mNumber = number != null ? number : "";
mMultiParty = multiParty;
mOutgoing = outgoing;
+ mInBandRing = inBandRing;
mCreationElapsedMilli = SystemClock.elapsedRealtime();
}
@@ -200,6 +202,16 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
return mOutgoing;
}
+ /**
+ * Checks if the ringtone will be generated by the connected phone
+ *
+ * @return <code>true</code> if in band ring is enabled, <code>false</code> otherwise.
+ */
+ public boolean isInBandRing() {
+ return mInBandRing;
+ }
+
+
@Override
public String toString() {
return toString(false);
@@ -253,6 +265,8 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
builder.append(mMultiParty);
builder.append(", mOutgoing: ");
builder.append(mOutgoing);
+ builder.append(", mInBandRing: ");
+ builder.append(mInBandRing);
builder.append("}");
return builder.toString();
}
@@ -266,7 +280,8 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
public BluetoothHeadsetClientCall createFromParcel(Parcel in) {
return new BluetoothHeadsetClientCall((BluetoothDevice) in.readParcelable(null),
in.readInt(), UUID.fromString(in.readString()), in.readInt(),
- in.readString(), in.readInt() == 1, in.readInt() == 1);
+ in.readString(), in.readInt() == 1, in.readInt() == 1,
+ in.readInt() == 1);
}
@Override
@@ -284,6 +299,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
out.writeString(mNumber);
out.writeInt(mMultiParty ? 1 : 0);
out.writeInt(mOutgoing ? 1 : 0);
+ out.writeInt(mInBandRing ? 1 : 0);
}
@Override