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
This commit is contained in:
@ -853,6 +853,7 @@ public final class Call {
|
||||
private String mParentId = null;
|
||||
private int mState;
|
||||
private List<String> mCannedTextResponses = null;
|
||||
private String mCallingPackage;
|
||||
private String mRemainingPostDialSequence;
|
||||
private VideoCallImpl mVideoCallImpl;
|
||||
private Details mDetails;
|
||||
@ -1340,19 +1341,22 @@ public final class Call {
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter) {
|
||||
Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, String callingPackage) {
|
||||
mPhone = phone;
|
||||
mTelecomCallId = telecomCallId;
|
||||
mInCallAdapter = inCallAdapter;
|
||||
mState = STATE_NEW;
|
||||
mCallingPackage = callingPackage;
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, int state) {
|
||||
Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, int state,
|
||||
String callingPackage) {
|
||||
mPhone = phone;
|
||||
mTelecomCallId = telecomCallId;
|
||||
mInCallAdapter = inCallAdapter;
|
||||
mState = state;
|
||||
mCallingPackage = callingPackage;
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@ -1362,6 +1366,7 @@ public final class Call {
|
||||
|
||||
/** {@hide} */
|
||||
final void internalUpdate(ParcelableCall parcelableCall, Map<String, Call> callIdMap) {
|
||||
|
||||
// First, we update the internal state as far as possible before firing any updates.
|
||||
Details details = Details.createFromParcelableCall(parcelableCall);
|
||||
boolean detailsChanged = !Objects.equals(mDetails, details);
|
||||
@ -1377,7 +1382,7 @@ public final class Call {
|
||||
cannedTextResponsesChanged = true;
|
||||
}
|
||||
|
||||
VideoCallImpl newVideoCallImpl = parcelableCall.getVideoCallImpl();
|
||||
VideoCallImpl newVideoCallImpl = parcelableCall.getVideoCallImpl(mCallingPackage);
|
||||
boolean videoCallChanged = parcelableCall.isVideoCallProviderChanged() &&
|
||||
!Objects.equals(mVideoCallImpl, newVideoCallImpl);
|
||||
if (videoCallChanged) {
|
||||
|
Reference in New Issue
Block a user