What's turning on bluetooth every hour on my OnePlus 6?



  • I noticed something has been turning on bluetooth on my OnePlus 6 automatically. I googled online and learned to turn off Bluetooth scanning (for location-based features).

    However, the problem persists. Something keeps turning on bluetooth every hour, at 37th minute, i.e.

    • I turned bluetooth off. Then at 2:38pm, I hear the sound that my phone connected to my bluetooth speaker.

    • I turned it off again. Then at 3:38pm, I hear the sound that my phone connected to my bluetooth speaker.

    • I turned it off. Same thing happened at 4:38pm.

    What is doing this?



  • On my OnePlus 6 running OxygenOS 10.3.11 (Android 10) I can find out the culprit using the following /questions/tagged/adb commands:

    adb shell 
    dumpsys bluetooth_manager | toybox sed -ne '/abled.*due.*to.*APPLICATION_REQUEST.*/p'
    

    Example:

    $ adb shell 
    $ dumpsys bluetooth_manager | toybox sed -ne '/abled.*due.*to.*APPLICATION_REQUEST.*/p'
      01-05 13:31:04  Enabled  due to APPLICATION_REQUEST by com.arlosoft.macrodroid
      01-05 13:31:18 Disabled  due to APPLICATION_REQUEST by com.android.systemui
      01-05 13:31:27  Enabled  due to APPLICATION_REQUEST by com.arlosoft.macrodroid
      01-05 13:32:22 Disabled  due to APPLICATION_REQUEST by com.arlosoft.macrodroid
      01-05 13:34:24  Enabled  due to APPLICATION_REQUEST by com.arlosoft.macrodroid
      01-05 13:39:22 Disabled  due to APPLICATION_REQUEST by com.android.systemui
    

    As you can see the command queries Bluetooth Manager service and filters out information relevant to us. If you want to find out where this information is in the full log/dump, look for the heading Enable log: in the full dump of bluetooth_manager using dumpsys bluetooth_manager. This information may prove useful if my dumpsys query fails to produce output.

    The string after by is the package name of the app that requested Bluetooth be enabled or disabled at the given time. To find the app name from the package name you can use my answer for the question " https://android.stackexchange.com/a/198095/96277 "


    One can also find out this information (package name) by filtering the logcat

    adb logcat | grep -i 'bluetooth.*packageName'
    

    Demo output:

    01-05 13:32:22.305  1193 16018 E BluetoothManagerService: [CW] addActiveLog, reason: 1, packageName: com.arlosoft.macrodroid, enable: false
    01-05 13:32:22.305  1193 16018 D BluetoothManagerService: [CW] Bluetooth Manager Service, enable: false, reason: 1, packageName: com.arlosoft.macrodroid
    

Log in to reply
 


Suggested Topics

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