dump method should accept --proto and --debug flag regardless of the order

Bug:69006241

Change-Id: Idca9c65fbd1842c6bee7999ee9921cf4806c4328
This commit is contained in:
Hyunyoung Song
2017-11-16 16:07:14 -08:00
parent 4c7f215651
commit 8fe56a6a7d
@@ -118,9 +118,9 @@ public class BgDataModel {
deepShortcutMap.clear();
}
public synchronized void dump(String prefix, FileDescriptor fd, PrintWriter writer,
String[] args) {
if (args.length > 0 && TextUtils.equals(args[0], "--proto")) {
public synchronized void dump(String prefix, FileDescriptor fd, PrintWriter writer,
String[] args) {
if (Arrays.asList(args).contains("--proto")) {
dumpProto(prefix, fd, writer, args);
return;
}
@@ -219,7 +219,7 @@ public class BgDataModel {
targetList.addAll(workspaces.valueAt(i).getFlattenedList());
}
if (args.length > 1 && TextUtils.equals(args[1], "--debug")) {
if (Arrays.asList(args).contains("--debug")) {
for (int i = 0; i < targetList.size(); i++) {
writer.println(prefix + DumpTargetWrapper.getDumpTargetStr(targetList.get(i)));
}