summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/RemoteConnectionService.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2016-11-09 10:19:23 -0800
committerBrad Ebinger <breadley@google.com>2017-02-06 14:49:03 -0800
commitbf9c6fdb43413929787ee3abeb76e5aabd1551d8 (patch)
treef0d48d87d495158bed81ca22c9b43eca58c4e63b /telecomm/java/android/telecom/RemoteConnectionService.java
parented839943e08c956ddd3fb74941e45bbb59343c8c (diff)
Perform camera permission and app ops check when setting camera for VT.
When a calling InCallService attempts to use the setCamera API on the VideoCall, Telecom will perform a permission check to ensure that the caller has the correct camera permission and passes the app-ops camera check. A failure to set the camera will result in a callback via the call session event API. This got a little messy as the app ops package name needs to come from the InCallService, and handler usage in the VideoProvider API means we had to pass around the uid/pid of the caller, obtained before we trampoline onto the handler. Test: Unit tests added, manual testing performed. Bug: 32747443 Change-Id: I555a04f9c3fb45e60bb811f64ba855ccf2e3b0e2
Diffstat (limited to 'telecomm/java/android/telecom/RemoteConnectionService.java')
-rw-r--r--telecomm/java/android/telecom/RemoteConnectionService.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java
index c65d5ef0b114..0c7404aa5e95 100644
--- a/telecomm/java/android/telecom/RemoteConnectionService.java
+++ b/telecomm/java/android/telecom/RemoteConnectionService.java
@@ -283,9 +283,13 @@ final class RemoteConnectionService {
@Override
public void setVideoProvider(String callId, IVideoProvider videoProvider,
Session.Info sessionInfo) {
+
+ String callingPackage = mOurConnectionServiceImpl.getApplicationContext()
+ .getOpPackageName();
RemoteConnection.VideoProvider remoteVideoProvider = null;
if (videoProvider != null) {
- remoteVideoProvider = new RemoteConnection.VideoProvider(videoProvider);
+ remoteVideoProvider = new RemoteConnection.VideoProvider(videoProvider,
+ callingPackage);
}
findConnectionForAction(callId, "setVideoProvider")
.setVideoProvider(remoteVideoProvider);
@@ -351,8 +355,10 @@ final class RemoteConnectionService {
@Override
public void addExistingConnection(String callId, ParcelableConnection connection,
Session.Info sessionInfo) {
+ String callingPackage = mOurConnectionServiceImpl.getApplicationContext().
+ getOpPackageName();
RemoteConnection remoteConnection = new RemoteConnection(callId,
- mOutgoingConnectionServiceRpc, connection);
+ mOutgoingConnectionServiceRpc, connection, callingPackage);
mConnectionById.put(callId, remoteConnection);
remoteConnection.registerCallback(new RemoteConnection.Callback() {
@Override