From 40bb6f3f8fc02600fe24301c11e804196ced3531 Mon Sep 17 00:00:00 2001
From: Sanket Agarwal true
if command has been issued successfully;
* false
otherwise;
* upon completion HFP sends {@link #ACTION_CALL_CHANGED}
@@ -809,12 +812,12 @@ public final class BluetoothHeadsetClient implements BluetoothProfile {
* {@link #EXTRA_AG_FEATURE_ECC}.
* This method invocation will fail silently when feature is not supported.
true
if command has been issued successfully;
- * false
otherwise;
- * upon completion HFP sends {@link #ACTION_CALL_CHANGED}
- * intent in case of success; {@link #ACTION_RESULT} is sent
- * otherwise;
- */
- public boolean redial(BluetoothDevice device) {
- if (DBG) log("redial()");
- if (mService != null && isEnabled() &&
- isValidDevice(device)) {
- try {
- return mService.redial(device);
- } catch (RemoteException e) {
- Log.e(TAG, Log.getStackTraceString(new Throwable()));
- }
- }
- if (mService == null) Log.w(TAG, "Proxy not attached to service");
- return false;
- }
-
- /**
* Places a call with specified number.
*
* @param device remote device
* @param number valid phone number
- * @return true
if command has been issued successfully;
- * false
otherwise;
- * upon completion HFP sends {@link #ACTION_CALL_CHANGED}
- * intent in case of success; {@link #ACTION_RESULT} is sent
- * otherwise;
+ * @return {@link BluetoothHeadsetClientCall} call
if command has been
+ * issued successfully;
+ * {@link null}
otherwise;
+ * upon completion HFP sends {@link #ACTION_CALL_CHANGED}
+ * intent in case of success; {@link #ACTION_RESULT} is sent
+ * otherwise;
*/
- public boolean dial(BluetoothDevice device, String number) {
+ public BluetoothHeadsetClientCall dial(BluetoothDevice device, String number) {
if (DBG) log("dial()");
if (mService != null && isEnabled() &&
isValidDevice(device)) {
@@ -928,32 +908,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile {
}
}
if (mService == null) Log.w(TAG, "Proxy not attached to service");
- return false;
- }
-
- /**
- * Places a call to the number under specified memory location.
- *
- * @param device remote device
- * @param location valid memory location
- * @return true
if command has been issued successfully;
- * false
otherwise;
- * upon completion HFP sends {@link #ACTION_CALL_CHANGED}
- * intent in case of success; {@link #ACTION_RESULT} is sent
- * otherwise;
- */
- public boolean dialMemory(BluetoothDevice device, int location) {
- if (DBG) log("dialMemory()");
- if (mService != null && isEnabled() &&
- isValidDevice(device)) {
- try {
- return mService.dialMemory(device, location);
- } catch (RemoteException e) {
- Log.e(TAG, Log.getStackTraceString(new Throwable()));
- }
- }
- if (mService == null) Log.w(TAG, "Proxy not attached to service");
- return false;
+ return null;
}
/**
diff --git a/core/java/android/bluetooth/BluetoothHeadsetClientCall.java b/core/java/android/bluetooth/BluetoothHeadsetClientCall.java
index c73bc3cb53e5..420c079f5fea 100644
--- a/core/java/android/bluetooth/BluetoothHeadsetClientCall.java
+++ b/core/java/android/bluetooth/BluetoothHeadsetClientCall.java
@@ -18,6 +18,7 @@ package android.bluetooth;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.SystemClock;
import java.util.UUID;
@@ -70,6 +71,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
private boolean mMultiParty;
private final boolean mOutgoing;
private final UUID mUUID;
+ private final long mCreationElapsedMilli;
/**
* Creates BluetoothHeadsetClientCall instance.
@@ -88,6 +90,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
mNumber = number != null ? number : "";
mMultiParty = multiParty;
mOutgoing = outgoing;
+ mCreationElapsedMilli = SystemClock.elapsedRealtime();
}
/**
@@ -171,6 +174,15 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
}
/**
+ * Gets call's creation time in millis since epoch.
+ *
+ * @return long representing the creation time.
+ */
+ public long getCreationElapsedMilli() {
+ return mCreationElapsedMilli;
+ }
+
+ /**
* Checks if call is an active call in a conference mode (aka multi party).
*
* @return true
if call is a multi party call,
diff --git a/core/java/android/bluetooth/IBluetoothHeadsetClient.aidl b/core/java/android/bluetooth/IBluetoothHeadsetClient.aidl
index 79ae4e48fa7d..a351bd2d7076 100644
--- a/core/java/android/bluetooth/IBluetoothHeadsetClient.aidl
+++ b/core/java/android/bluetooth/IBluetoothHeadsetClient.aidl
@@ -47,14 +47,12 @@ interface IBluetoothHeadsetClient {
boolean acceptCall(in BluetoothDevice device, int flag);
boolean holdCall(in BluetoothDevice device);
boolean rejectCall(in BluetoothDevice device);
- boolean terminateCall(in BluetoothDevice device, int index);
+ boolean terminateCall(in BluetoothDevice device, in BluetoothHeadsetClientCall call);
boolean enterPrivateMode(in BluetoothDevice device, int index);
boolean explicitCallTransfer(in BluetoothDevice device);
- boolean redial(in BluetoothDevice device);
- boolean dial(in BluetoothDevice device, String number);
- boolean dialMemory(in BluetoothDevice device, int location);
+ BluetoothHeadsetClientCall dial(in BluetoothDevice device, String number);
boolean sendDTMF(in BluetoothDevice device, byte code);
boolean getLastVoiceTagNumber(in BluetoothDevice device);
--
2.11.0