Add missing api flags in package manager
Add missing API flags to readInstallInfo and calculateInstalledSize in
PackageInstaller. These API were added to read install related
informaion from an APK file
Bug: 301713559
Test: presubmit
Change-Id: I89339410a5e0474f63ec5b09bf6331f85c87d4b2
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 275fe77..01821fd 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -3867,7 +3867,7 @@
public class PackageInstaller {
method @NonNull public android.content.pm.PackageInstaller.InstallInfo readInstallInfo(@NonNull java.io.File, int) throws android.content.pm.PackageInstaller.PackageParsingException;
- method @NonNull public android.content.pm.PackageInstaller.InstallInfo readInstallInfo(@NonNull android.os.ParcelFileDescriptor, @Nullable String, int) throws android.content.pm.PackageInstaller.PackageParsingException;
+ method @FlaggedApi("android.content.pm.read_install_info") @NonNull public android.content.pm.PackageInstaller.InstallInfo readInstallInfo(@NonNull android.os.ParcelFileDescriptor, @Nullable String, int) throws android.content.pm.PackageInstaller.PackageParsingException;
method @FlaggedApi("android.content.pm.archiving") @RequiresPermission(anyOf={android.Manifest.permission.INSTALL_PACKAGES, android.Manifest.permission.REQUEST_INSTALL_PACKAGES}) public void reportUnarchivalStatus(int, int, long, @Nullable android.app.PendingIntent) throws android.content.pm.PackageManager.NameNotFoundException;
method @FlaggedApi("android.content.pm.archiving") @RequiresPermission(anyOf={android.Manifest.permission.DELETE_PACKAGES, android.Manifest.permission.REQUEST_DELETE_PACKAGES}) public void requestArchive(@NonNull String, @NonNull android.content.IntentSender) throws android.content.pm.PackageManager.NameNotFoundException;
method @FlaggedApi("android.content.pm.archiving") @RequiresPermission(anyOf={android.Manifest.permission.INSTALL_PACKAGES, android.Manifest.permission.REQUEST_INSTALL_PACKAGES}) public void requestUnarchive(@NonNull String, @NonNull android.content.IntentSender) throws java.io.IOException, android.content.pm.PackageManager.NameNotFoundException;
@@ -3902,7 +3902,7 @@
public static class PackageInstaller.InstallInfo {
method public long calculateInstalledSize(@NonNull android.content.pm.PackageInstaller.SessionParams) throws java.io.IOException;
- method public long calculateInstalledSize(@NonNull android.content.pm.PackageInstaller.SessionParams, @NonNull android.os.ParcelFileDescriptor) throws java.io.IOException;
+ method @FlaggedApi("android.content.pm.read_install_info") public long calculateInstalledSize(@NonNull android.content.pm.PackageInstaller.SessionParams, @NonNull android.os.ParcelFileDescriptor) throws java.io.IOException;
method public int getInstallLocation();
method @NonNull public String getPackageName();
}
diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java
index 4f0bfc7..6df1f60 100644
--- a/core/java/android/content/pm/PackageInstaller.java
+++ b/core/java/android/content/pm/PackageInstaller.java
@@ -2337,6 +2337,7 @@
*/
@SystemApi
@NonNull
+ @FlaggedApi(Flags.FLAG_READ_INSTALL_INFO)
public InstallInfo readInstallInfo(@NonNull ParcelFileDescriptor pfd,
@Nullable String debugPathName, int flags) throws PackageParsingException {
final ParseTypeImpl input = ParseTypeImpl.forDefaultParsing();
@@ -2516,6 +2517,7 @@
* and all relevant native code.
* @throws IOException when size of native binaries cannot be calculated.
*/
+ @FlaggedApi(Flags.FLAG_READ_INSTALL_INFO)
public long calculateInstalledSize(@NonNull SessionParams params,
@NonNull ParcelFileDescriptor pfd) throws IOException {
return InstallLocationUtils.calculateInstalledSize(mPkg, params.abiOverride,
diff --git a/core/java/android/content/pm/flags.aconfig b/core/java/android/content/pm/flags.aconfig
index bb5fdb7..a565f68 100644
--- a/core/java/android/content/pm/flags.aconfig
+++ b/core/java/android/content/pm/flags.aconfig
@@ -87,3 +87,10 @@
description: "Feature flag to detect the invisible labels in Launcher Apps"
bug: "299586370"
}
+
+flag {
+ name: "read_install_info"
+ namespace: "package_manager_service"
+ description: "Feature flag to read install related information from an APK."
+ bug: "275658500"
+}