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

Commit 6bd37ba7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Sanitize Bluetooth device names without regex"

parents 1a307062 1add9f0b
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -1025,7 +1025,11 @@ public final class BluetoothDevice implements Parcelable {
        try {
        try {
            String name = service.getRemoteName(this);
            String name = service.getRemoteName(this);
            if (name != null) {
            if (name != null) {
                return name.replaceAll("[\\t\\n\\r]+", " ");
                // remove whitespace characters from the name
                return name
                        .replace('\t', ' ')
                        .replace('\n', ' ')
                        .replace('\r', ' ');
            }
            }
            return null;
            return null;
        } catch (RemoteException e) {
        } catch (RemoteException e) {