Add ability to add sim-initiated MO call to UI (2/4)

Add supporting (hidden) APIs to TelecomManager to add the ability to
add a previous unknown call to Telecom

Bug: 17787391

Change-Id: Ibdfaee81a55e11451c146751cf970980dccad435
This commit is contained in:
Yorke Lee
2014-10-02 09:38:39 -07:00
parent 17d7c79650
commit c3cf982d18
5 changed files with 74 additions and 9 deletions

View File

@@ -50,6 +50,13 @@ public class TelecomManager {
*/
public static final String ACTION_INCOMING_CALL = "android.telecom.action.INCOMING_CALL";
/**
* Similar to {@link #ACTION_INCOMING_CALL}, but is used only by Telephony to add a new
* sim-initiated MO call for carrier testing.
* @hide
*/
public static final String ACTION_NEW_UNKNOWN_CALL = "android.telecom.action.NEW_UNKNOWN_CALL";
/**
* The {@link android.content.Intent} action used to configure a
* {@link android.telecom.ConnectionService}.
@@ -124,6 +131,12 @@ public class TelecomManager {
public static final String EXTRA_OUTGOING_CALL_EXTRAS =
"android.telecom.extra.OUTGOING_CALL_EXTRAS";
/**
* @hide
*/
public static final String EXTRA_UNKNOWN_CALL_HANDLE =
"android.telecom.extra.UNKNOWN_CALL_HANDLE";
/**
* Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED}
* containing the disconnect code.
@@ -814,6 +827,29 @@ public class TelecomManager {
}
}
/**
* Registers a new unknown call with Telecom. This can only be called by the system Telephony
* service. This is invoked when Telephony detects a new unknown connection that was neither
* a new incoming call, nor an user-initiated outgoing call.
*
* @param phoneAccount A {@link PhoneAccountHandle} registered with
* {@link #registerPhoneAccount}.
* @param extras A bundle that will be passed through to
* {@link ConnectionService#onCreateIncomingConnection}.
* @hide
*/
@SystemApi
public void addNewUnknownCall(PhoneAccountHandle phoneAccount, Bundle extras) {
try {
if (isServiceConnected()) {
getTelecomService().addNewUnknownCall(
phoneAccount, extras == null ? new Bundle() : extras);
}
} catch (RemoteException e) {
Log.e(TAG, "RemoteException adding a new unknown call: " + phoneAccount, e);
}
}
/**
* Processes the specified dial string as an MMI code.
* MMI codes are any sequence of characters entered into the dialpad that contain a "*" or "#".