Replace deprecated APIs in audio switcher.
- Remove isWiredHeadsetOn() and isBluetoothA2dpOn() in MediaOutputPreferenceController. - Remove isWiredHeadsetOn() and isBluetoothScoOn() in HandsFreeProfileOutputPreferenceController. - Replace with AudioManager.getDevicesForStream(). - Update test cases. Bug: 78141441 Test: make RunSettingsRoboTests ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j40 Test: make RunSettingsRoboTests ROBOTEST_FILTER="HandsFreeProfileOutputPreferenceControllerTest" -j40 Test: make RunSettingsRoboTests ROBOTEST_FILTER="AudioOutputSwitchPreferenceControllerTest" -j40 Change-Id: Ic57c40badf0fd5633f1b7412d63a0b5417d0f47a
This commit is contained in:
@@ -193,8 +193,12 @@ public abstract class AudioSwitchPreferenceController extends BasePreferenceCont
|
||||
public void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) {
|
||||
}
|
||||
|
||||
protected boolean isStreamFromOutputDevice(int streamType, int device) {
|
||||
return mAudioManager.getDevicesForStream(streamType) == device;
|
||||
}
|
||||
|
||||
protected boolean isOngoingCallStatus() {
|
||||
int audioMode = mAudioManager.getMode();
|
||||
final int audioMode = mAudioManager.getMode();
|
||||
return audioMode == AudioManager.MODE_RINGTONE
|
||||
|| audioMode == AudioManager.MODE_IN_CALL
|
||||
|| audioMode == AudioManager.MODE_IN_COMMUNICATION;
|
||||
|
Reference in New Issue
Block a user