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

Commit aa8a4550 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Automerger Merge Worker
Browse files

Merge "Mark all installations using PMSC as "ADB"." into tm-dev am: f1843b54

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17215174

Change-Id: Id566e2d91ef4a79b9f84c5045a2756a0cdd5624a
parents c01295c3 f1843b54
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import static android.content.pm.PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
import static android.content.pm.PackageManager.INSTALL_FAILED_INVALID_APK;
import static android.content.pm.PackageManager.INSTALL_FAILED_MEDIA_UNAVAILABLE;
import static android.content.pm.PackageManager.INSTALL_FAILED_MISSING_SPLIT;
import static android.content.pm.PackageManager.INSTALL_FROM_ADB;
import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_NO_CERTIFICATES;
import static android.content.pm.PackageManager.INSTALL_STAGED;
import static android.content.pm.PackageManager.INSTALL_SUCCEEDED;
@@ -956,13 +957,18 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
                        "DataLoader installation of APEX modules is not allowed.");
            }

            if (isSystemDataLoaderInstallation() && mContext.checkCallingOrSelfPermission(
            if (isSystemDataLoaderInstallation()) {
                if (mContext.checkCallingOrSelfPermission(
                        Manifest.permission.USE_SYSTEM_DATA_LOADERS)
                        != PackageManager.PERMISSION_GRANTED) {
                    throw new SecurityException("You need the "
                            + "com.android.permission.USE_SYSTEM_DATA_LOADERS permission "
                            + "to use system data loaders");
                }

                // All installations using system dataloaders marked as ADB.
                this.params.installFlags |= INSTALL_FROM_ADB;
            }
        }

        if (isIncrementalInstallation() && !IncrementalManager.isAllowed()) {