chipweinberger / flutter_blue_plus

Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, macOS
Other
788 stars 478 forks source link

[Feature]:: Huawei phones cannot search for Bluetooth devices #1060

Closed mikecc788 closed 1 day ago

mikecc788 commented 6 days ago

FlutterBluePlus Version

1.34.5

Flutter Version

Flutter 3.26.0-1.0.pre.393

What OS?

Android

OS Version

HarmonyOS 4.2

Bluetooth Module

any

What is your feature request?

Huawei phones cannot search for Bluetooth devices. The system is HarmonyOS, and the Andorid can search for Bluetooth. The latest example code I use cannot scan any Bluetooth devices either

Logs

I/Hwaps   (32726): APS: EventAnalyzed: initAPS: version is 11.0.0.4
D/Hwaps   (32726): Fpsrequest create,type:EXACTLY_IDENTIFY
D/Hwaps   (32726): Fpsrequest create,type:EXACTLY_IDENTIFY
D/Hwaps   (32726): Fpsrequest create,type:OPENGL_SETTING
D/Hwaps   (32726): FpsController create
D/Hwaps   (32726): APS: EventAnalyzed: reInitFpsPara :mBaseFps = 120; mMaxFps = 120
I/HwViewRootImpl(32726): Add sceneId 11 topId: 10
W/Settings(32726): Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
V/HiTouch_HiTouchSensor(32726): User setup is finished.
D/HwDragEnhancementImpl(32726): handleTimerDrag: false
D/HwDragEnhancementImpl(32726): handleTimerDrag: false
D/HwDragEnhancementImpl(32726): Start long press for hw drag enhancement.
W/HwApsManager(32726): HwApsManagerService, registerCallback, start !
D/Hwaps   (32726): APS: EventAnalyzed: registerCallbackInApsManagerService, mPkgName:com.feellife.iBreathe; result = true
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] current resolutionScale: 1.0
I/HwViewRootImpl(32726): remove sceneId 11 topId: 10
D/WebViewDragEnhancement(32726): dragReset.
D/WebViewDragEnhancement(32726): dragReset cacheSize = 0
V/AudioManager(32726): querySoundEffectsEnabled...
I/AudioManager(32726): querySoundEffectsEnabled fail id: 0
I/flutter (32726): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (32726): │ 🐛 lfs :: home_page.dart:64 :: hasRequestedPermissions==true  shouldShowPermissionDialog==true
I/flutter (32726): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (32726): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (32726): │ 🐛 lfs :: home_page.dart:70 :: _checkPermissionsAndInitBluetooth true
I/flutter (32726): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
D/[FBP-Android](32726): [FBP] onMethodCall: flutterRestart
D/[FBP-Android](32726): [FBP] initializing BluetoothAdapter
D/[FBP-Android](32726): [FBP] disconnectAllDevices(flutterRestart)
D/[FBP-Android](32726): [FBP] connectedPeripherals: 0
I/flutter (32726): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (32726): │ 🐛 lfs :: home_page.dart:144 :: 当前是否为鸿蒙系统: true
I/flutter (32726): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
D/[FBP-Android](32726): [FBP] onMethodCall: getAdapterState
D/[FBP-Android](32726): [FBP] onMethodCall: startScan
I/BluetoothAdapter(32726): isLeEnabled(): ON
D/BluetoothLeScanner(32726): onScannerRegistered() - status=0 scannerId=15 mScannerId=0
I/flutter (32726): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (32726): │ 🐛 lfs :: experience_page.dart:65 :: jsonResponse: false
I/flutter (32726): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] start to get views' rect, type = SCENE_GESTURE_SINGLE_TAP
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] windowModeType: 1
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] displayPoint: Point(1084, 2412)
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] windowModeType: 1
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] lazyMode:
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] current mode is full screen
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] start to getViewHierarchy
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] deviceOrientation: 0
D/HwViewRootImpl(32726): [DetectViewsLocationRunner-ScreenDirection] ROTATION_0
D/HwViewRootImpl(32726): [DetectViewsLocationRunner] get views' rect = 0, SCENE_GESTURE_SINGLE_TAP
D/[FBP-Android](32726): [FBP] onMethodCall: stopScan
I/BluetoothAdapter(32726): isLeEnabled(): ON

use scan code
  FlutterBluePlus.onScanResults.listen()

“After executing the scan, there is no response and no information is detected.”  please help
chipweinberger commented 6 days ago

make sure location services are enabled