Add Connection.startActivityFromInCall

This CL adds a new public API to allow Connections
to start an activity on top of the in-call UI.

The Connection passes a PendingIntent to Telecomm which
then forwards it on to InCallUI. The Connection can cancel
the operation by calling PendingIntent.cancel().

This allows services like SIP and Hangouts to show dialogs
to the user when making a call.

Change-Id: I65119a89c925a93467d1b27304ffec9b088b172f
This commit is contained in:
Sailesh Nepal
2014-07-18 14:49:18 -07:00
parent 480315939d
commit 2ab88cc313
12 changed files with 130 additions and 7 deletions

View File

@@ -16,8 +16,8 @@
package android.telecomm;
import android.app.PendingIntent;
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import android.telephony.DisconnectCause;
@@ -43,6 +43,7 @@ public final class RemoteConnection {
void onCallerDisplayNameChanged(
RemoteConnection connection, String callerDisplayName, int presentation);
void onVideoStateChanged(RemoteConnection connection, int videoState);
void onStartActivityFromInCall(RemoteConnection connection, PendingIntent intent);
void onDestroyed(RemoteConnection connection);
}
@@ -346,4 +347,11 @@ public final class RemoteConnection {
l.onCallerDisplayNameChanged(this, callerDisplayName, presentation);
}
}
/** @hide */
void startActivityFromInCall(PendingIntent intent) {
for (Listener l : mListeners) {
l.onStartActivityFromInCall(this, intent);
}
}
}