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

Commit 9a5003db authored by Omar Eissa's avatar Omar Eissa Committed by Android (Google) Code Review
Browse files

Merge "Support showing initial non stopped system packages" into udc-dev

parents 7db06f85 878e87d2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -502,6 +502,8 @@ interface IPackageManager {

    boolean hasSystemFeature(String name, int version);

    List<String> getInitialNonStoppedSystemPackages();

    void enterSafeMode();
    @UnsupportedAppUsage
    boolean isSafeMode();
+6 −0
Original line number Diff line number Diff line
@@ -5257,6 +5257,12 @@ public class PackageManagerService implements PackageSender, TestUtilityService
            return new ParceledListSlice<>(res);
        }

        @Override
        public @NonNull List<String> getInitialNonStoppedSystemPackages() {
            return mInitialNonStoppedSystemPackages != null
                    ? new ArrayList<>(mInitialNonStoppedSystemPackages) : new ArrayList<>();
        }

        @Override
        public String[] getUnsuspendablePackagesForUser(String[] packageNames, int userId) {
            Objects.requireNonNull(packageNames, "packageNames cannot be null");
+17 −0
Original line number Diff line number Diff line
@@ -782,6 +782,8 @@ class PackageManagerShellCommand extends ShellCommand {
                        getInFileDescriptor(), getOutFileDescriptor(), getErrFileDescriptor(),
                        new String[] { "list" }, getShellCallback(), adoptResultReceiver());
                return 0;
            case "initial-non-stopped-system-packages":
                return runListInitialNonStoppedSystemPackages();
        }
        pw.println("Error: unknown list type '" + type + "'");
        return -1;
@@ -794,6 +796,21 @@ class PackageManagerShellCommand extends ShellCommand {
        return 0;
    }

    private int runListInitialNonStoppedSystemPackages() throws RemoteException {
        final PrintWriter pw = getOutPrintWriter();
        final List<String> list = mInterface.getInitialNonStoppedSystemPackages();

        Collections.sort(list);

        for (String pkgName : list) {
            pw.print("package:");
            pw.print(pkgName);
            pw.println();
        }

        return 0;
    }

    private int runListFeatures() throws RemoteException {
        final PrintWriter pw = getOutPrintWriter();
        final List<FeatureInfo> list = mInterface.getSystemAvailableFeatures().getList();