Merge "[Media Device] Add null check to avoid npe for compareTo method" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
75948e85b8
@@ -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