SensorPrivacyManager
  public
  
  final
  
  class
  SensorPrivacyManager
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.hardware.SensorPrivacyManager | 
This class provides information about the microphone and camera toggles.
Summary
| Nested classes | |
|---|---|
| 
        
        
        
        
        class | SensorPrivacyManager.SensorsSensor constants which are used in  | 
| Constants | |
|---|---|
| int | TOGGLE_TYPE_HARDWAREConstant for hardware toggle. | 
| int | TOGGLE_TYPE_SOFTWAREConstant 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 | |
|---|---|
Constants
TOGGLE_TYPE_HARDWARE
public static final int TOGGLE_TYPE_HARDWARE
Constant for hardware toggle.
Constant Value: 2 (0x00000002)
TOGGLE_TYPE_SOFTWARE
public static final int TOGGLE_TYPE_SOFTWARE
Constant for software toggle.
Constant Value: 1 (0x00000001)
Public methods
supportsSensorToggle
public boolean supportsSensorToggle (int sensor)
Checks if the given toggle is supported on this device
| Parameters | |
|---|---|
| sensor | int: The sensor to check
 Value isSensorPrivacyManager.Sensors.MICROPHONE, orSensorPrivacyManager.Sensors.CAMERA | 
| Returns | |
|---|---|
| boolean | whether the toggle for the sensor is supported on this device. | 
supportsSensorToggle
public boolean supportsSensorToggle (int toggleType, 
                int sensor)Checks if the given toggle is supported on this device
| Parameters | |
|---|---|
| toggleType | int: Value isTOGGLE_TYPE_SOFTWARE, orTOGGLE_TYPE_HARDWARE | 
| sensor | int: The sensor to check
 Value isSensorPrivacyManager.Sensors.MICROPHONE, orSensorPrivacyManager.Sensors.CAMERA | 
| Returns | |
|---|---|
| boolean | whether the toggle for the sensor is supported on this device. | 
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
