Merge "Support showing initial non stopped system packages" into udc-dev
This commit is contained in:
@@ -502,6 +502,8 @@ interface IPackageManager {
|
||||
|
||||
boolean hasSystemFeature(String name, int version);
|
||||
|
||||
List<String> getInitialNonStoppedSystemPackages();
|
||||
|
||||
void enterSafeMode();
|
||||
@UnsupportedAppUsage
|
||||
boolean isSafeMode();
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user