OSDN Git Service
(root)
/
android-x86
/
frameworks-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b72a0f
)
DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name
author
Hansong Zhang
<hsz@google.com>
Thu, 26 Apr 2018 21:22:39 +0000
(14:22 -0700)
committer
hamzeh
<hamzeh@google.com>
Wed, 16 May 2018 00:35:08 +0000
(17:35 -0700)
Test: manual
Bug:
73173182
Change-Id: I7f2201cab36adf7f01d1a794d783cb78a536811f
(cherry picked from commit
24da173b63b17a0bc6c80b2fcfefa7fe4574a15b
)
core/java/android/bluetooth/BluetoothDevice.java
patch
|
blob
|
history
diff --git
a/core/java/android/bluetooth/BluetoothDevice.java
b/core/java/android/bluetooth/BluetoothDevice.java
index
98cd319
..
9498f12
100644
(file)
--- a/
core/java/android/bluetooth/BluetoothDevice.java
+++ b/
core/java/android/bluetooth/BluetoothDevice.java
@@
-808,7
+808,11
@@
public final class BluetoothDevice implements Parcelable {
return null;
}
try {
- return service.getRemoteName(this);
+ String name = service.getRemoteName(this);
+ if (name != null) {
+ return name.replaceAll("[\\t\\n\\r]+", " ");
+ }
+ return null;
} catch (RemoteException e) {
Log.e(TAG, "", e);
}