1

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 the 37th minute, i.e.

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

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

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

What is doing this?

2
  • I had a similar issue a few years ago. Although I never found the culprit, a workaround was to uninstall the Bluetooth drivers.
    – Chenmunka
    Commented Jan 5, 2022 at 7:17
  • You can try to enable developer options and adb on the device and then check adb logcat at the time Bluetooth gets enabled. May be the log contains something you can identify the cause.
    – Robert
    Commented Jan 5, 2022 at 8:07

2 Answers 2

1

On my OnePlus 6 running OxygenOS 10.3.11 (Android 10) I can find out the culprit using the following 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 "How to find app based on package name?"


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
1
  • 1
    Thanks a lot. This is very helpful. I followed the leads you gave and ended up finding the culprit is the smart lock I installed for my home that requires bluetooth. I found this line in android.log file: BluetoothManagerService: enable(com.august.luna). With OnePlus 6, I didn't have to use adb, I was able to turn on Developer Option and then share the log (uploading it to my Google Drive).
    – ssppjj
    Commented Jan 6, 2022 at 23:10
1

Thanks a lot to Firelord's response.

I followed the leads they gave and ended up finding the culprit is the smart lock I installed for my home that requires bluetooth.

I found this line in android.log file: BluetoothManagerService: enable(com.august.luna).

With OnePlus 6, I didn't have to use adb, I was able to:

  • turned on Developer Option,
  • turned on Debug level logging (the log line of answer is debug level),
  • turned on Save Log (didn't reboot though. don't know if it actually mattered),
  • and then shared the log (uploading it to my Google Drive).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .