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

Commit d204b333 authored by Jack He's avatar Jack He Committed by android-build-merger
Browse files

Merge "Metrics: Remove handler for --proto-java-bin flag in dumpsys"

am: 699a2e66

Change-Id: I9e59c4d87f1cc4a40090dad7447339354e211245
parents e5dcb750 699a2e66
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -2493,20 +2493,8 @@ public class AdapterService extends Service {
        }

        verboseLog("dumpsys arguments, check for protobuf output: " + TextUtils.join(" ", args));
        if (args[0].startsWith("--proto")) {
        if (args[0].equals("--proto-bin")) {
            dumpMetrics(fd);
            } else if (args[0].equals("--proto-java-bin")) {
                // TODO: Remove once --proto-java-bin is no longer used
                BluetoothProto.BluetoothLog metrics = new BluetoothProto.BluetoothLog();
                byte[] metricsBytes = Base64.encode(metrics.toByteArray(), Base64.DEFAULT);
                Log.w(TAG, "proto-java-bin dump, empty metrics size is " + metricsBytes.length);
                try (FileOutputStream protoOut = new FileOutputStream(fd)) {
                    protoOut.write(metricsBytes);
                } catch (IOException e) {
                    errorLog("Unable to write Java protobuf to file descriptor.");
                }
            }
            return;
        }