- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Android 应用用例,需要“连续”扫描 BLE 设备。
仅此一项要求就可能让我成为受虐狂,我猜这会让 Android 成为我的施虐狂。
我知道[我相信]仍未正式记录“30 秒内扫描不超过 5 次”和“扫描时间超过 10 分钟”、“没有 ScanFilter 则没有扫描结果”、背景问题以及其他一些。
为了缓解这些问题,我使用了类似于 AltBeacon、Nordic Scanner-Compat、SweetBlue 和其他一些技巧。
我认为这些都不是这篇文章的问题。
输入我当前的问题。
一般来说,我的应用程序使用 PendingIntent 开始扫描 3.1 秒,然后停止(逻辑“暂停”)3.1 秒,然后重复(逻辑“恢复”)并在用户明确退出应用程序后硬停止。
下面是 8.1.0 Nexus 6P 重新启动并打开蓝牙、启动我的应用程序并开始扫描的日志。
我不知道为什么操作系统在开始扫描时调用gatt_api
,以及为什么它在停止时提示Context not found
;也许这些是线索?
2019-07-18 17:51:53.462 13662-13662/? D/AdapterServiceConfig: Adding GattService
2019-07-18 17:51:53.496 13662-13676/? D/BluetoothAdapterService: setProfileServiceState() - Starting service com.android.bluetooth.gatt.GattService
2019-07-18 17:51:53.497 13662-13662/? I/BtGatt.JNI: classInitNative(L871): classInitNative: Success!
2019-07-18 17:51:53.498 13662-13662/? D/BtGatt.DebugUtils: handleDebugAction() action=null
2019-07-18 17:51:53.499 13662-13662/? D/BtGatt.GattService: Received start request. Starting profile...
2019-07-18 17:51:53.499 13662-13662/? I/bt_btif: get_profile_interface: id = gatt
2019-07-18 17:51:53.504 13662-13662/? D/BluetoothAdapterService: processProfileServiceStateChanged() - serviceName=com.android.bluetooth.gatt.GattService isTurningOn=false isTurningOff=false isBleTurningOn=true isBleTurningOff=false
2019-07-18 17:51:53.504 13662-13662/? D/BluetoothAdapterService: GattService is started
2019-07-18 17:51:54.251 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:51:54.251 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1027)] allocated gatt_if=3
2019-07-18 17:51:54.274 4384-4435/? D/BluetoothManagerService: Binding Bluetooth GATT service
2019-07-18 17:51:54.277 4384-4384/? D/BluetoothManagerService: BluetoothServiceConnection: com.android.bluetooth.gatt.GattService
2019-07-18 17:51:54.278 4384-4435/? D/BluetoothManagerService: BluetoothGatt Service is Up
2019-07-18 17:51:54.376 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:51:54.376 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1027)] allocated gatt_if=4
2019-07-18 17:51:54.653 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:51:54.653 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1027)] allocated gatt_if=5
2019-07-18 17:51:54.685 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:51:54.685 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1027)] allocated gatt_if=6
2019-07-18 17:52:00.800 13349-13349/com.myapp V/MyBleScanner: resume: #GATT +mBleScannerInternal.startScan(...)
2019-07-18 17:52:00.818 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:52:00.818 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1027)] allocated gatt_if=6
2019-07-18 17:52:00.818 13349-13349/com.myapp V/MyBleScanner: resume: #GATT mBleScannerInternal.startScan(...); result=SUCCESS(0)
2019-07-18 17:52:00.836 13349-13349/com.myapp V/MyBleScanner: resume: #GATT -mBleScannerInternal.startScan(...)
2019-07-18 17:52:00.837 13349-13349/com.myapp E/MyBleScanner: resume: #GATT mBleScannerInternalStartScanCount=1, elapsedMillisSinceBleScannerInternalStartScanFirstTime=0
2019-07-18 17:52:03.942 13349-13349/com.myapp V/MyBleScanner: pause: #GATT +mBleScannerInternal.stopScan(...)
2019-07-18 17:52:03.959 13662-13674/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@2f1237f
2019-07-18 17:52:03.960 13349-13349/com.myapp V/MyBleScanner: pause: #GATT -mBleScannerInternal.stopScan(...)
2019-07-18 17:52:03.966 13349-13349/com.myapp I/MyBleScanner: pause: #GATT mScannedDevices(36)={"31:2C:26:FA:91:5E"=null, "0E:06:E5:5D:1F:9D"=null, "0E:05:A0:00:28:E3"=null, "16:05:05:B8:E9:51"=null, "0E:0A:B0:00:13:2E"=null, "0E:0E:A0:05:C9:B4"=null, "74:F0:1C:42:2A:6C"=null, "0E:0C:00:00:0A:14"=null, "0E:0A:00:00:23:38"=null, "0E:05:A0:00:13:AC"=null, "0E:0E:A0:03:CC:16"=null, "0E:0E:A0:02:22:78"=null, "30:8C:FB:D4:BD:B1"=null, "30:8C:FB:7A:55:21"=null, "CD:A3:87:DA:15:D6"=null, "0E:0E:A0:03:C6:D6"=null, "0E:05:A0:00:32:6E"=null, "0E:0E:A0:05:46:FD"=null, "0E:0E:A0:01:0C:DF"=null, "0E:0E:A0:01:14:36"=null, "0E:0E:A0:01:14:56"=null, "0E:0E:A0:03:F7:1A"=null, "0E:0E:43:21:FE:0E"=null, "0E:0E:A0:0E:E2:72"=null, "0E:0E:A0:04:07:1F"=null, "F5:2A:1E:90:43:D7"=null, "0B:F8:B4:90:A2:3A"=null, "0E:0E:A0:00:1E:DF"=null, "0E:05:A0:00:61:B1"=null, "0E:0E:A0:03:DC:D3"=null, "0E:05:A0:00:84:12"=null, "0E:05:A0:00:84:13"=null, "0E:06:E5:59:D8:B3"=null, "0E:0A:A0:01:3D:13"=null, "2F:41:6D:A2:92:C6"=null, "0E:0A:A0:01:3A:69"=null}
2019-07-18 17:52:04.595 13662-13682/? E/BtGatt.GattService: Exception: android.app.PendingIntent$CanceledException
2019-07-18 17:52:07.076 13349-13349/com.myapp V/MyBleScanner: resume: #GATT +mBleScannerInternal.startScan(...)
2019-07-18 17:52:07.111 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:52:07.112 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1027)] allocated gatt_if=7
2019-07-18 17:52:07.112 13349-13349/com.myapp V/MyBleScanner: resume: #GATT mBleScannerInternal.startScan(...); result=SUCCESS(0)
2019-07-18 17:52:07.127 13349-13349/com.myapp V/MyBleScanner: resume: #GATT -mBleScannerInternal.startScan(...)
2019-07-18 17:52:07.127 13349-13349/com.myapp E/MyBleScanner: resume: #GATT mBleScannerInternalStartScanCount=2, elapsedMillisSinceBleScannerInternalStartScanFirstTime=6291
2019-07-18 17:52:10.231 13349-13349/com.myapp V/MyBleScanner: pause: #GATT +mBleScannerInternal.stopScan(...)
2019-07-18 17:52:10.238 13662-13674/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@1377141
2019-07-18 17:52:10.239 13349-13349/com.myapp V/MyBleScanner: pause: #GATT -mBleScannerInternal.stopScan(...)
2019-07-18 17:52:10.242 13349-13349/com.myapp I/MyBleScanner: pause: #GATT mScannedDevices(37)={"31:2C:26:FA:91:5E"=null, "0E:0E:A0:00:18:EC"=null, "0E:06:E5:5D:1F:9D"=null, "0E:05:A0:00:28:E3"=null, "16:05:05:B8:E9:51"=null, "0E:0A:B0:00:13:2E"=null, "0E:0E:A0:05:C9:B4"=null, "74:F0:1C:42:2A:6C"=null, "0E:0A:00:00:23:38"=null, "0E:0C:00:00:0A:14"=null, "0E:05:A0:00:13:AC"=null, "0E:0E:A0:02:22:78"=null, "30:8C:FB:D4:BD:B1"=null, "30:8C:FB:7A:55:21"=null, "CD:A3:87:DA:15:D6"=null, "0E:0E:A0:03:C6:D6"=null, "0E:0E:A0:05:46:FD"=null, "0E:0E:A0:03:3B:16"=null, "0E:0E:A0:01:14:36"=null, "CD:31:C7:3B:84:0F"=null, "0E:0E:A0:02:0B:C1"=null, "DA:A3:9B:E8:3B:E8"=null, "0E:0E:A0:02:24:97"=null, "0E:0E:A0:03:F7:1A"=null, "0E:0E:43:21:FE:0E"=null, "0E:0E:A0:0E:E2:72"=null, "0B:F8:B4:90:A2:3A"=null, "F5:2A:1E:90:43:D7"=null, "0E:0E:A0:00:1E:DF"=null, "0E:05:A0:00:61:B1"=null, "0E:0E:A0:03:DC:D3"=null, "0E:05:A0:00:84:12"=null, "0E:05:A0:00:84:13"=null, "0E:0A:A0:01:3D:13"=null, "0E:06:E5:59:D8:B3"=null, "2F:41:6D:A2:92:C6"=null, "0E:0A:A0:01:3A:69"=null}
2019-07-18 17:52:10.483 13662-13682/? E/BtGatt.GattService: Exception: android.app.PendingIntent$CanceledException
...
日志按预期重复...除了可能是分配的 gatt_if=8
的信息,然后是 9、10、...、31...
...
2019-07-18 17:54:43.869 13349-13349/com.myapp V/MyBleScanner: resume: #GATT +mBleScannerInternal.startScan(...)
2019-07-18 17:54:43.893 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:54:43.893 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1027)] allocated gatt_if=32
2019-07-18 17:54:43.893 13349-13349/com.myapp V/MyBleScanner: resume: #GATT mBleScannerInternal.startScan(...); result=SUCCESS(0)
2019-07-18 17:54:43.912 13349-13349/com.myapp V/MyBleScanner: resume: #GATT -mBleScannerInternal.startScan(...)
2019-07-18 17:54:43.913 13349-13349/com.myapp E/MyBleScanner: resume: #GATT mBleScannerInternalStartScanCount=27, elapsedMillisSinceBleScannerInternalStartScanFirstTime=163077
2019-07-18 17:54:43.952 13662-13682/? E/BtGatt.GattService: Exception: android.app.PendingIntent$CanceledException
2019-07-18 17:54:47.021 13349-13349/com.myapp V/MyBleScanner: pause: #GATT +mBleScannerInternal.stopScan(...)
2019-07-18 17:54:47.033 13662-13703/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@e09708f
2019-07-18 17:54:47.036 13349-13349/com.myapp V/MyBleScanner: pause: #GATT -mBleScannerInternal.stopScan(...)
2019-07-18 17:54:47.037 13349-13349/com.myapp I/MyBleScanner: pause: #GATT mScannedDevices(37)={"0E:0E:A0:02:0D:1A"=null, "0E:06:E5:5D:1F:9D"=null, "0E:0E:A0:00:18:EC"=null, "16:05:05:B8:E9:51"=null, "0E:0E:FF:F6:BE:30"=null, "74:F0:1C:42:2A:6C"=null, "0E:0C:00:00:0A:14"=null, "0E:0A:00:00:23:38"=null, "0E:0E:A0:03:CC:16"=null, "0E:0E:A0:01:0B:E6"=null, "0E:0E:A0:02:22:78"=null, "30:8C:FB:D4:BD:B1"=null, "30:8C:FB:7A:55:21"=null, "CD:A3:87:DA:15:D6"=null, "0E:05:A0:00:32:6E"=null, "0E:0E:A0:03:28:7B"=null, "0E:0E:A0:01:0C:DF"=null, "CD:31:C7:3B:84:0F"=null, "DA:A3:9B:E8:3B:E8"=null, "0E:0E:A0:01:14:56"=null, "0E:0E:A0:02:24:97"=null, "0E:0E:A0:02:15:F8"=null, "37:AB:CB:F6:2D:70"=null, "0E:0E:43:21:FE:0E"=null, "24:B9:20:97:DC:87"=null, "0E:0E:A0:04:6B:34"=null, "0E:0E:A0:04:07:1F"=null, "0B:F8:B4:90:A2:3A"=null, "F5:2A:1E:90:43:D7"=null, "0E:05:A0:00:61:B0"=null, "0E:0E:A0:03:21:34"=null, "0E:05:A0:00:61:B1"=null, "0E:05:A0:00:84:13"=null, "0E:06:E5:59:D8:B3"=null, "0E:0A:A0:01:3D:13"=null, "2F:41:6D:A2:92:C6"=null, "0E:0A:A0:01:3A:69"=null}
2019-07-18 17:54:47.547 13662-13662/? D/BtGatt.ScanManager: awakened up at time 187337376
2019-07-18 17:54:47.552 13662-13682/? E/BtGatt.GattService: Exception: android.app.PendingIntent$CanceledException
2019-07-18 17:54:50.143 13349-13349/com.myapp V/MyBleScanner: resume: #GATT +mBleScannerInternal.startScan(...)
2019-07-18 17:54:50.173 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:54:50.173 13662-13697/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
2019-07-18 17:54:50.173 13662-13697/? E/bt_btif: Register with GATT stack failed.
2019-07-18 17:54:50.173 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:54:50.174 13349-13349/com.myapp V/MyBleScanner: resume: #GATT mBleScannerInternal.startScan(...); result=SUCCESS(0)
2019-07-18 17:54:50.174 13662-13697/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
2019-07-18 17:54:50.174 13662-13697/? E/bt_btif: Register with GATT stack failed.
2019-07-18 17:54:50.187 13349-13349/com.myapp V/MyBleScanner: resume: #GATT -mBleScannerInternal.startScan(...)
2019-07-18 17:54:50.188 13349-13349/com.myapp E/MyBleScanner: resume: #GATT mBleScannerInternalStartScanCount=28, elapsedMillisSinceBleScannerInternalStartScanFirstTime=169351
...
总是在我的第 28 次调用 startScan(除非可能有其他应用程序已扫描),大约 170 秒后,操作系统开始报告 gatt_api
错误无法注册GATT客户端,最大客户端达到:32
,此时:
...
2019-07-18 17:54:53.291 13349-13349/com.myapp V/MyBleScanner: pause: #GATT +mBleScannerInternal.stopScan(...)
2019-07-18 17:54:53.303 13662-13715/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@7eaaf1c
2019-07-18 17:54:53.304 13349-13349/com.myapp V/MyBleScanner: pause: #GATT -mBleScannerInternal.stopScan(...)
2019-07-18 17:54:53.304 13349-13349/com.myapp I/MyBleScanner: pause: #GATT mScannedDevices(0)={}
2019-07-18 17:54:56.410 13349-13349/com.myapp V/MyBleScanner: resume: #GATT +mBleScannerInternal.startScan(...)
2019-07-18 17:54:56.439 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:54:56.439 13662-13697/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
2019-07-18 17:54:56.439 13662-13697/? E/bt_btif: Register with GATT stack failed.
2019-07-18 17:54:56.439 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:54:56.439 13662-13697/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
2019-07-18 17:54:56.439 13662-13697/? E/bt_btif: Register with GATT stack failed.
2019-07-18 17:54:56.440 13349-13349/com.myapp V/MyBleScanner: resume: #GATT mBleScannerInternal.startScan(...); result=SUCCESS(0)
2019-07-18 17:54:56.458 13349-13349/com.myapp V/MyBleScanner: resume: #GATT -mBleScannerInternal.startScan(...)
2019-07-18 17:54:56.458 13349-13349/com.myapp E/MyBleScanner: resume: #GATT mBleScannerInternalStartScanCount=29, elapsedMillisSinceBleScannerInternalStartScanFirstTime=175622
2019-07-18 17:54:59.562 13349-13349/com.myapp V/MyBleScanner: pause: #GATT +mBleScannerInternal.stopScan(...)
2019-07-18 17:54:59.576 13662-13673/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@bef4725
2019-07-18 17:54:59.576 13349-13349/com.myapp V/MyBleScanner: pause: #GATT -mBleScannerInternal.stopScan(...)
2019-07-18 17:54:59.577 13349-13349/com.myapp I/MyBleScanner: pause: #GATT mScannedDevices(0)={}
2019-07-18 17:55:02.679 13349-13349/com.myapp V/MyBleScanner: resume: #GATT +mBleScannerInternal.startScan(...)
2019-07-18 17:55:02.697 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:55:02.697 13662-13697/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
2019-07-18 17:55:02.697 13662-13697/? E/bt_btif: Register with GATT stack failed.
2019-07-18 17:55:02.697 13662-13697/? I/bt_stack: [INFO:gatt_api.cc(1004)] GATT_Register
2019-07-18 17:55:02.697 13662-13697/? E/bt_stack: [ERROR:gatt_api.cc(1032)] can't Register GATT client, MAX client reached: 32
2019-07-18 17:55:02.697 13662-13697/? E/bt_btif: Register with GATT stack failed.
2019-07-18 17:55:02.697 13349-13349/com.myapp V/MyBleScanner: resume: #GATT mBleScannerInternal.startScan(...); result=SUCCESS(0)
2019-07-18 17:55:02.707 13349-13349/com.myapp V/MyBleScanner: resume: #GATT -mBleScannerInternal.startScan(...)
2019-07-18 17:55:02.707 13349-13349/com.myapp E/MyBleScanner: resume: #GATT mBleScannerInternalStartScanCount=30, elapsedMillisSinceBleScannerInternalStartScanFirstTime=181871
2019-07-18 17:55:05.810 13349-13349/com.myapp V/MyBleScanner: pause: #GATT +mBleScannerInternal.stopScan(...)
2019-07-18 17:55:05.822 13662-13703/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@82cc0fa
2019-07-18 17:55:05.822 13349-13349/com.myapp V/MyBleScanner: pause: #GATT -mBleScannerInternal.stopScan(...)
2019-07-18 17:55:05.823 13349-13349/com.myapp I/MyBleScanner: pause: #GATT mScannedDevices(0)={}
这里似乎发生了某种分配的 gatt_if
泄漏,但我只是调用 startScan(..., mPendingIntent)
和 stopScan( ..., mPendingIntent)
具有相同的最终/不可变的 PendingIntent 成员,所以我非常怀疑我的代码中的任何内容是否直接导致“泄漏”。
此时,没有应用程序可以扫描 BLE 设备。不是我的应用程序或 SweetBlue Toolbox、BLE 扫描仪或我尝试过的任何其他第 3 方 BLE 扫描应用程序。
到底为什么会发生这种情况?
当手机确实进入此状态时,我可以通过关闭手机的蓝牙并再次打开来返回到工作状态。
AltBeacon 有一个 BluetoothMedic
类,据说可以检测到此状态并以编程方式关闭蓝牙并再次打开,但我将其添加为依赖项并在其 onScanFailed 回调内部设置断点,但它永远不会调用,这违背了类(class)的整个目的,我很难相信这对他们来说是一个已知的问题。 :/
我希望从一开始就不存在这种泄漏,并且能够无限期地每 3.1 秒停止和启动扫描一次,并可靠地扫描范围内的本地设备。
除此之外,如果必须的话,我必须以编程方式关闭并重新打开蓝牙(是的,每 170 秒一次...欢迎来到 Android BLE 世界的 hell ),但没有有效的 startScan 返回值或 onScanFailed回调无法确定扫描零个设备是否意味着手机已进入这种不良状态,或者周围真的有零个设备。
我确信这段代码在一年多的时间里一直运行良好,直到最近(最多几个月前)才开始出现这种情况。
还有希望吗?
Android BLE 真的很糟糕。 :/
最佳答案
我的最终结论是,Nordic 的 Android-Scanner-Compat-Library 确实创建了一个可停止的 PendingIntent,但问题是它正在调用 PendingIntent.getBroadcast(context, id, Intent, PendingIntent.FLAG_CANCEL_CURRENT)
当它应该调用 PendingIntent.getBroadcast(context, id, Intent, PendingIntent.FLAG_UPDATE_CURRENT)
我在我的 fork 上修复了它,并提出了一个问题,并将提出一个 PR。
我相信我找到了答案。
今天我编写了一个独立的应用程序作为简单的测试用例来重现这个问题。 https://github.com/paulpv/AndroidBleStartScanPendingIntentLeak
想想吧,它没有重现。
测试应用程序和我的生产应用程序的一大区别是:
我的测试应用程序没有重现该问题,但是当我调整它以使用 Nordic 的 Android-Scanner-Compat 时,我的问题就开始重现。
我撤消了我的更改;没有重现。
我重新做了我的改变;重现。
确凿证据?
final PendingIntent pendingIntent = createStartingPendingIntent(nonNullFilters,
nonNullSettings, context, callbackIntent);
scanner.startScan(nativeFilters, nativeSettings, pendingIntent);
他们实例化自己的 PendingIntent 来包装我的......
...但是他们的代码中没有任何地方可以跟踪他们的 PendingIntent,以便他们可以使用相同的endingIntent 成功调用 stopScan(pendingIntent)
。
final PendingIntent pendingIntent = createStoppingPendingIntent(context, callbackIntent);
scanner.stopScan(pendingIntent);
这两个pendingIntents不可能匹配,因此操作系统可以正确停止扫描。
我通过向他们的代码分支添加日志记录来确认这一点(在每个 startScan
和 stopScan
附近搜索“pendingIntent=”;请注意,它们是不同的实例,因为以及每个分配的 gatt_if=
中不断增长的数量):
2019-07-19 21:14:51.230 16905-16905/com.testapp V/BleScannerManager: scan: #GATT +bleScanner.startScan(...)
2019-07-19 21:14:58.424 16905-16905/com.testapp V/BleScannerImplOreo: #GATT startScanInternal: pendingIntent=PendingIntent{1dfc67: android.os.BinderProxy@e560a14}
2019-07-19 21:14:58.468 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(948)] GATT_Register 3c2e1fd9-d3fd-6897-a113-863aa50df781
2019-07-19 21:14:58.468 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(968)] allocated gatt_if=7
2019-07-19 21:14:58.478 16905-16905/com.testapp V/BleScannerManager: scan: #GATT bleScanner.startScan(...); result=SUCCESS(0)
2019-07-19 21:14:58.479 16905-16905/com.testapp V/BleScannerManager: scan: #GATT -bleScanner.startScan(...)
2019-07-19 21:14:58.481 16905-16905/com.testapp E/BleScannerManager: #GATT bleScannerStartScanCount=1, elapsedMillisSinceBleScannerStartScanFirstTime=0
2019-07-19 21:15:03.521 1447-1447/? D/BtGatt.ScanManager: awakened up at time 614650173
2019-07-19 21:15:08.250 16905-16905/com.testapp V/BleScannerManager: scan: #GATT +bleScanner.stopScan(...)
2019-07-19 21:15:08.255 16905-16905/com.testapp V/BleScannerImplOreo: #GATT stopScanInternal: pendingIntent=PendingIntent{dc4115f: android.os.BinderProxy@84087ac}
2019-07-19 21:15:08.259 1447-1982/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@77d2d25
2019-07-19 21:15:08.260 16905-16905/com.testapp V/BleScannerManager: scan: #GATT -bleScanner.stopScan(...)
2019-07-19 21:15:08.556 1447-1447/? D/BtGatt.ScanManager: awakened up at time 614655208
2019-07-19 21:15:08.570 1447-1554/? E/BtGatt.GattService: Exception: android.app.PendingIntent$CanceledException
2019-07-19 21:15:20.556 16905-16905/com.testapp V/BleScannerManager: scan: #GATT +bleScanner.startScan(...)
2019-07-19 21:15:20.570 16905-16905/com.testapp V/BleScannerImplOreo: #GATT startScanInternal: pendingIntent=PendingIntent{2ce86d6: android.os.BinderProxy@84087ac}
2019-07-19 21:15:20.575 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(948)] GATT_Register 6b444e39-d61a-1d92-52d6-afd6e901b56b
2019-07-19 21:15:20.575 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(968)] allocated gatt_if=8
2019-07-19 21:15:20.576 16905-16905/com.testapp V/BleScannerManager: scan: #GATT bleScanner.startScan(...); result=SUCCESS(0)
2019-07-19 21:15:20.576 16905-16905/com.testapp V/BleScannerManager: scan: #GATT -bleScanner.startScan(...)
2019-07-19 21:15:20.576 16905-16905/com.testapp E/BleScannerManager: #GATT bleScannerStartScanCount=2, elapsedMillisSinceBleScannerStartScanFirstTime=22097
2019-07-19 21:15:23.264 16905-16905/com.testapp V/BleScannerManager: scan: #GATT +bleScanner.stopScan(...)
2019-07-19 21:15:23.269 16905-16905/com.testapp V/BleScannerImplOreo: #GATT stopScanInternal: pendingIntent=PendingIntent{ebafcb0: android.os.BinderProxy@ebb6729}
2019-07-19 21:15:23.272 1447-1982/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@3abaefa
2019-07-19 21:15:23.272 16905-16905/com.testapp V/BleScannerManager: scan: #GATT -bleScanner.stopScan(...)
2019-07-19 21:15:24.968 16905-16905/com.testapp V/BleScannerManager: scan: #GATT +bleScanner.startScan(...)
2019-07-19 21:15:24.980 16905-16905/com.testapp V/BleScannerImplOreo: #GATT startScanInternal: pendingIntent=PendingIntent{8b1626b: android.os.BinderProxy@ebb6729}
2019-07-19 21:15:24.990 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(948)] GATT_Register 0bbb0b8f-2c63-dfc2-268d-fbfe39360ddf
2019-07-19 21:15:24.990 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(968)] allocated gatt_if=9
2019-07-19 21:15:24.990 16905-16905/com.testapp V/BleScannerManager: scan: #GATT bleScanner.startScan(...); result=SUCCESS(0)
2019-07-19 21:15:24.990 16905-16905/com.testapp V/BleScannerManager: scan: #GATT -bleScanner.startScan(...)
2019-07-19 21:15:24.991 16905-16905/com.testapp E/BleScannerManager: #GATT bleScannerStartScanCount=3, elapsedMillisSinceBleScannerStartScanFirstTime=26511
2019-07-19 21:15:25.019 1447-1554/? E/BtGatt.GattService: Exception: android.app.PendingIntent$CanceledException
2019-07-19 21:15:25.795 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(948)] GATT_Register 32a50296-06f2-ed4d-f83c-25da059a4a19
2019-07-19 21:15:25.795 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(968)] allocated gatt_if=10
2019-07-19 21:15:26.046 1447-1447/? D/BtGatt.ScanManager: awakened up at time 614672699
2019-07-19 21:15:27.000 16905-16905/com.testapp V/BleScannerManager: scan: #GATT +bleScanner.stopScan(...)
2019-07-19 21:15:27.005 16905-16905/com.testapp V/BleScannerImplOreo: #GATT stopScanInternal: pendingIntent=PendingIntent{40e339d: android.os.BinderProxy@6340012}
2019-07-19 21:15:27.008 1447-1982/? E/BtGatt.ContextMap: Context not found for info com.android.bluetooth.gatt.GattService$PendingIntentInfo@96b43b4
2019-07-19 21:15:27.009 16905-16905/com.testapp V/BleScannerManager: scan: #GATT -bleScanner.stopScan(...)
2019-07-19 21:15:28.679 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(948)] GATT_Register f119757a-00ff-29b4-72e0-952c5e0db695
2019-07-19 21:15:28.679 1447-1941/? I/bt_stack: [INFO:gatt_api.cc(968)] allocated gatt_if=10
2019-07-19 21:15:28.810 1447-1447/? D/BtGatt.ScanManager: awakened up at time 614675462
2019-07-19 21:15:28.822 1447-1554/? E/BtGatt.GattService: Exception: android.app.PendingIntent$CanceledException
看来我必须在他们的存储库上提出问题,或者自己修复它并向他们发送 PR。
感谢那些插话的人;你的问题让我朝着正确的方向寻找!
关于Android BluetoothLeScanner startScan PendingIntent 28 次后在系统范围内失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57104535/
我最近在/ drawable中添加了一些.gifs,以便可以将它们与按钮一起使用。这个工作正常(没有错误)。现在,当我重建/运行我的应用程序时,出现以下错误: Error: Gradle: Execu
Android 中有返回内部存储数据路径的方法吗? 我有 2 部 Android 智能手机(Samsung s2 和 s7 edge),我在其中安装了一个应用程序。我想使用位于这条路径中的 sqlit
这个问题在这里已经有了答案: What's the difference between "?android:" and "@android:" in an android layout xml f
我只想知道 android 开发手机、android 普通手机和 android root 手机之间的实际区别。 我们不能从实体店或除 android marketplace 以外的其他地方购买开发手
自Gradle更新以来,我正在努力使这个项目达到标准。这是一个团队项目,它使用的是android-apt插件。我已经进行了必要的语法更改(编译->实现和apt->注释处理器),但是编译器仍在告诉我存在
我是android和kotlin的新手,所以请原谅要解决的一个非常简单的问题! 我已经使用导航体系结构组件创建了一个基本应用程序,使用了底部的导航栏和三个导航选项。每个导航选项都指向一个专用片段,该片
我目前正在使用 Facebook official SDK for Android . 我现在正在使用高级示例应用程序,但我不知道如何让它获取应用程序墙/流/状态而不是登录的用户。 这可能吗?在那种情
我在下载文件时遇到问题, 我可以在模拟器中下载文件,但无法在手机上使用。我已经定义了上网和写入 SD 卡的权限。 我在服务器上有一个 doc 文件,如果用户单击下载。它下载文件。这在模拟器中工作正常但
这个问题在这里已经有了答案: What is the difference between gravity and layout_gravity in Android? (22 个答案) 关闭 9
任何人都可以告诉我什么是 android 缓存和应用程序缓存,因为当我们谈论缓存清理应用程序时,它的作用是,缓存清理概念是清理应用程序缓存还是像内存管理一样主存储、RAM、缓存是不同的并且据我所知,缓
假设应用程序 Foo 和 Eggs 在同一台 Android 设备上。任一应用程序都可以获取设备上所有应用程序的列表。一个应用程序是否有可能知道另一个应用程序是否已经运行以及运行了多长时间? 最佳答案
我有点困惑,我只看到了从 android 到 pc 或者从 android 到 pc 的例子。我需要制作一个从两部手机 (android) 连接的 android 应用程序进行视频聊天。我在想,我知道
用于使用 Android 以编程方式锁定屏幕。我从 Stackoverflow 之前关于此的问题中得到了一些好主意,并且我做得很好,但是当我运行该代码时,没有异常和错误。而且,屏幕没有锁定。请在这段代
文档说: android:layout_alignParentStart If true, makes the start edge of this view match the start edge
我不知道这两个属性和高度之间的区别。 以一个TextView为例,如果我将它的layout_width设置为wrap_content,并将它的width设置为50 dip,会发生什么情况? 最佳答案
这两个属性有什么关系?如果我有 android:noHistory="true",那么有 android:finishOnTaskLaunch="true" 有什么意义吗? 最佳答案 假设您的应用中有
我是新手,正在尝试理解以下 XML 代码: 查看 developer.android.com 上的文档,它说“starStyle”是 R.attr 中的常量, public static final
在下面的代码中,为什么当我设置时单选按钮的外观会发生变化 android:layout_width="fill_parent" 和 android:width="fill_parent" 我说的是
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 9
假设我有一个函数 fun myFunction(name:String, email:String){},当我调用这个函数时 myFunction('Ali', 'ali@test.com ') 如何
我是一名优秀的程序员,十分优秀!