[Telecom] Improve hold capability signal

Add some method to the ConnectionService in order to notify the
connection changed.

Test: manually test and unit test
Bug: 66949982

Change-Id: I077902474f9af70e00a383aa269e1ae6ff9230a9
This commit is contained in:
Pengquan Meng
2017-10-02 18:09:03 -07:00
parent 764e917084
commit 70c9885330
2 changed files with 56 additions and 3 deletions

View File

@@ -1683,6 +1683,8 @@ public abstract class Connection extends Conferenceable {
// The internal telecom call ID associated with this connection.
private String mTelecomCallId;
// The PhoneAccountHandle associated with this connection.
private PhoneAccountHandle mPhoneAccountHandle;
private int mState = STATE_NEW;
private CallAudioState mCallAudioState;
private Uri mAddress;
@@ -3075,6 +3077,27 @@ public abstract class Connection extends Conferenceable {
}
}
/**
* Sets the {@link PhoneAccountHandle} associated with this connection.
*
* @hide
*/
public void setPhoneAccountHandle(PhoneAccountHandle phoneAccountHandle) {
if (mPhoneAccountHandle != phoneAccountHandle) {
mPhoneAccountHandle = phoneAccountHandle;
notifyPhoneAccountChanged(phoneAccountHandle);
}
}
/**
* Returns the {@link PhoneAccountHandle} associated with this connection.
*
* @hide
*/
public PhoneAccountHandle getPhoneAccountHandle() {
return mPhoneAccountHandle;
}
/**
* Sends an event associated with this {@code Connection} with associated event extras to the
* {@link InCallService}.