1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.services.telephony.common;
18
19import com.android.services.telephony.common.Call;
20import com.android.services.telephony.common.ICallCommandService;
21
22/**
23 * Service implemented by clients that would like to control and know the status
24 * of phone calls on the device.
25 * TODO: Rename interface.  This not only monitors but controls calls, too. Come
26 *       up with a name that doesn't conflict with current CallManager and
27 *       CallController classes.
28 * TODO: Move this out of opt/telephony and into opt/call or similar. This interface
29 *       makes sense even without the telephony layer (think VOIP).
30 */
31oneway interface ICallHandlerService {
32
33    /**
34     * First call made when we are ready to start sending events to the service.
35     * Hands a command interface to the CallHandlerService through which
36     * the call monitor can control the phone calls.
37     */
38    void startCallService(ICallCommandService callCommandService);
39
40    /**
41     * Called when there is an incoming call.
42     */
43    void onIncoming(in Call call, in List<String> textReponses);
44
45    /**
46     * Called when the state of a call changes.
47     */
48    void onUpdate(in List<Call> call);
49
50    /**
51     * Called when a call disconnects.
52     */
53    void onDisconnect(in Call call);
54
55    /**
56     * Called when the audio mode changes.
57     * {@see AudioMode}
58     */
59    void onAudioModeChange(in int mode, in boolean muted);
60
61    /**
62     * Called when the supported audio modes change.
63     * {@see AudioMode}
64     */
65    void onSupportedAudioModeChange(in int modeMask);
66
67    /**
68     * Called when the system wants to bring the in-call UI into the foreground.
69     */
70    void bringToForeground(boolean showDialpad);
71
72    void onPostDialWait(int callId, String remainingChars);
73}
74