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

Commit c188069f authored by Jaewan Kim's avatar Jaewan Kim Committed by Android (Google) Code Review
Browse files

Merge "AML: Make Context#getOpPackageName() public"

parents 5f0c9331 0980c7f0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -9556,6 +9556,7 @@ package android.content {
    method public abstract java.io.File getNoBackupFilesDir();
    method public abstract java.io.File getObbDir();
    method public abstract java.io.File[] getObbDirs();
    method public abstract java.lang.String getOpPackageName();
    method public abstract java.lang.String getPackageCodePath();
    method public abstract android.content.pm.PackageManager getPackageManager();
    method public abstract java.lang.String getPackageName();
@@ -9766,6 +9767,7 @@ package android.content {
    method public java.io.File getNoBackupFilesDir();
    method public java.io.File getObbDir();
    method public java.io.File[] getObbDirs();
    method public java.lang.String getOpPackageName();
    method public java.lang.String getPackageCodePath();
    method public android.content.pm.PackageManager getPackageManager();
    method public java.lang.String getPackageName();
+0 −5
Original line number Diff line number Diff line
@@ -305,16 +305,11 @@ package android.content {

  public abstract class Context {
    method public android.content.Context createPackageContextAsUser(java.lang.String, int, android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract java.lang.String getOpPackageName();
    method public android.os.UserHandle getUser();
    method public int getUserId();
    method public void setAutofillCompatibilityEnabled(boolean);
  }

  public class ContextWrapper extends android.content.Context {
    method public java.lang.String getOpPackageName();
  }

}

package android.content.pm {
+13 −7
Original line number Diff line number Diff line
@@ -741,16 +741,22 @@ public abstract class Context {
    /** Return the name of this application's package. */
    public abstract String getPackageName();

    /** @hide Return the name of the base context this context is derived from. */
    /**
     * @hide Return the name of the base context this context is derived from.
     * This is the same as {@link #getOpPackageName()} except in
     * cases where system components are loaded into other app processes, in which
     * case {@link #getOpPackageName()} will be the name of the primary package in
     * that process (so that app ops uid verification will work with the name).
     */
    @UnsupportedAppUsage
    public abstract String getBasePackageName();

    /** @hide Return the package name that should be used for app ops calls from
     * this context.  This is the same as {@link #getBasePackageName()} except in
     * cases where system components are loaded into other app processes, in which
     * case this will be the name of the primary package in that process (so that app
     * ops uid verification will work with the name). */
    @TestApi
    /**
     * Return the package name that should be used for {@link android.app.AppOpsManager} calls from
     * this context, so that app ops manager's uid verification will work with the name.
     * <p>
     * This is not generally intended for third party application developers.
     */
    public abstract String getOpPackageName();

    /** Return the full application info for this context's package. */
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ package android.test.mock {
    method public java.io.File getNoBackupFilesDir();
    method public java.io.File getObbDir();
    method public java.io.File[] getObbDirs();
    method public java.lang.String getOpPackageName();
    method public java.lang.String getPackageCodePath();
    method public android.content.pm.PackageManager getPackageManager();
    method public java.lang.String getPackageName();
+0 −4
Original line number Diff line number Diff line
package android.test.mock {

  public class MockContext extends android.content.Context {
    method public java.lang.String getOpPackageName();
  }

  public deprecated class MockPackageManager extends android.content.pm.PackageManager {
    method public boolean arePermissionsIndividuallyControlled();
    method public java.lang.String getDefaultBrowserPackageNameAsUser(int);