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

Commit 48fc85d7 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by android-build-merger
Browse files

Merge "resolve merge conflicts of 95330efa to nyc-dev-plus-aosp" into nyc-dev-plus-aosp

am: 1b82a4e5

* commit '1b82a4e5':
  Suppress output for Protobuf data if Bluetooth is disabled
parents f2b52ec5 1b82a4e5
Loading
Loading
Loading
Loading
+17 −10
Original line number Diff line number Diff line
@@ -1671,16 +1671,23 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
    }

    @Override
    public void dump(FileDescriptor fd, PrintWriter writer, String args[]) {
    public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
        String errorMsg = null;
        if (mBluetoothBinder == null) {
        writer.println("Bluetooth Service not connected");
            errorMsg = "Bluetooth Service not connected";
        } else {
            try {
                mBluetoothBinder.dump(fd, args);
            } catch (RemoteException re) {
          writer.println("RemoteException while calling Bluetooth Service");
                errorMsg = "RemoteException while calling Bluetooth Service";
            }
        }
        if (errorMsg != null) {
            // Silently return if we are extracting metrics in Protobuf format
            if ((args.length > 0) && args[0].startsWith("--proto"))
                return;
            writer.println(errorMsg);
        }
    }
}