We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

HeadsetStatus

  • Supported devices: phones
  • Supported operating systems: EMUI 7.0 or later and Android 7.0 or later
Expand

Interface Info

public interface HeadsetStatus

Headset status API class, which defines three constants: CONNECTED (indicating that the headset is connected), DISCONNECTED (indicating that the headset is not connected), and UNKNOWN (indicating that the headset status is not identified).

Public Field Summary

Expand

Qualifier and Type

Field and Description

static int

CONNECTED

The headset is connected.

static int

DISCONNECTED

The headset is not connected.

static int

UNKNOWN

The headset status is not identified.

Public Method Summary

Expand

Qualifier and Type

Method Name

abstract int

getStatus()

Public Fields

CONNECTED

Expand

Field

public static final int CONNECTED

The headset is connected.

For details, please refer to Constant-values.

DISCONNECTED

Expand

Field

public static final int DISCONNECTED

The headset is not connected.

For details, please refer to Constant-values.

UNKNOWN

Expand

Field

public static final int UNKNOWN

The headset status is not identified.

For details, please refer to Constant-values.

Public Methods

getStatus

Expand

Method

public abstract int getStatus()

Obtains current handset connection status.

Returns

Expand

Type

Description

int

Headset status (CONNECTED, DISCONNECTED, or UNKNOWN).