Merge change 7449
* changes: b/1818390 Show Computer and Phone icons on such devices even if they support A2DP or HSP
This commit is contained in:
@@ -578,23 +578,19 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getBtClassDrawable() {
|
public int getBtClassDrawable() {
|
||||||
|
|
||||||
// First try looking at profiles
|
|
||||||
if (mProfiles.contains(Profile.A2DP)) {
|
|
||||||
return R.drawable.ic_bt_headphones_a2dp;
|
|
||||||
} else if (mProfiles.contains(Profile.HEADSET)) {
|
|
||||||
return R.drawable.ic_bt_headset_hfp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback on class
|
|
||||||
switch (BluetoothClass.Device.Major.getDeviceMajor(mBtClass)) {
|
switch (BluetoothClass.Device.Major.getDeviceMajor(mBtClass)) {
|
||||||
case BluetoothClass.Device.Major.COMPUTER:
|
case BluetoothClass.Device.Major.COMPUTER:
|
||||||
return R.drawable.ic_bt_laptop;
|
return R.drawable.ic_bt_laptop;
|
||||||
|
|
||||||
case BluetoothClass.Device.Major.PHONE:
|
case BluetoothClass.Device.Major.PHONE:
|
||||||
return R.drawable.ic_bt_cellphone;
|
return R.drawable.ic_bt_cellphone;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
if (mProfiles.contains(Profile.A2DP)) {
|
||||||
|
return R.drawable.ic_bt_headphones_a2dp;
|
||||||
|
} else if (mProfiles.contains(Profile.HEADSET)) {
|
||||||
|
return R.drawable.ic_bt_headset_hfp;
|
||||||
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user