Bluetooth LE not scanning for devices

0

I've been building an android app. I use my galaxy s4 and galaxy not 10 for debugging purposes. When I use my Galaxy s4 I am able to scan and view other devices. When I use my note 10 it doesn't show the nearby Bluetooth device. I have enabled location settings too. I would appreciate if Someone could help me.

2020-09-15 17:09:29.953 12536-12536/? E/Zygote: accessInfo : 1
2020-09-15 17:09:29.976 12536-12536/? I/aixbluetoothap: Late-enabling -Xcheck:jni
2020-09-15 17:09:29.990 12536-12536/? E/aixbluetoothap: Unknown bits set in runtime_flags: 0x8000
2020-09-15 17:09:29.998 12536-12536/? D/ActivityThread: setConscryptValidator
2020-09-15 17:09:29.998 12536-12536/? D/ActivityThread: setConscryptValidator - put
2020-09-15 17:09:30.240 12536-12536/com.example.maixbluetoothapp D/PhoneWindow: forceLight changed to true [] from com.android.internal.policy.PhoneWindow.updateForceLightNavigationBar:4268 com.android.internal.policy.DecorView.updateColorViews:1494 com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged:3246 android.view.Window.setFlags:1148 com.android.internal.policy.PhoneWindow.generateLayout:2474 
2020-09-15 17:09:30.241 12536-12536/com.example.maixbluetoothapp I/MultiWindowDecorSupport: updateCaptionType >> DecorView@218acd4[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
2020-09-15 17:09:30.241 12536-12536/com.example.maixbluetoothapp D/MultiWindowDecorSupport: setCaptionType = 0, DecorView = DecorView@218acd4[]
2020-09-15 17:09:30.286 12536-12536/com.example.maixbluetoothapp D/DeviceScanActivity: Request Location Permissions:
2020-09-15 17:09:30.330 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: startLeScan(): null
2020-09-15 17:09:30.331 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:30.332 12536-12536/com.example.maixbluetoothapp I/chatty: uid=10321(com.example.maixbluetoothapp) identical 1 line
2020-09-15 17:09:30.333 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:30.333 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: BLE support array set: 111111
2020-09-15 17:09:30.334 12536-12536/com.example.maixbluetoothapp D/BluetoothLeScanner: Start Scan with callback
2020-09-15 17:09:30.336 12536-12664/com.example.maixbluetoothapp D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=12 mScannerId=0
2020-09-15 17:09:30.732 12536-12536/com.example.maixbluetoothapp D/ViewRootImpl@680f8ff[DeviceScanActivity]: setView = com.android.internal.policy.DecorView@218acd4 TM=true MM=false
2020-09-15 17:09:30.764 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: stopLeScan()
2020-09-15 17:09:30.765 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:30.771 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:30.771 12536-12536/com.example.maixbluetoothapp D/BluetoothLeScanner: Stop Scan with callback
2020-09-15 17:09:30.824 12536-12536/com.example.maixbluetoothapp D/ViewRootImpl@680f8ff[DeviceScanActivity]: Relayout returned: old=(0,0,1440,3040) new=(0,0,1440,3040) req=(1440,3040)0 dur=20 res=0x7 s={true 491187228672} ch=true
2020-09-15 17:09:30.824 12536-12616/com.example.maixbluetoothapp D/OpenGLRenderer: createReliableSurface : 0x71c9c1b1c0(0x725d0a5000)
2020-09-15 17:09:30.824 12536-12616/com.example.maixbluetoothapp I/AdrenoGLES: QUALCOMM build                   : 128c575, I000594fe7d
    Build Date                       : 02/02/20
    OpenGL ES Shader Compiler Version: EV031.27.05.03
    Local Branch                     : 
    Remote Branch                    : refs/tags/AU_LINUX_ANDROID_LA.UM.8.1.R1.10.00.00.529.103
    Remote Branch                    : NONE
    Reconstruct Branch               : NOTHING
2020-09-15 17:09:30.824 12536-12616/com.example.maixbluetoothapp I/AdrenoGLES: Build Config                     : S P 8.0.11 AArch64
2020-09-15 17:09:30.827 12536-12616/com.example.maixbluetoothapp I/AdrenoGLES: PFP: 0x016ee187, ME: 0x00000000
2020-09-15 17:09:30.844 12536-12536/com.example.maixbluetoothapp D/AbsListView:  in onLayout changed 
2020-09-15 17:09:30.861 12536-12616/com.example.maixbluetoothapp D/OpenGLRenderer: makeCurrent EglSurface : 0x0 -> 0x0
2020-09-15 17:09:30.888 12536-12616/com.example.maixbluetoothapp D/OpenGLRenderer: makeCurrent EglSurface : 0x0 -> 0x71c9c2bd00
2020-09-15 17:09:30.889 12536-12616/com.example.maixbluetoothapp W/Gralloc3: mapper 3.x is not supported
2020-09-15 17:09:31.015 12536-12536/com.example.maixbluetoothapp D/ViewRootImpl@680f8ff[DeviceScanActivity]: MSG_RESIZED_REPORT: frame=(0,0,1440,3040) ci=(0,114,0,53) vi=(0,114,0,53) or=1
2020-09-15 17:09:31.113 12536-12536/com.example.maixbluetoothapp D/DeviceScanActivity: coarse location permission granted
2020-09-15 17:09:31.114 12536-12536/com.example.maixbluetoothapp D/ViewRootImpl@680f8ff[DeviceScanActivity]: stopped(false) old=false
2020-09-15 17:09:31.115 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: startLeScan(): null
2020-09-15 17:09:31.115 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:31.116 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:31.116 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:31.117 12536-12536/com.example.maixbluetoothapp D/BluetoothLeScanner: Start Scan with callback
2020-09-15 17:09:31.118 12536-12568/com.example.maixbluetoothapp D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=12 mScannerId=0
2020-09-15 17:09:40.339 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: stopLeScan()
2020-09-15 17:09:40.341 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:40.342 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:40.342 12536-12536/com.example.maixbluetoothapp D/BluetoothLeScanner: Stop Scan with callback
2020-09-15 17:09:41.117 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: stopLeScan()
2020-09-15 17:09:41.119 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: STATE_ON
2020-09-15 17:09:41.119 12536-12536/com.example.maixbluetoothapp D/BluetoothAdapter: scan not started yet

The below is my log file.

https://android.googlesource.com/platform/development/+/f8a92396babb6592bb8780866def23795f3dab70/samples/BluetoothLeGatt/src/com/example/bluetooth/le

The above link is used for a reference for my project.

java
android
bluetooth-lowenergy
core-bluetooth
bluetooth-lowenergy-4.2

1 Answer

0

I am having the same issue most with Samsung devices with Android 10 OS. Have you tried changing location permission as stated in this release note?

Despite I did, still they listed not the nearby devices at all. So I tried to format one of these devices: Samsung Galaxy Tab A8. After the fabrication reset I got it work. Before I format the device I was seeing a console log of BluetoothAdaptor API that:

D/BluetoothAdapter: BLE support array set: 010011

But this log had disappeared just after I formatted it. This may be a bug of new Android 10 system. Because I haven't had this issue on the systems under Android 10.

Update:

You also have to make sure that the Location of the device is turned on.

answered on Stack Overflow Oct 28, 2020 by Kozmotronik • edited Oct 28, 2020 by Kozmotronik

User contributions licensed under CC BY-SA 3.0