Add hold support to frameworks/base/telecomm
Bug: 13169202 Change-Id: Ib01990c1f8654f95a4cfcca4a91f0ab143722d8e
This commit is contained in:
@@ -39,6 +39,7 @@ public abstract class InCallService extends Service {
|
||||
private static final int MSG_ADD_CALL = 2;
|
||||
private static final int MSG_SET_ACTIVE = 3;
|
||||
private static final int MSG_SET_DISCONNECTED = 4;
|
||||
private static final int MSG_SET_HOLD = 5;
|
||||
|
||||
/** Default Handler used to consolidate binder method calls onto a single thread. */
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper()) {
|
||||
@@ -58,6 +59,8 @@ public abstract class InCallService extends Service {
|
||||
case MSG_SET_DISCONNECTED:
|
||||
setDisconnected((String) msg.obj);
|
||||
break;
|
||||
case MSG_SET_HOLD:
|
||||
setOnHold((String) msg.obj);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -89,6 +92,12 @@ public abstract class InCallService extends Service {
|
||||
public void setDisconnected(String callId) {
|
||||
mHandler.obtainMessage(MSG_SET_DISCONNECTED, callId).sendToTarget();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void setOnHold(String callId) {
|
||||
mHandler.obtainMessage(MSG_SET_HOLD, callId).sendToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
private final InCallServiceBinder mBinder;
|
||||
@@ -136,4 +145,12 @@ public abstract class InCallService extends Service {
|
||||
* @param callId The identifier of the call that was disconnected.
|
||||
*/
|
||||
protected abstract void setDisconnected(String callId);
|
||||
|
||||
/**
|
||||
* Indicates to the in-call app that a call has been moved to the
|
||||
* {@link android.telecomm.CallState#ON_HOLD} state and the user should be notified.
|
||||
*
|
||||
* @param callId The identifier of the call that was put on hold.
|
||||
*/
|
||||
protected abstract void setOnHold(String callId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user