API review cleanups/changes.

- Change onCreateIncomingConnectionFailed/onCreateOutgoingConnectionFailed
to accept the connection mgr phone account as the first parameter.
- For the video APIs, pass the target SDK of the caller into along so
that the Telecom permission check can have fallback behavior for older API
versions.
- Add guidance for how UX should be shown in onShowIncomingCallUi API.
API guidance follows how the Dialer app shows its notification and full
screen UX.

Test: Manual, CTS.
Bug: 35767711
Bug: 35767096
Change-Id: Ib343f0eda1a4d067a38c553f33f140b4efcf3e48
This commit is contained in:
Tyler Gunn
2017-03-02 09:28:37 -08:00
parent b8648ae07a
commit 159f35c8e4
14 changed files with 121 additions and 37 deletions

View File

@@ -410,6 +410,8 @@ public final class RemoteConnection {
private final String mCallingPackage;
private final int mTargetSdkVersion;
/**
* ConcurrentHashMap constructor params: 8 is initial table size, 0.9f is
* load factor before resizing, 1 means we only expect a single thread to
@@ -418,9 +420,12 @@ public final class RemoteConnection {
private final Set<Callback> mCallbacks = Collections.newSetFromMap(
new ConcurrentHashMap<Callback, Boolean>(8, 0.9f, 1));
VideoProvider(IVideoProvider videoProviderBinder, String callingPackage) {
VideoProvider(IVideoProvider videoProviderBinder, String callingPackage,
int targetSdkVersion) {
mVideoProviderBinder = videoProviderBinder;
mCallingPackage = callingPackage;
mTargetSdkVersion = targetSdkVersion;
try {
mVideoProviderBinder.addVideoCallback(mVideoCallbackServant.getStub().asBinder());
} catch (RemoteException e) {
@@ -455,7 +460,7 @@ public final class RemoteConnection {
*/
public void setCamera(String cameraId) {
try {
mVideoProviderBinder.setCamera(cameraId, mCallingPackage);
mVideoProviderBinder.setCamera(cameraId, mCallingPackage, mTargetSdkVersion);
} catch (RemoteException e) {
}
}
@@ -631,7 +636,7 @@ public final class RemoteConnection {
* @hide
*/
RemoteConnection(String callId, IConnectionService connectionService,
ParcelableConnection connection, String callingPackage) {
ParcelableConnection connection, String callingPackage, int targetSdkVersion) {
mConnectionId = callId;
mConnectionService = connectionService;
mConnected = true;
@@ -643,7 +648,8 @@ public final class RemoteConnection {
mVideoState = connection.getVideoState();
IVideoProvider videoProvider = connection.getVideoProvider();
if (videoProvider != null) {
mVideoProvider = new RemoteConnection.VideoProvider(videoProvider, callingPackage);
mVideoProvider = new RemoteConnection.VideoProvider(videoProvider, callingPackage,
targetSdkVersion);
} else {
mVideoProvider = null;
}