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

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

Merge "Grants camera permission to Attention Service."

parents 75b182c0 8915b35f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3048,6 +3048,15 @@ public class ApplicationPackageManager extends PackageManager {
        }
    }

    @Override
    public String getAttentionServicePackageName() {
        try {
            return mPM.getAttentionServicePackageName();
        } catch (RemoteException e) {
            throw e.rethrowAsRuntimeException();
        }
    }

    @Override
    public String getWellbeingPackageName() {
        try {
+2 −0
Original line number Diff line number Diff line
@@ -740,6 +740,8 @@ interface IPackageManager {

    String getSystemTextClassifierPackageName();

    String getAttentionServicePackageName();

    String getWellbeingPackageName();

    String getAppPredictionServicePackageName();
+10 −0
Original line number Diff line number Diff line
@@ -6996,6 +6996,16 @@ public abstract class PackageManager {
                "getSystemTextClassifierPackageName not implemented in subclass");
    }

    /**
     * @return  attention service package name, or null if there's none.
     *
     * @hide
     */
    public String getAttentionServicePackageName() {
        throw new UnsupportedOperationException(
                "getAttentionServicePackageName not implemented in subclass");
    }

    /**
     * @return the wellbeing app package name, or null if it's not defined by the OEM.
     *
+5 −0
Original line number Diff line number Diff line
@@ -20272,6 +20272,11 @@ public class PackageManagerService extends IPackageManager.Stub
        return mContext.getString(R.string.config_defaultTextClassifierPackage);
    }
    @Override
    public String getAttentionServicePackageName() {
        return mContext.getString(R.string.config_defaultAttentionService);
    }
    private @Nullable String getDocumenterPackageName() {
        final Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
        intent.addCategory(Intent.CATEGORY_OPENABLE);
+8 −0
Original line number Diff line number Diff line
@@ -740,6 +740,14 @@ public final class DefaultPermissionGrantPolicy {
                    LOCATION_PERMISSIONS, CONTACTS_PERMISSIONS);
        }

        // Atthention Service
        String attentionServicePackageName =
                mContext.getPackageManager().getAttentionServicePackageName();
        if (!TextUtils.isEmpty(attentionServicePackageName)) {
            grantPermissionsToSystemPackage(attentionServicePackageName, userId,
                    CAMERA_PERMISSIONS);
        }

        // There is no real "marker" interface to identify the shared storage backup, it is
        // hardcoded in BackupManagerService.SHARED_BACKUP_AGENT_PACKAGE.
        grantSystemFixedPermissionsToSystemPackage("com.android.sharedstoragebackup", userId,
Loading