merge master nova by hand, skipped translations

Change-Id: I4bea0bb9e375361f21d995bf4698d5eb6300ecfb
This commit is contained in:
Ed Heyl
2014-05-14 13:24:53 -07:00
309 changed files with 4717 additions and 3733 deletions

View File

@@ -17,10 +17,7 @@
package android.telephony;
/**
* Contains disconnect call causes generated by the
* framework and the RIL.
*
* @hide
* Contains disconnect call causes generated by the framework and the RIL.
*/
public class DisconnectCause {

View File

@@ -19,6 +19,7 @@ package android.telephony;
import android.annotation.PrivateApi;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.content.ComponentName;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
@@ -67,6 +68,20 @@ public class TelephonyManager {
private static ITelephonyRegistry sRegistry;
/**
* The allowed states of Wi-Fi calling.
*
* @hide
*/
public interface WifiCallingChoices {
/** Always use Wi-Fi calling */
static final int ALWAYS_USE = 0;
/** Ask the user whether to use Wi-Fi on every call */
static final int ASK_EVERY_TIME = 1;
/** Never use Wi-Fi calling */
static final int NEVER_USE = 2;
}
private final HashMap<CallStateListener,Listener> mListeners
= new HashMap<CallStateListener,Listener>();
private final Context mContext;
@@ -1735,6 +1750,24 @@ public class TelephonyManager {
}
}
/**
* Inform the phone about a new incoming third party call. The phone will bind to the service
* identified by component to handle the call.
* @param component the component that should handle the intent.
* @param callId the unique id of the call. This id is passed to the service via {@link
* ThirdPartyCallService#incomingCallAttach incomingCallAttach}.
* @param callerDisplayName the name shown to the user. Normally this will be the caller's phone
* number.
*/
public void newIncomingThirdPartyCall(ComponentName component, String callId,
String callerDisplayName) {
try {
getITelephony().newIncomingThirdPartyCall(component, callId, callerDisplayName);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
}
/**
* Returns the MMS user agent.
*/
@@ -1758,12 +1791,15 @@ public class TelephonyManager {
*
* Input parameters equivalent to TS 27.007 AT+CCHO command.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
*
* @param AID Application id. See ETSI 102.221 and 101.220.
* @return The logical channel id which is negative on error.
*/
public int iccOpenLogicalChannel(String AID) {
try {
return getITelephony().iccOpenLogicalChannel(AID);
return getITelephony().iccOpenLogicalChannel(AID);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
@@ -1775,13 +1811,16 @@ public class TelephonyManager {
*
* Input parameters equivalent to TS 27.007 AT+CCHC command.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
*
* @param channel is the channel id to be closed as retruned by a successful
* iccOpenLogicalChannel.
* @return true if the channel was closed successfully.
*/
public boolean iccCloseLogicalChannel(int channel) {
try {
return getITelephony().iccCloseLogicalChannel(channel);
return getITelephony().iccCloseLogicalChannel(channel);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
@@ -1793,6 +1832,9 @@ public class TelephonyManager {
*
* Input parameters equivalent to TS 27.007 AT+CGLA command.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
*
* @param channel is the channel id to be closed as returned by a successful
* iccOpenLogicalChannel.
* @param cla Class of the APDU command.
@@ -1808,8 +1850,30 @@ public class TelephonyManager {
public String iccTransmitApduLogicalChannel(int channel, int cla,
int instruction, int p1, int p2, int p3, String data) {
try {
return getITelephony().iccTransmitApduLogicalChannel(channel, cla,
instruction, p1, p2, p3, data);
return getITelephony().iccTransmitApduLogicalChannel(channel, cla,
instruction, p1, p2, p3, data);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return "";
}
/**
* Send ENVELOPE to the SIM and return the response.
*
* <p>Requires Permission:
* {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
*
* @param content String containing SAT/USAT response in hexadecimal
* format starting with command tag. See TS 102 223 for
* details.
* @return The APDU response from the ICC card, with the last 4 bytes
* being the status word. If the command fails, returns an empty
* string.
*/
public String sendEnvelopeWithStatus(String content) {
try {
return getITelephony().sendEnvelopeWithStatus(content);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
@@ -1895,6 +1959,33 @@ public class TelephonyManager {
return false;
}
/*
* Obtain the current state of Wi-Fi calling.
*
* @hide
* @see android.telephony.TelephonyManager.WifiCallingChoices
*/
public int getWhenToMakeWifiCalls() {
try {
return getITelephony().getWhenToMakeWifiCalls();
} catch (RemoteException ex) {
return WifiCallingChoices.NEVER_USE;
}
}
/**
* Set the current state of Wi-Fi calling.
*
* @hide
* @see android.telephony.TelephonyManager.WifiCallingChoices
*/
public void setWhenToMakeWifiCalls(int state) {
try {
getITelephony().setWhenToMakeWifiCalls(state);
} catch (RemoteException ex) {
}
}
/**
* Get the preferred network type.
* Used for device configuration by some CDMA operators.

View File

@@ -0,0 +1,89 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.telephony;
import android.os.Handler;
import android.os.Message;
import android.os.RemoteException;
import com.android.internal.telephony.IThirdPartyCallListener;
/**
* Interface provided to {@link android.telephony.ThirdPartyCallService}. The service can use this
* to notify the listener of changes to the call state.
*/
public class ThirdPartyCallListener {
private final IThirdPartyCallListener mListener;
// Call end reason.
public static final int CALL_END_NORMAL = 1;
public static final int CALL_END_INCOMING_MISSED = 2;
public static final int CALL_END_OTHER = 3;
public ThirdPartyCallListener(IThirdPartyCallListener listener) {
mListener = listener;
}
/**
* Called by the service when a call provider is available to perform the outgoing or incoming
* call.
*/
public void onCallProviderAttached(ThirdPartyCallProvider callProvider) {
try {
if (mListener != null) {
mListener.onCallProviderAttached(callProvider.callback);
}
} catch (RemoteException e) {
}
}
/**
* Notifies the listener that ringing has started for this call.
*/
public void onRingingStarted() {
try {
if (mListener != null) {
mListener.onRingingStarted();
}
} catch (RemoteException e) {
}
}
/**
* Notifies the listener that the call has been successfully established.
*/
public void onCallEstablished() {
try {
if (mListener != null) {
mListener.onCallEstablished();
}
} catch (RemoteException e) {
}
}
/**
* Notifies the listener that the call has ended.
*/
public void onCallEnded(int reason) {
try {
if (mListener != null) {
mListener.onCallEnded(reason);
}
} catch (RemoteException e) {
}
}
}

View File

@@ -0,0 +1,106 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.telephony;
import android.os.Handler;
import android.os.Message;
import com.android.internal.telephony.IThirdPartyCallProvider;
import com.android.internal.telephony.IThirdPartyCallSendDtmfCallback;
/**
* Interface sent to {@link android.telephony.ThirdPartyCallListener#onCallProviderAttached
* onCallProviderAttached}. This is used to control an outgoing or an incoming call.
*/
public class ThirdPartyCallProvider {
private static final int MSG_MUTE = 1;
private static final int MSG_HANGUP = 2;
private static final int MSG_INCOMING_CALL_ACCEPT = 3;
private static final int MSG_SEND_DTMF = 4;
/**
* Mutes or unmutes the call.
*/
public void mute(boolean shouldMute) {
// default implementation empty
}
/**
* Ends the current call. If this is an unanswered incoming call then the call is rejected.
*/
public void hangup() {
// default implementation empty
}
/**
* Accepts the incoming call.
*/
public void incomingCallAccept() {
// default implementation empty
}
/**
* Sends the given DTMF code. The code can be '0'-'9', 'A'-'D', '#', or '*'.
*/
public void sendDtmf(char c, ThirdPartyCallSendDtmfCallback callback) {
// default implementation empty
}
final IThirdPartyCallProvider callback = new IThirdPartyCallProvider.Stub() {
@Override
public void mute(boolean shouldMute) {
Message.obtain(mHandler, MSG_MUTE, shouldMute ? 1 : 0, 0).sendToTarget();
}
@Override
public void hangup() {
Message.obtain(mHandler, MSG_HANGUP).sendToTarget();
}
@Override
public void incomingCallAccept() {
Message.obtain(mHandler, MSG_INCOMING_CALL_ACCEPT).sendToTarget();
}
@Override
public void sendDtmf(char c, IThirdPartyCallSendDtmfCallback callback) {
Message.obtain(mHandler, MSG_SEND_DTMF, (int) c, 0, callback).sendToTarget();
}
};
private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_MUTE:
mute(msg.arg1 != 0);
break;
case MSG_HANGUP:
hangup();
break;
case MSG_INCOMING_CALL_ACCEPT:
incomingCallAccept();
break;
case MSG_SEND_DTMF:
ThirdPartyCallSendDtmfCallback callback = new ThirdPartyCallSendDtmfCallback(
(IThirdPartyCallSendDtmfCallback) msg.obj);
sendDtmf((char) msg.arg1, callback);
break;
}
}
};
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.telephony;
import android.os.RemoteException;
import com.android.internal.telephony.IThirdPartyCallSendDtmfCallback;
/**
* Callback interface for when DTMF has been sent.
*/
public class ThirdPartyCallSendDtmfCallback {
private final IThirdPartyCallSendDtmfCallback mCallback;
public ThirdPartyCallSendDtmfCallback(IThirdPartyCallSendDtmfCallback callback) {
if (callback == null) {
throw new IllegalArgumentException("Invalid callback");
}
mCallback = callback;
}
/**
* Called by the service when a call provider is available to perform the outgoing or incoming
* call.
*/
public void onSendDtmfCompleted() {
try {
mCallback.onSendDtmfCompleted();
} catch (RemoteException e) {
}
}
}

View File

@@ -0,0 +1,96 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.telephony;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.util.Pair;
import com.android.internal.telephony.IThirdPartyCallListener;
import com.android.internal.telephony.IThirdPartyCallService;
/**
* Interface provided by a service to start outgoing calls and attach to incoming calls.
*/
public class ThirdPartyCallService {
private static final int MSG_OUTGOING_CALL_INITIATE = 1;
private static final int MSG_INCOMING_CALL_ATTACH = 2;
/**
* Call to start a new outgoing call.
*/
public void outgoingCallInitiate(ThirdPartyCallListener listener, String number) {
// default implementation empty
}
/**
* Call to attach to an incoming call. This is in response to a call to {@link
* android.telephony.TelephonyManager#newIncomingThirdPartyCall newIncomingThirdPartyCall}.
*/
public void incomingCallAttach(ThirdPartyCallListener listener, String callId) {
// default implementation empty
}
/**
* Returns an IBinder instance that can returned from the service's onBind function.
*/
public IBinder getBinder() {
return callback;
}
private final IThirdPartyCallService.Stub callback = new IThirdPartyCallService.Stub() {
@Override
public void outgoingCallInitiate(IThirdPartyCallListener listener, String number) {
Rlog.w("ThirdPartyPhone", "ThirdPartyCallService.IThirdPartyCallService.out");
Message.obtain(mHandler, MSG_OUTGOING_CALL_INITIATE,
Pair.create(listener, number)).sendToTarget();
}
@Override
public void incomingCallAttach(IThirdPartyCallListener listener, String callId) {
Rlog.w("ThirdPartyPhone", "ThirdPartyCallService.IThirdPartyCallService.in");
Message.obtain(mHandler, MSG_INCOMING_CALL_ATTACH,
Pair.create(listener, callId)).sendToTarget();
}
};
private final Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
Rlog.w("ThirdPartyPhone", "ThirdPartyCallService.handleMessage: " + msg.what);
switch (msg.what) {
case MSG_OUTGOING_CALL_INITIATE: {
Rlog.w("ThirdPartyPhone", "ThirdPartyCallService.handleMessage out");
Pair<IThirdPartyCallListener, String> pair =
(Pair<IThirdPartyCallListener, String>) msg.obj;
ThirdPartyCallListener listener = new ThirdPartyCallListener(pair.first);
outgoingCallInitiate(listener, pair.second);
break;
}
case MSG_INCOMING_CALL_ATTACH: {
Rlog.w("ThirdPartyPhone", "ThirdPartyCallService.handleMessage in");
Pair<IThirdPartyCallListener, String> pair =
(Pair<IThirdPartyCallListener, String>) msg.obj;
ThirdPartyCallListener listener = new ThirdPartyCallListener(pair.first);
incomingCallAttach(listener, pair.second);
break;
}
}
}
};
}

View File

@@ -0,0 +1,19 @@
/*
** Copyright 2013, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
package com.android.internal.telephony;
parcelable CallInfo;

View File

@@ -0,0 +1,77 @@
/*
** Copyright 2013, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
package com.android.internal.telephony;
import android.os.Parcel;
import android.os.Parcelable;
/**
* A parcelable holder class of Call information data.
*/
public class CallInfo implements Parcelable {
/**
* Endpoint to which the call is connected.
* This could be the dialed value for outgoing calls or the caller id of incoming calls.
*/
private String handle;
public CallInfo(String handle) {
this.handle = handle;
}
public String getHandle() {
return handle;
}
//
// Parcelling related code below here.
//
/**
* Responsible for creating CallInfo objects for deserialized Parcels.
*/
public static final Parcelable.Creator<CallInfo> CREATOR
= new Parcelable.Creator<CallInfo> () {
@Override
public CallInfo createFromParcel(Parcel source) {
return new CallInfo(source.readString());
}
@Override
public CallInfo[] newArray(int size) {
return new CallInfo[size];
}
};
/**
* {@inheritDoc}
*/
@Override
public int describeContents() {
return 0;
}
/**
* Writes CallInfo object into a serializeable Parcel.
*/
@Override
public void writeToParcel(Parcel destination, int flags) {
destination.writeString(handle);
}
}

View File

@@ -0,0 +1,61 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony;
import com.android.internal.telephony.ICallServiceAdapter;
/**
* Service interface for services which would like to provide calls to be
* managed by the system in-call UI.
*
* This interface provides methods that the android framework can use to deliver commands
* for calls provided by this call service including making new calls and disconnecting
* existing ones. A binding to ICallService implementations exists for two conditions:
* 1) There exists one or more live calls for that call service,
* 2) Prior to an outbound call to test if this call service is compatible with the outgoing call.
*/
oneway interface ICallService {
/**
* Determines if the CallService can make calls to the handle.
* TODO(santoscordon): Move this method into its own service interface long term.
* TODO(santoscordon): Add response callback parameter.
*/
void isCompatibleWith(String handle);
/**
* Attempts to call the relevant party using the specified handle, be it a phone number,
* SIP address, or some other kind of user ID. Note that the set of handle types is
* dynamically extensible since call providers should be able to implement arbitrary
* handle-calling systems. See {@link #isCompatibleWith}.
* TODO(santoscordon): Should this have a response attached to it to ensure that the call
* service actually plans to make the call?
*/
void call(String handle);
/**
* Disconnects the call identified by callId.
*/
void disconnect(String callId);
/**
* Sets an implementation of ICallServiceAdapter which the call service can use to add new calls
* and communicate state changes of existing calls. This is the first method that is called
* after a the framework binds to the call service.
*/
void setCallServiceAdapter(ICallServiceAdapter callServiceAdapter);
}

View File

@@ -0,0 +1,61 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony;
import com.android.internal.telephony.CallInfo;
/**
* Provides methods for ICallService implementations to interact with the system phone app.
*/
oneway interface ICallServiceAdapter {
/**
* Retrieves a new unique call id for use with newOutgoingCall and newIncomingCall.
*/
void getNextCallId(/* TODO(santoscordon): Needs response object */);
/**
* Tells CallsManager of a new incoming call.
*/
void newIncomingCall(String callId, in CallInfo info);
/**
* Tells CallsManager of a new outgoing call.
*/
void newOutgoingCall(String callId, in CallInfo info);
/**
* Sets a call's state to active (e.g., an ongoing call where two parties can actively
* communicate).
*/
void setActive(String callId);
/**
* Sets a call's state to ringing (e.g., an inbound ringing call).
*/
void setRinging(String callId);
/**
* Sets a call's state to dialing (e.g., dialing an outbound call).
*/
void setDialing(String callId);
/**
* Sets a call's state to disconnected.
*/
void setDisconnected(String callId);
}

View File

@@ -16,6 +16,7 @@
package com.android.internal.telephony;
import android.content.ComponentName;
import android.os.Bundle;
import android.telephony.CellInfo;
import android.telephony.NeighboringCellInfo;
@@ -24,6 +25,8 @@ import com.android.internal.telephony.ITelephonyListener;
import java.util.List;
import java.util.List;
/**
* Interface used to interact with the phone. Mostly this is used by the
* TelephonyManager class. A few places are still using this directly.
@@ -369,6 +372,18 @@ interface ITelephony {
String iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
int p1, int p2, int p3, String data);
/**
* Send ENVELOPE to the SIM and returns the response.
*
* @param contents String containing SAT/USAT response in hexadecimal
* format starting with command tag. See TS 102 223 for
* details.
* @return The APDU response from the ICC card, with the last 4 bytes
* being the status word. If the command fails, returns an empty
* string.
*/
String sendEnvelopeWithStatus(String content);
/**
* Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
* Used for device configuration by some CDMA operators.
@@ -408,6 +423,31 @@ interface ITelephony {
boolean nvResetConfig(int resetType);
/**
* Inform the phone about a new incoming third party call. The phone will bind to the service
* identified by component to handle the call.
* @param component the component that should handle the intent.
* @param callId the unique id of the call.
* @param callerDisplayName the name shown to the user. Normally this will be the caller's phone
* number.
*/
void newIncomingThirdPartyCall(in ComponentName component, String callId,
String callerDisplayName);
/**
* Obtain the current state of Wi-Fi calling.
*
* @see android.telephony.TelephonyManager.WifiCallingChoices
*/
int getWhenToMakeWifiCalls();
/**
* Set the current state of Wi-Fi calling.
*
* @see android.telephony.TelephonyManager.WifiCallingChoices
*/
void setWhenToMakeWifiCalls(int state);
/*
* Get the preferred network type.
* Used for device configuration by some CDMA operators.
*

View File

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony;
import com.android.internal.telephony.IThirdPartyCallProvider;
/**
* Interface provided to ThirdPartyCallService. The service can use this to notify the listener of
* changes to the call state.
*/
oneway interface IThirdPartyCallListener {
/**
* Called by the service when a call provider is available to perform the outgoing or incoming
* call.
*/
void onCallProviderAttached(IThirdPartyCallProvider callProvider);
/**
* Notifies the listener that ringing has started for this call.
*/
void onRingingStarted();
/**
* Notifies the listener that the call has been successfully established.
*/
void onCallEstablished();
/**
* Notifies the listener that the call has ended.
*/
void onCallEnded(int reason);
}

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony;
import com.android.internal.telephony.IThirdPartyCallListener;
import com.android.internal.telephony.IThirdPartyCallSendDtmfCallback;
/**
* Interface sent to ThirdPartyCallListener.onCallProviderAttached. This is used to control an
* outgoing or incoming call.
*/
oneway interface IThirdPartyCallProvider {
/**
* Mutes or unmutes the call.
*/
void mute(boolean shouldMute);
/**
* Ends the current call. If this is an unanswered incoming call then the call is rejected (for
* example, a notification is sent to a server that the user declined the call).
*/
void hangup();
/**
* Accepts the incoming call.
*/
void incomingCallAccept();
/**
* Sends the given DTMF code. The code can be '0'-'9', 'A'-'D', '#', or '*'.
*/
void sendDtmf(char c, IThirdPartyCallSendDtmfCallback callback);
}

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony;
/**
* Callback interface for when DTMF has been sent.
*/
oneway interface IThirdPartyCallSendDtmfCallback {
/**
* Called when the DTMF code has been sent.
*/
void onSendDtmfCompleted();
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony;
import com.android.internal.telephony.IThirdPartyCallListener;
/**
* Interface provided by a service to start outgoing calls and attach to incoming calls.
*/
oneway interface IThirdPartyCallService {
/**
* Call to start a new outgoing call.
*/
void outgoingCallInitiate(IThirdPartyCallListener listener, String number);
/**
* Call to attach to an incoming call. This is in response to a call to
* TelephonyManager.newIncomingThirdPartyCall.
*/
void incomingCallAttach(IThirdPartyCallListener listener, String callId);
}

View File

@@ -57,6 +57,7 @@ public class PhoneConstants {
public static final int PHONE_TYPE_GSM = RILConstants.GSM_PHONE;
public static final int PHONE_TYPE_CDMA = RILConstants.CDMA_PHONE;
public static final int PHONE_TYPE_SIP = RILConstants.SIP_PHONE;
public static final int PHONE_TYPE_THIRD_PARTY = RILConstants.THIRD_PARTY_PHONE;
// Modes for LTE_ON_CDMA
public static final int LTE_ON_CDMA_UNKNOWN = RILConstants.LTE_ON_CDMA_UNKNOWN;

View File

@@ -84,6 +84,7 @@ public interface RILConstants {
int GSM_PHONE = 1;
int CDMA_PHONE = 2;
int SIP_PHONE = 3;
int THIRD_PARTY_PHONE = 4;
int LTE_ON_CDMA_UNKNOWN = -1;
int LTE_ON_CDMA_FALSE = 0;