public
final
class
SensorPrivacyManager
extends Object
This class provides information about the microphone and camera toggles.
Summary
Nested classes | |
|---|---|
class |
SensorPrivacyManager.Sensors
Sensor constants which are used in |
Constants | |
|---|---|
int |
TOGGLE_TYPE_HARDWARE
Constant for hardware toggle. |
int |
TOGGLE_TYPE_SOFTWARE
Constant for software toggle. |
Public methods | |
|---|---|
boolean
|
supportsSensorToggle(int sensor)
Checks if the given toggle is supported on this device |
boolean
|
supportsSensorToggle(int toggleType, int sensor)
Checks if the given toggle is supported on this device |
Inherited methods | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
| |||||||||||||||||||||||
Constants
TOGGLE_TYPE_HARDWARE
Added in API level 33
public static final int TOGGLE_TYPE_HARDWARE
Constant for hardware toggle.
Constant Value: 2 (0x00000002)
TOGGLE_TYPE_SOFTWARE
Added in API level 33
public static final int TOGGLE_TYPE_SOFTWARE
Constant for software toggle.
Constant Value: 1 (0x00000001)
Public methods
supportsSensorToggle
Added in API level 31
public boolean supportsSensorToggle (int sensor)
Checks if the given toggle is supported on this device
| Parameters | |
|---|---|
sensor |
int: The sensor to check.
Value is one of the following: |
| Returns | |
|---|---|
boolean |
whether the toggle for the sensor is supported on this device. |
supportsSensorToggle
Added in API level 33
public boolean supportsSensorToggle (int toggleType,
int sensor)
Checks if the given toggle is supported on this device
| Parameters | |
|---|---|
toggleType |
int: Value is one of the following:
|
sensor |
int: The sensor to check.
Value is one of the following: |
| Returns | |
|---|---|
boolean |
whether the toggle for the sensor is supported on this device. |