Merge "[Media Device] Add null check to avoid npe for compareTo method" into tm-dev am: 75948e85b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17938076 Change-Id: If580f5a46ae3a7f05d12af07e034d03f40dcad8f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -332,6 +332,9 @@ public abstract class MediaDevice implements Comparable<MediaDevice> {
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(MediaDevice another) {
|
||||
if (another == null) {
|
||||
return -1;
|
||||
}
|
||||
// Check Bluetooth device is have same connection state
|
||||
if (isConnected() ^ another.isConnected()) {
|
||||
if (isConnected()) {
|
||||
|
||||
Reference in New Issue
Block a user