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);
|
boolean hasSystemFeature(String name, int version);
|
||||||
|
|
||||||
|
List<String> getInitialNonStoppedSystemPackages();
|
||||||
|
|
||||||
void enterSafeMode();
|
void enterSafeMode();
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
boolean isSafeMode();
|
boolean isSafeMode();
|
||||||
|
|||||||
@@ -5257,6 +5257,12 @@ public class PackageManagerService implements PackageSender, TestUtilityService
|
|||||||
return new ParceledListSlice<>(res);
|
return new ParceledListSlice<>(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NonNull List<String> getInitialNonStoppedSystemPackages() {
|
||||||
|
return mInitialNonStoppedSystemPackages != null
|
||||||
|
? new ArrayList<>(mInitialNonStoppedSystemPackages) : new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getUnsuspendablePackagesForUser(String[] packageNames, int userId) {
|
public String[] getUnsuspendablePackagesForUser(String[] packageNames, int userId) {
|
||||||
Objects.requireNonNull(packageNames, "packageNames cannot be null");
|
Objects.requireNonNull(packageNames, "packageNames cannot be null");
|
||||||
|
|||||||
@@ -782,6 +782,8 @@ class PackageManagerShellCommand extends ShellCommand {
|
|||||||
getInFileDescriptor(), getOutFileDescriptor(), getErrFileDescriptor(),
|
getInFileDescriptor(), getOutFileDescriptor(), getErrFileDescriptor(),
|
||||||
new String[] { "list" }, getShellCallback(), adoptResultReceiver());
|
new String[] { "list" }, getShellCallback(), adoptResultReceiver());
|
||||||
return 0;
|
return 0;
|
||||||
|
case "initial-non-stopped-system-packages":
|
||||||
|
return runListInitialNonStoppedSystemPackages();
|
||||||
}
|
}
|
||||||
pw.println("Error: unknown list type '" + type + "'");
|
pw.println("Error: unknown list type '" + type + "'");
|
||||||
return -1;
|
return -1;
|
||||||
@@ -794,6 +796,21 @@ class PackageManagerShellCommand extends ShellCommand {
|
|||||||
return 0;
|
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 {
|
private int runListFeatures() throws RemoteException {
|
||||||
final PrintWriter pw = getOutPrintWriter();
|
final PrintWriter pw = getOutPrintWriter();
|
||||||
final List<FeatureInfo> list = mInterface.getSystemAvailableFeatures().getList();
|
final List<FeatureInfo> list = mInterface.getSystemAvailableFeatures().getList();
|
||||||
|
|||||||
Reference in New Issue
Block a user