Merge "Fix adb shell cmd activity get-config --proto --device fail" am: c0dd0d6648 am: bb5384dbd0
am: f604b8b688
Change-Id: If0cddc5548552e1f78702089da8c6e6fc461814d
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
index fe402ea..9018006 100644
--- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
+++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
@@ -2105,8 +2105,13 @@
}
FeatureInfo[] features = pm.getSystemAvailableFeatures();
- Arrays.sort(features, (o1, o2) ->
- (o1.name == o2.name ? 0 : (o1.name == null ? -1 : o1.name.compareTo(o2.name))));
+ Arrays.sort(features, (o1, o2) -> {
+ if (o1.name == o2.name) return 0;
+ if (o1.name == null) return -1;
+ if (o2.name == null) return 1;
+ return o1.name.compareTo(o2.name);
+ });
+
for (int i = 0; i < features.length; i++) {
if (features[i].name != null) {
if (protoOutputStream != null) {