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

Commit 0dfa3334 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[CDM perm sync] Add DELIVER_COMPANION_MESSAGE permission check"

parents 8e5f3fb3 309f4d50
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

package com.android.server.companion;

import static android.Manifest.permission.DELIVER_COMPANION_MESSAGES;
import static android.Manifest.permission.MANAGE_COMPANION_DEVICES;
import static android.content.pm.PackageManager.CERT_INPUT_SHA256;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
@@ -621,6 +622,9 @@ public class CompanionDeviceManagerService extends SystemService {
                        + " message(Base64)=" + Base64.encodeToString(message, 0));
            }

            getContext().enforceCallingOrSelfPermission(DELIVER_COMPANION_MESSAGES,
                    "dispatchMessage");

            AssociationInfo association = getAssociationWithCallerChecks(associationId);
            if (association == null) {
                throw new IllegalArgumentException("Association with ID " + associationId + " "