summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQiang Chen <cqiang@codeaurora.org>2014-12-03 10:38:47 +0800
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:29:02 -0600
commit3dc1850640a2af2fb342740853be1f84e76672c7 (patch)
tree82d36c512e6b2cd0e43e8dfc178d594d73c088ca
parentec0eb424405e40735cdbe7ec8ed7caf82944e20e (diff)
downloadframeworks_base-3dc1850640a2af2fb342740853be1f84e76672c7.zip
frameworks_base-3dc1850640a2af2fb342740853be1f84e76672c7.tar.gz
frameworks_base-3dc1850640a2af2fb342740853be1f84e76672c7.tar.bz2
Telecom: Reset the duration after the CDMA call is accepted
In android original design, the duration of CDMA MO call is started from the dial command sent, so it is not the real duration of the active time. In this patch, a new message is registered to listen the event of the call accepted, and then reset the duration when the event happens. Change-Id: Icc447012030ae243f200ec2c83b7d5210af9b31c CRs-Fixed: 754497
-rw-r--r--telecomm/java/android/telecom/Connection.java11
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java5
-rw-r--r--telecomm/java/android/telecom/ConnectionServiceAdapter.java12
-rw-r--r--telecomm/java/android/telecom/ConnectionServiceAdapterServant.java4
-rw-r--r--telecomm/java/android/telecom/RemoteConnectionService.java4
-rw-r--r--telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl2
6 files changed, 38 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 27c92bf..c02eee2 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -456,6 +456,7 @@ public abstract class Connection extends Conferenceable {
public void onConferenceMergeFailed(Connection c) {}
public void onExtrasChanged(Connection c, Bundle extras) {}
public void onPhoneAccountChanged(Connection c, PhoneAccountHandle pHandle) {}
+ public void onCdmaConnectionTimeReset(Connection c) {}
}
/**
@@ -1621,6 +1622,16 @@ public abstract class Connection extends Conferenceable {
}
/**
+ *@hide
+ * Resets the cdma connection time.
+ */
+ public final void resetCdmaConnectionTime() {
+ for (Listener l : mListeners) {
+ l.onCdmaConnectionTimeReset(this);
+ }
+ }
+
+ /**
* Returns the connections or conferences with which this connection can be conferenced.
*/
public final List<Conferenceable> getConferenceables() {
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 019839f..306b7e4 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -632,6 +632,11 @@ public abstract class ConnectionService extends Service {
Log.i(this, "Adapter onPhoneAccountChanged %s, %s", c, pHandle);
mAdapter.setPhoneAccountHandle(id, pHandle);
}
+
+ public void onCdmaConnectionTimeReset(Connection c) {
+ String id = mIdByConnection.get(c);
+ mAdapter.resetCdmaConnectionTime(id);
+ }
};
/** {@inheritDoc} */
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
index 8495f95..f59427d 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
@@ -230,6 +230,18 @@ final class ConnectionServiceAdapter implements DeathRecipient {
}
/**
+ * Resets the cdma connection time.
+ */
+ void resetCdmaConnectionTime(String callId) {
+ for (IConnectionServiceAdapter adapter : mAdapters) {
+ try {
+ adapter.resetCdmaConnectionTime(callId);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
* Indicates that the call no longer exists. Can be used with either a call or a conference
* call.
*
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index 7162772..feaa89e 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -437,6 +437,10 @@ final class ConnectionServiceAdapterServant {
args.arg2 = pHandle;
mHandler.obtainMessage(MSG_SET_PHONE_ACCOUNT, args).sendToTarget();
}
+
+ @Override
+ public void resetCdmaConnectionTime(String callId) {
+ }
};
public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {
diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java
index c87b037..eead32a 100644
--- a/telecomm/java/android/telecom/RemoteConnectionService.java
+++ b/telecomm/java/android/telecom/RemoteConnectionService.java
@@ -335,6 +335,10 @@ final class RemoteConnectionService {
findConnectionForAction(callId, "setPhoneAccountHandle")
.setPhoneAccountHandle(pHandle);
}
+
+ @Override
+ public void resetCdmaConnectionTime(String callId) {
+ }
};
private final ConnectionServiceAdapterServant mServant =
diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
index 32c48b1..aaefbaf 100644
--- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
@@ -89,4 +89,6 @@ oneway interface IConnectionServiceAdapter {
void setExtras(String callId, in Bundle extras);
void setPhoneAccountHandle(String callId, in PhoneAccountHandle pHandle);
+
+ void resetCdmaConnectionTime(String callId);
}