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

Commit 7b12c385 authored by Sergey Nikolaienkov's avatar Sergey Nikolaienkov
Browse files

Fix checkUsesFeature() in CdmService

Bug: 208258862
Test: make, flash, monitor logcat
Test: atest CtsCompanionDevicesTestCases
Change-Id: I3780f8171b7fc5b77c811b5683d0e01742a392dd
parent 5857a0d8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.bluetooth.le.ScanSettings.SCAN_MODE_BALANCED;
import static android.content.pm.PackageManager.CERT_INPUT_SHA256;
import static android.content.pm.PackageManager.FEATURE_COMPANION_DEVICE_SETUP;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.Binder.getCallingUid;
import static android.os.Process.SYSTEM_UID;
import static android.os.UserHandle.getCallingUserId;

@@ -1257,7 +1258,7 @@ public class CompanionDeviceManagerService extends SystemService {
    }

    void checkUsesFeature(@NonNull String pkg, @UserIdInt int userId) {
        if (getCallingUserId() == SYSTEM_UID) return;
        if (getCallingUid() == SYSTEM_UID) return;

        final FeatureInfo[] requestedFeatures = getPackageInfo(pkg, userId).reqFeatures;
        if (requestedFeatures != null) {