Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 690ae049 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Ensure call streaming service requires bind permission.

When binding to the call streaming service, ensure that it has the
required BIND permission.

Bug: 265304561
Test: build; CTS tests
Change-Id: Ib362c254a40edc3b38244bf33ce905810256c737
parent 40286e50
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.telecom;

import static android.telecom.CallStreamingService.STREAMING_FAILED_SENDER_BINDING_ERROR;

import android.Manifest;
import android.annotation.SuppressLint;
import android.app.role.RoleManager;
import android.content.ComponentName;
@@ -206,6 +207,15 @@ public class CallStreamingController extends CallsManagerListenerBase {
            }

            ServiceInfo serviceInfo = infos.get(0).serviceInfo;

            if (serviceInfo.permission == null || !serviceInfo.permission.equals(
                    Manifest.permission.BIND_CALL_STREAMING_SERVICE)) {
                android.telecom.Log.w(TAG, "Must require BIND_CALL_STREAMING_SERVICE: " +
                        serviceInfo.packageName);
                future.complete(new VoipCallTransactionResult(
                        VoipCallTransactionResult.RESULT_FAILED, MESSAGE));
                return future;
            }
            Intent intent = new Intent(CallStreamingService.SERVICE_INTERFACE);
            intent.setComponent(serviceInfo.getComponentName());