Merge "Add UUID to BluetoothHeadsetClientCall" into cw-e-dev
This commit is contained in:
@@ -19,6 +19,8 @@ package android.bluetooth;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a single call, its state and properties.
|
* This class represents a single call, its state and properties.
|
||||||
* It implements {@link Parcelable} for inter-process message passing.
|
* It implements {@link Parcelable} for inter-process message passing.
|
||||||
@@ -67,14 +69,21 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
|
|||||||
private String mNumber;
|
private String mNumber;
|
||||||
private boolean mMultiParty;
|
private boolean mMultiParty;
|
||||||
private final boolean mOutgoing;
|
private final boolean mOutgoing;
|
||||||
|
private final UUID mUUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates BluetoothHeadsetClientCall instance.
|
* Creates BluetoothHeadsetClientCall instance.
|
||||||
*/
|
*/
|
||||||
public BluetoothHeadsetClientCall(BluetoothDevice device, int id, int state, String number,
|
public BluetoothHeadsetClientCall(BluetoothDevice device, int id, int state, String number,
|
||||||
boolean multiParty, boolean outgoing) {
|
boolean multiParty, boolean outgoing) {
|
||||||
|
this(device, id, UUID.randomUUID(), state, number, multiParty, outgoing);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BluetoothHeadsetClientCall(BluetoothDevice device, int id, UUID uuid, int state,
|
||||||
|
String number, boolean multiParty, boolean outgoing) {
|
||||||
mDevice = device;
|
mDevice = device;
|
||||||
mId = id;
|
mId = id;
|
||||||
|
mUUID = uuid;
|
||||||
mState = state;
|
mState = state;
|
||||||
mNumber = number != null ? number : "";
|
mNumber = number != null ? number : "";
|
||||||
mMultiParty = multiParty;
|
mMultiParty = multiParty;
|
||||||
@@ -133,6 +142,16 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
|
|||||||
return mId;
|
return mId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets call's UUID.
|
||||||
|
*
|
||||||
|
* @return call uuid
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public UUID getUUID() {
|
||||||
|
return mUUID;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets call's current state.
|
* Gets call's current state.
|
||||||
*
|
*
|
||||||
@@ -180,6 +199,8 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
|
|||||||
builder.append(loggable ? mDevice.hashCode() : mDevice);
|
builder.append(loggable ? mDevice.hashCode() : mDevice);
|
||||||
builder.append(", mId: ");
|
builder.append(", mId: ");
|
||||||
builder.append(mId);
|
builder.append(mId);
|
||||||
|
builder.append(", mUUID: ");
|
||||||
|
builder.append(mUUID);
|
||||||
builder.append(", mState: ");
|
builder.append(", mState: ");
|
||||||
switch (mState) {
|
switch (mState) {
|
||||||
case CALL_STATE_ACTIVE: builder.append("ACTIVE"); break;
|
case CALL_STATE_ACTIVE: builder.append("ACTIVE"); break;
|
||||||
@@ -210,8 +231,8 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
|
|||||||
@Override
|
@Override
|
||||||
public BluetoothHeadsetClientCall createFromParcel(Parcel in) {
|
public BluetoothHeadsetClientCall createFromParcel(Parcel in) {
|
||||||
return new BluetoothHeadsetClientCall((BluetoothDevice)in.readParcelable(null),
|
return new BluetoothHeadsetClientCall((BluetoothDevice)in.readParcelable(null),
|
||||||
in.readInt(), in.readInt(), in.readString(),
|
in.readInt(), UUID.fromString(in.readString()), in.readInt(),
|
||||||
in.readInt() == 1, in.readInt() == 1);
|
in.readString(), in.readInt() == 1, in.readInt() == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -224,6 +245,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
|
|||||||
public void writeToParcel(Parcel out, int flags) {
|
public void writeToParcel(Parcel out, int flags) {
|
||||||
out.writeParcelable(mDevice, 0);
|
out.writeParcelable(mDevice, 0);
|
||||||
out.writeInt(mId);
|
out.writeInt(mId);
|
||||||
|
out.writeString(mUUID.toString());
|
||||||
out.writeInt(mState);
|
out.writeInt(mState);
|
||||||
out.writeString(mNumber);
|
out.writeString(mNumber);
|
||||||
out.writeInt(mMultiParty ? 1 : 0);
|
out.writeInt(mMultiParty ? 1 : 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user