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

Commit cd7695dd authored by George Hodulik's avatar George Hodulik
Browse files

Add a new "appPredictor" protection flag.

Permissions that have the new apppredictor protection flag will
be granted to the app predictor app, which is AiAi for Pixels.

The MANAGE_APP_PREDICTIONS permission is updated to use the
app predictor flag.

App Predictor for Pixels already set in ag/6019430.
Some one-off handling for app predictor already added in
ag/6025266 and ag/6025267. This cl adds the appPredictor flag.

Test: Tested manually that it worked.
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Bug:123599542

Change-Id: I0550930f78fdb57eea8680762c9b313a330968b6
parent 00394061
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1639,6 +1639,7 @@ package android.content.pm {
  public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    field public static final int FLAG_REMOVED = 2; // 0x2
    field public static final int PROTECTION_FLAG_APP_PREDICTOR = 2097152; // 0x200000
    field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000
    field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000
    field public static final int PROTECTION_FLAG_INCIDENT_REPORT_APPROVER = 1048576; // 0x100000
+1 −0
Original line number Diff line number Diff line
@@ -521,6 +521,7 @@ package android.content.pm {
  }

  public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    field public static final int PROTECTION_FLAG_APP_PREDICTOR = 2097152; // 0x200000
    field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000
    field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000
    field public static final int PROTECTION_FLAG_INCIDENT_REPORT_APPROVER = 1048576; // 0x100000
+9 −0
Original line number Diff line number Diff line
@@ -3016,6 +3016,15 @@ public class ApplicationPackageManager extends PackageManager {
        }
    }

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

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

    String getWellbeingPackageName();

    String getAppPredictionServicePackageName();

    String getContentCaptureServicePackageName();

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

    /**
     * @return the system defined app predictor package name, or null if there's none.
     *
     * @hide
     */
    public String getAppPredictionServicePackageName() {
        throw new UnsupportedOperationException(
            "getAppPredictionServicePackageName not implemented in subclass");
    }

    /**
     * @return the system defined content capture service package name, or null if there's none.
     *
Loading