Class ShadowBluetoothHeadset


  • @NotThreadSafe
    @Implements(android.bluetooth.BluetoothHeadset.class)
    public class ShadowBluetoothHeadset
    extends java.lang.Object
    Shadow for BluetoothHeadset
    • Constructor Detail

      • ShadowBluetoothHeadset

        public ShadowBluetoothHeadset()
    • Method Detail

      • addConnectedDevice

        public void addConnectedDevice​(android.bluetooth.BluetoothDevice device)
        Adds the given BluetoothDevice to the shadow's list of "connected devices"
      • startVoiceRecognition

        @Implementation
        protected boolean startVoiceRecognition​(android.bluetooth.BluetoothDevice bluetoothDevice)
        Overrides behavior of startVoiceRecognition(android.bluetooth.BluetoothDevice). Returns false if 'bluetoothDevice' is null or voice recognition is already started. Users can listen to ACTION_AUDIO_STATE_CHANGED. If this function returns true, this intent will be broadcasted once with BluetoothProfile.EXTRA_STATE set to STATE_AUDIO_CONNECTING and once set to STATE_AUDIO_CONNECTED.
      • stopVoiceRecognition

        @Implementation
        protected boolean stopVoiceRecognition​(android.bluetooth.BluetoothDevice bluetoothDevice)
        Overrides the behavior of stopVoiceRecognition(android.bluetooth.BluetoothDevice). Returns false if voice recognition was not started or voice recogntion has already ended on this headset. If this function returns true, ACTION_AUDIO_STATE_CHANGED intent is broadcasted with BluetoothProfile.EXTRA_STATE set to STATE_DISCONNECTED.
      • isAudioConnected

        @Implementation
        protected boolean isAudioConnected​(android.bluetooth.BluetoothDevice bluetoothDevice)
      • setAllowsSendVendorSpecificResultCode

        public void setAllowsSendVendorSpecificResultCode​(boolean allowsSendVendorSpecificResultCode)
        Affects the behavior of BluetoothHeadset.sendVendorSpecificResultCode(android.bluetooth.BluetoothDevice, java.lang.String, java.lang.String)
        Parameters:
        allowsSendVendorSpecificResultCode - can be set to 'false' to simulate the situation where the system is unable to send vendor-specific result codes to a device