Can Sensors Off (developer options) be controlled via ADB? [Q or above]



  • Sensors Off tile | System UI

    Haven't got it from AOSP sources yet: https://source.android.com/devices/sensors/sensors-off#:%7E:text=Android%2010%20provides%20a%20developer,the%20sensors%20in%20their%20device.



  • First of all, thanks to @irfan-latif for providing the right answer to this question in the comments column. But apparently, this will be allowed. So, I will help complete the answer.

    On Android 10:

    service call sensor_privacy 4 i32 1
    

    service call sensor_privacy 4 i32 0

    On Android 11:

    service call sensor_privacy 4 i32 1
    

    service call sensor_privacy 4 i32 0

    On Android 12:

    service call sensor_privacy 8 i32 1
    

    service call sensor_privacy 8 i32 0

    On Android 12L:

    service call sensor_privacy 8 i32 1
    

    service call sensor_privacy 8 i32 0

    Else, the above command does not produce anything, you can search for ISensorPrivacyManager Interface in https://cs.android.com/android according to the revised version of your Android device[2] (Hint: the number on the back is the revision number.). Then, change the sequence number of the Method in which setSensorPrivacy() resides.

    [2]: getprop | grep ro.vendor_dlkm.build.id




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2