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

Commit bbb9b5b5 authored by Hai Zhang's avatar Hai Zhang Committed by Android (Google) Code Review
Browse files

Merge "Add necessary system APIs for moving role into module."

parents 484fd833 84705c4a
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -40,6 +40,22 @@ package android.app.role {

}

package android.content {

  public abstract class Context {
    method @NonNull public android.os.UserHandle getUser();
  }

}

package android.content.pm {

  public abstract class PackageManager {
    method @NonNull public String getPermissionControllerPackageName();
  }

}

package android.content.rollback {

  public class RollbackManagerFrameworkInitializer {
+2 −2
Original line number Diff line number Diff line
@@ -630,7 +630,7 @@ package android.content {
  public abstract class Context {
    method @NonNull public java.io.File getCrateDir(@NonNull String);
    method public abstract int getDisplayId();
    method public android.os.UserHandle getUser();
    method @NonNull public android.os.UserHandle getUser();
    method public int getUserId();
    method public void setAutofillOptions(@Nullable android.content.AutofillOptions);
    method public void setContentCaptureOptions(@Nullable android.content.ContentCaptureOptions);
@@ -685,7 +685,7 @@ package android.content.pm {
    method public abstract int getInstallReason(@NonNull String, @NonNull android.os.UserHandle);
    method @NonNull public abstract java.util.List<android.content.pm.ApplicationInfo> getInstalledApplicationsAsUser(int, int);
    method @Nullable public abstract String[] getNamesForUids(int[]);
    method @NonNull public abstract String getPermissionControllerPackageName();
    method @NonNull public String getPermissionControllerPackageName();
    method @NonNull public abstract String getServicesSystemSharedLibraryPackageName();
    method @NonNull public abstract String getSharedSystemSharedLibraryPackageName();
    method @Nullable public String getSystemTextClassifierPackageName();
+6 −1
Original line number Diff line number Diff line
@@ -5919,9 +5919,14 @@ public abstract class Context {
            throws PackageManager.NameNotFoundException;

    /**
     * Get the user associated with this context
     * Get the user associated with this context.
     *
     * @return the user associated with this context
     *
     * @hide
     */
    @NonNull
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    @TestApi
    public UserHandle getUser() {
        return android.os.Process.myUserHandle();
+6 −4
Original line number Diff line number Diff line
@@ -4829,15 +4829,17 @@ public abstract class PackageManager {
    /**
     * Gets the package name of the component controlling runtime permissions.
     *
     * @return The package name.
     * @return the package name of the component controlling runtime permissions
     *
     * @hide
     */
    @SuppressWarnings("HiddenAbstractMethod")
    @UnsupportedAppUsage
    @NonNull
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    @TestApi
    public abstract String getPermissionControllerPackageName();
    @UnsupportedAppUsage
    public String getPermissionControllerPackageName() {
        throw new RuntimeException("Not implemented. Must override in a subclass.");
    }

    /**
     * Add a new dynamic permission to the system.  For this to work, your
+11 −1
Original line number Diff line number Diff line
@@ -8802,9 +8802,19 @@ public class PackageManagerService extends IPackageManager.Stub
    @Override
    public String getPermissionControllerPackageName() {
        synchronized (mLock) {
            if (mRequiredPermissionControllerPackage != null) {
                final PackageSetting ps = getPackageSetting(mRequiredPermissionControllerPackage);
                if (ps != null) {
                    final int callingUid = Binder.getCallingUid();
                    final int callingUserId = UserHandle.getUserId(callingUid);
                    if (!shouldFilterApplicationLocked(ps, callingUid, callingUserId)) {
                        return mRequiredPermissionControllerPackage;
                    }
                }
            }
            throw new IllegalStateException("PermissionController is not found");
        }
    }
    String getPackageInstallerPackageName() {
        synchronized (mLock) {
Loading