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

Commit 66a2bdb3 authored by Nadav Bar's avatar Nadav Bar Committed by Android (Google) Code Review
Browse files

Merge "Grant record audio permission to SystemCaptionsService instead of ContentCaptureService"

parents 214679b5 1a1f5a21
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3054,9 +3054,9 @@ public class ApplicationPackageManager extends PackageManager {
    }

    @Override
    public String getContentCaptureServicePackageName() {
    public String getSystemCaptionsServicePackageName() {
        try {
            return mPM.getContentCaptureServicePackageName();
            return mPM.getSystemCaptionsServicePackageName();
        } catch (RemoteException e) {
            throw e.rethrowAsRuntimeException();
        }
+1 −1
Original line number Diff line number Diff line
@@ -742,7 +742,7 @@ interface IPackageManager {

    String getAppPredictionServicePackageName();

    String getContentCaptureServicePackageName();
    String getSystemCaptionsServicePackageName();

    String getIncidentReportApproverPackageName();

+2 −2
Original line number Diff line number Diff line
@@ -6863,9 +6863,9 @@ public abstract class PackageManager {
     *
     * @hide
     */
    public String getContentCaptureServicePackageName() {
    public String getSystemCaptionsServicePackageName() {
        throw new UnsupportedOperationException(
                "getContentCaptureServicePackageName not implemented in subclass");
                "getSystemCaptionsServicePackageName not implemented in subclass");
    }

    /**
+8 −9
Original line number Diff line number Diff line
@@ -20173,21 +20173,20 @@ public class PackageManagerService extends IPackageManager.Stub
    }
    @Override
    public String getContentCaptureServicePackageName() {
        String contentCaptureServiceName =
                mContext.getString(R.string.config_defaultContentCaptureService);
    public String getSystemCaptionsServicePackageName() {
        String flattenedSystemCaptionsServiceComponentName =
                mContext.getString(R.string.config_defaultSystemCaptionsService);
        if (TextUtils.isEmpty(contentCaptureServiceName)) {
        if (TextUtils.isEmpty(flattenedSystemCaptionsServiceComponentName)) {
            return null;
        }
        int separatorIndex = contentCaptureServiceName.indexOf("/");
        if (separatorIndex < 0) {
        ComponentName systemCaptionsServiceComponentName =
                ComponentName.unflattenFromString(flattenedSystemCaptionsServiceComponentName);
        if (systemCaptionsServiceComponentName == null) {
            return null;
        }
        return contentCaptureServiceName.substring(0, separatorIndex);
        return systemCaptionsServiceComponentName.getPackageName();
    }
    public String getIncidentReportApproverPackageName() {
+5 −5
Original line number Diff line number Diff line
@@ -748,11 +748,11 @@ public final class DefaultPermissionGrantPolicy {
        grantSystemFixedPermissionsToSystemPackage("com.android.sharedstoragebackup", userId,
                STORAGE_PERMISSIONS);

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

Loading