qq328854225 2017-04-19 02:00 采纳率: 0%
浏览 2427

BLE黑屏后导致APP崩溃

场景1:手机刚刚重启完,运行APP与BLE设备通信,正常无问题(任何情况)
场景2:中断当前BLE操作,退出APP,然后重新与BLE设备通信,一旦把APP切换到后台并黑屏,APP会在几秒内崩溃,logcat没任何错误输出

求大神解答,跪求,以下是捕抓的bug输出(bugly也抓不到),但是重启手机后第一次正常操作,往后就一直会出现描述的问题
04-18 17:58:03.578 2971-3014/? E/BluetoothServiceJni: An exception was thrown by callback 'btgattc_notify_cb'.
04-18 17:58:03.578 2971-3014/? E/BluetoothServiceJni: android.os.DeadObjectException
at android.os.BinderProxy.transact(Native Method)
at android.bluetooth.IBluetoothGattCallback$Stub$Proxy.onNotify(IBluetoothGattCallback.java:835)
at com.android.bluetooth.gatt.GattService.onNotify(GattService.java:724)
at dalvik.system.NativeStart.run(Native Method)
04-18 17:58:03.578 2971-3014/? D/BtGatt.btif: btif_gattc_upstreams_evt: Event 10
04-18 17:58:03.578 2971-3014/? E/bt-btif: HAL bt_gatt_callbacks->client->notify_cb
04-18 17:58:03.578 2971-3014/? D/BtGatt.GattService: onNotify() - address=F0:C7:7F:73:68:20, charUuid=0000ffb2-0000-1000-8000-00805f9b34fb, length=19
04-18 17:58:03.578 2971-3014/? E/BluetoothServiceJni: An exception was thrown by callback 'btgattc_notify_cb'.
04-18 17:58:03.578 2971-3014/? E/BluetoothServiceJni: android.os.DeadObjectException
at android.os.BinderProxy.transact(Native Method)
at android.bluetooth.IBluetoothGattCallback$Stub$Proxy.onNotify(IBluetoothGattCallback.java:835)
at com.android.bluetooth.gatt.GattService.onNotify(GattService.java:724)
at dalvik.system.NativeStart.run(Native Method)
04-18 17:58:03.578 2971-2982/? D/BtGatt.GattService: Binder is dead - unregistering client (6)!
04-18 17:58:03.578 2971-2982/? D/BtGatt.GattService: stopScan() - queue=0
04-18 17:58:03.578 2971-2982/? D/BtGatt.GattService: stopScan() - queue empty; stopping scan
04-18 17:58:03.578 2971-2982/? D/BtGatt.btif: btif_gattc_scan
04-18 17:58:03.578 2971-2982/? D/BtGatt.GattService: unregisterClient() - clientIf=6
04-18 17:58:03.578 2971-2982/? D/BtGatt.btif: btif_gattc_unregister_app
04-18 17:58:03.578 2971-3014/? D/BtGatt.btif: btgattc_handle_event: Event 1003
04-18 17:58:03.578 2971-3014/? D/BtGatt.btif: btgattc_handle_event: Event 1001
04-18 17:58:03.578 2971-3088/? W/bt-l2cap: L2CA_RemoveFixedChnl() CID: 0x0004 BDA: f0c77f736820 not connected
04-18 17:58:03.578 1156-1539/? D/KeyguardViewMediator: setHidden false
04-18 17:58:03.578 1156-1539/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)
04-18 17:58:03.578 1156-1156/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)
04-18 17:58:03.578 2971-3014/? D/BtGatt.btif: btif_gattc_upstreams_evt: Event 5
04-18 17:58:03.578 2971-3014/? E/bt-btif: HAL bt_gatt_callbacks->client->close_cb
04-18 17:58:03.578 2971-3014/? D/BtGatt.GattService: onDisconnected() - clientIf=6, connId=6, address=F0:C7:7F:73:68:20
04-18 17:58:03.578 2971-3014/? E/BtGatt.ContextMap: Context not found for ID 6

  • 写回答

2条回答

  • 小菜陈 2017-04-25 09:52
    关注

    android ble很多坑,你只要理解了android ble具体的通信流程就会找到问题,我也做android ble应用,一堆坑,我现在单个连接通信没什么问题,一旦
    重复连接,多个设备,会发现有时无法完全断开,反正闹心

    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试