Change the title when in call/media state

* Change the title when in call/media state.
  Example: call state show "Available call devices"
           media state show "Available media devices"
* Use isAudioModeOngoingCall() utility function for checking if it is in call status
* Add register test to verify when in onStart() and onStop()
  the BluetoothCallback can be register and unregister.
* Add title string test to verify when in call or media state,
  the title can be changed to corresponding string

Bug: 78150641
Test: make -j40 RunSettingsRoboTests
Change-Id: I6be72cf0cae75525084ac3c5be8524c709f51f7d
Merged-In: I6be72cf0cae75525084ac3c5be8524c709f51f7d
This commit is contained in:
hughchen
2018-04-17 16:36:58 +08:00
committed by Hugh Chen
parent 7309dddaa3
commit 50d5c0a544
5 changed files with 118 additions and 11 deletions

View File

@@ -20,6 +20,8 @@ import static android.media.AudioManager.STREAM_MUSIC;
import static android.media.AudioSystem.DEVICE_OUT_REMOTE_SUBMIX;
import static android.media.AudioSystem.DEVICE_OUT_USB_HEADSET;
import com.android.settingslib.Utils;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.media.AudioManager;
@@ -57,7 +59,7 @@ public class MediaOutputPreferenceController extends AudioSwitchPreferenceContro
return;
}
if (isOngoingCallStatus()) {
if (Utils.isAudioModeOngoingCall(mContext)) {
// Ongoing call status, switch entry for media will be disabled.
mPreference.setVisible(false);
preference.setSummary(