Add hold support to Telecomm service
Bug: 13169202
Change-Id: Ic2c1989de41c91d237841581e6fa531cb71d4eed
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index 0b60c4a..7eb4a6f 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -271,6 +271,28 @@
}
/**
+ * Puts the call on hold if it is currently active.
+ */
+ void hold() {
+ Preconditions.checkNotNull(mCallService);
+
+ if (mState == CallState.ACTIVE) {
+ mCallService.hold(mId);
+ }
+ }
+
+ /**
+ * Releases the call from hold if it is currently active.
+ */
+ void unhold() {
+ Preconditions.checkNotNull(mCallService);
+
+ if (mState == CallState.ON_HOLD) {
+ mCallService.unhold(mId);
+ }
+ }
+
+ /**
* @return An object containing read-only information about this call.
*/
CallInfo toCallInfo() {