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

Commit ae884c9d authored by Nikita Dubrovsky's avatar Nikita Dubrovsky
Browse files

Remove manual pregrants for SystemCaptionsService (handled via roles)

DefaultPermissionGrantPolicy was granting the RECORD_AUDIO permission
to the package that provides SystemCaptionsService. This permission is
already managed via roles; specifically it is set in the
`SYSTEM_AUDIO_INTELLIGENCE` role in
PermissionController/res/xml/roles.xml. Therefore the code performing
the pre-grant manually in DefaultPermissionGrantPolicy can be removed.

Bug: 222231605
Test: adb shell dumpsys package com.google.android.as
Test: atest GtsPermissionTestCases:com.google.android.permission.gts.DefaultPermissionGrantPolicyTest#testDefaultGrantsWithRemoteExceptions
Change-Id: I57be6ca431aa00b01ddb14674f555999cdf13acf
parent 7a9cf44c
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ import android.provider.Telephony.Sms.Intents;
import android.security.Credentials;
import android.speech.RecognitionService;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
@@ -909,14 +908,6 @@ final class DefaultPermissionGrantPolicy {
        grantSystemFixedPermissionsToSystemPackage(pm, "com.android.sharedstoragebackup", userId,
                STORAGE_PERMISSIONS);

        // System Captions Service
        String systemCaptionsServicePackageName =
                mContext.getPackageManager().getSystemCaptionsServicePackageName();
        if (!TextUtils.isEmpty(systemCaptionsServicePackageName)) {
            grantPermissionsToSystemPackage(pm, systemCaptionsServicePackageName, userId,
                    MICROPHONE_PERMISSIONS);
        }

        // Bluetooth MIDI Service
        grantSystemFixedPermissionsToSystemPackage(pm,
                MidiManager.BLUETOOTH_MIDI_SERVICE_PACKAGE, userId,