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

Commit 23922920 authored by Jackal Guo's avatar Jackal Guo Committed by Android (Google) Code Review
Browse files

Merge changes from topics "PM_relinquishUpdateOwnership", "attr_relinquishUpdateOwnership"

* changes:
  Let update owners can relinquish update ownership (5/n)
  Add new manifest attr allowUpdateOwnership (4/n)
parents f7025bf4 ec1c3c01
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -385,6 +385,7 @@ package android {
    field public static final int allowTaskReparenting = 16843268; // 0x1010204
    field public static final int allowUndo = 16843999; // 0x10104df
    field public static final int allowUntrustedActivityEmbedding = 16844393; // 0x1010669
    field public static final int allowUpdateOwnership;
    field public static final int alpha = 16843551; // 0x101031f
    field public static final int alphabeticModifiers = 16844110; // 0x101054e
    field public static final int alphabeticShortcut = 16843235; // 0x10101e3
@@ -12257,6 +12258,7 @@ package android.content.pm {
    method @NonNull public java.util.List<android.content.pm.PackageManager.Property> queryProviderProperty(@NonNull String);
    method @NonNull public java.util.List<android.content.pm.PackageManager.Property> queryReceiverProperty(@NonNull String);
    method @NonNull public java.util.List<android.content.pm.PackageManager.Property> queryServiceProperty(@NonNull String);
    method public void relinquishUpdateOwnership(@NonNull String);
    method @Deprecated public abstract void removePackageFromPreferred(@NonNull String);
    method public abstract void removePermission(@NonNull String);
    method @RequiresPermission(value="android.permission.WHITELIST_RESTRICTED_PERMISSIONS", conditional=true) public boolean removeWhitelistedRestrictedPermission(@NonNull String, @NonNull String, int);
+10 −0
Original line number Diff line number Diff line
@@ -3890,4 +3890,14 @@ public class ApplicationPackageManager extends PackageManager {
        return Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED, 0) == 1;
    }

    @Override
    public void relinquishUpdateOwnership(String targetPackage) {
        Objects.requireNonNull(targetPackage);
        try {
            mPM.relinquishUpdateOwnership(targetPackage);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -214,6 +214,8 @@ interface IPackageManager {
    @UnsupportedAppUsage
    void setInstallerPackageName(in String targetPackage, in String installerPackageName);

    void relinquishUpdateOwnership(in String targetPackage);

    void setApplicationCategoryHint(String packageName, int categoryHint, String callerPackageName);

    /** @deprecated rawr, don't call AIDL methods directly! */
+12 −0
Original line number Diff line number Diff line
@@ -10877,4 +10877,16 @@ public abstract class PackageManager {
        throw new UnsupportedOperationException(
                "isShowNewAppInstalledNotificationEnabled not implemented in subclass");
    }

    /**
     * Attempt to relinquish the update ownership of the given package. Only the current
     * update owner of the given package can use this API or a SecurityException will be
     * thrown.
     *
     * @param targetPackage The installed package whose update owner will be changed.
     */
    public void relinquishUpdateOwnership(@NonNull String targetPackage) {
        throw new UnsupportedOperationException(
                "relinquishUpdateOwnership not implemented in subclass");
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -1783,6 +1783,14 @@
    -->
    <attr name="attributionTags" format="string" />

    <!-- Default value <code>true</code> allows an installer to enable update
         ownership enforcement for this package via {@link
         android.content.pm.PackageInstaller.SessionParams#setRequestUpdateOwnership}
         during initial installation. This overrides the installer's use of {@link
         android.content.pm.PackageInstaller.SessionParams#setRequestUpdateOwnership}.
    -->
    <attr name="allowUpdateOwnership" format="boolean" />

    <!-- The <code>manifest</code> tag is the root of an
         <code>AndroidManifest.xml</code> file,
         describing the contents of an Android package (.apk) file.  One
@@ -1820,6 +1828,7 @@
        <attr name="isSplitRequired" />
        <attr name="requiredSplitTypes" />
        <attr name="splitTypes" />
        <attr name="allowUpdateOwnership" />
    </declare-styleable>

    <!-- The <code>application</code> tag describes application-level components
Loading