diff options
author | Bryce Lee <brycelee@google.com> | 2015-12-17 00:02:41 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-12-17 00:02:41 +0000 |
commit | cae2f2415ba04eb854fdcdc6aa66c857ad7148d0 (patch) | |
tree | a0aaa7d24c15f5b882f964e0fcad0fa1a371e805 | |
parent | 8c9209183fa67953bebe1adb5dfb529c1b6273f0 (diff) | |
parent | e457fa4b9d6c37746ba16cf8a1ad801b87ede2fb (diff) | |
download | frameworks_base-cae2f2415ba04eb854fdcdc6aa66c857ad7148d0.zip frameworks_base-cae2f2415ba04eb854fdcdc6aa66c857ad7148d0.tar.gz frameworks_base-cae2f2415ba04eb854fdcdc6aa66c857ad7148d0.tar.bz2 |
Merge "Add UUID to BluetoothHeadsetClientCall" into cw-e-dev
-rw-r--r-- | core/java/android/bluetooth/BluetoothHeadsetClientCall.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/core/java/android/bluetooth/BluetoothHeadsetClientCall.java b/core/java/android/bluetooth/BluetoothHeadsetClientCall.java index 1fb7825..002f63f 100644 --- a/core/java/android/bluetooth/BluetoothHeadsetClientCall.java +++ b/core/java/android/bluetooth/BluetoothHeadsetClientCall.java @@ -19,6 +19,8 @@ package android.bluetooth; import android.os.Parcel; import android.os.Parcelable; +import java.util.UUID; + /** * This class represents a single call, its state and properties. * It implements {@link Parcelable} for inter-process message passing. @@ -67,14 +69,21 @@ public final class BluetoothHeadsetClientCall implements Parcelable { private String mNumber; private boolean mMultiParty; private final boolean mOutgoing; + private final UUID mUUID; /** * 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); + } + + public BluetoothHeadsetClientCall(BluetoothDevice device, int id, UUID uuid, int state, + String number, boolean multiParty, boolean outgoing) { mDevice = device; mId = id; + mUUID = uuid; mState = state; mNumber = number != null ? number : ""; mMultiParty = multiParty; @@ -134,6 +143,16 @@ public final class BluetoothHeadsetClientCall implements Parcelable { } /** + * Gets call's UUID. + * + * @return call uuid + * @hide + */ + public UUID getUUID() { + return mUUID; + } + + /** * Gets call's current state. * * @return state of this particular phone call. @@ -180,6 +199,8 @@ public final class BluetoothHeadsetClientCall implements Parcelable { builder.append(loggable ? mDevice.hashCode() : mDevice); builder.append(", mId: "); builder.append(mId); + builder.append(", mUUID: "); + builder.append(mUUID); builder.append(", mState: "); switch (mState) { case CALL_STATE_ACTIVE: builder.append("ACTIVE"); break; @@ -210,8 +231,8 @@ public final class BluetoothHeadsetClientCall implements Parcelable { @Override public BluetoothHeadsetClientCall createFromParcel(Parcel in) { return new BluetoothHeadsetClientCall((BluetoothDevice)in.readParcelable(null), - in.readInt(), in.readInt(), in.readString(), - in.readInt() == 1, in.readInt() == 1); + in.readInt(), UUID.fromString(in.readString()), in.readInt(), + in.readString(), in.readInt() == 1, in.readInt() == 1); } @Override @@ -224,6 +245,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable { public void writeToParcel(Parcel out, int flags) { out.writeParcelable(mDevice, 0); out.writeInt(mId); + out.writeString(mUUID.toString()); out.writeInt(mState); out.writeString(mNumber); out.writeInt(mMultiParty ? 1 : 0); |