Android api 24后台altbeacon监控不工作

Android api 24 background altbeacon monitoring does not work

嗨,我有一个应用程序在 android 6.0 和 5.0 上稳定运行,即使应用程序被杀死,它也会检测到区域中的信标。但是当我在具有 android N 版本的 Sony Z5 上安装应用程序时,它仅在前台检测到。以下是应用程序被杀死时的日志。扫描开始但未检测到。 api 24 是否存在已知错误?

public class MainApplication extends Application implements ReactApplication, BootstrapNotifier {

private static final String BEACON_TAG = "BeaconModule";

// TODO get server url from gradle
public static final String SERVER_URL = "";

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
        return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
                new MainReactPackage(),
                new VectorIconsPackage(),
                new RNSharedPreferencesReactPackage()
        );
    }
};

@Override
public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
}

@Override
public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);

    initializeBeaconManager();

}

private void initializeBeaconManager() {
    new BackgroundPowerSaver(this);
    BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this);
    beaconManager.getBeaconParsers().clear();
    beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
    beaconManager.setBackgroundScanPeriod(10000L);
    beaconManager.setBackgroundBetweenScanPeriod(30000L);
    initializeBeaconRegions();
}

public void initializeBeaconRegions() {
    BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this);
    List<Region> regions = new ArrayList<Region>();

    /* here is some stuff to get new regions from server*/

    List<Region> deleteRegions = new ArrayList<>();
    for (Region mRegion : beaconManager.getMonitoredRegions()) {
        if (!regions.contains(mRegion)) {
            deleteRegions.add(mRegion);
        }
    }
    for (Region delRegion : deleteRegions) {
        beaconManager.getMonitoredRegions().remove(delRegion);
    }

    new RegionBootstrap(this, regions);
}

@Override
public void didEnterRegion(Region region) {
    Log.d(BEACON_TAG, "did enter region.");
}

@Override
public void didExitRegion(Region region) {
    Log.d(BEACON_TAG, "did exit region.");
}

@Override
public void didDetermineStateForRegion(int i, Region region) {
}}
04-13 17:51:31.343 3524-3543/com.workzonemobile D/BluetoothAdapter: STATE_ON 04-13 17:51:31.345 11401-11433/? D/BtGatt.GattService: stopScan() - queue size =1 04-13 17:51:31.347 11401-11424/? D/BtGatt.ScanManager: stop scan 04-13 17:51:31.352 11401-11456/? D/BtGatt.GattService: unregisterClient() - clientIf=5 04-13 17:51:31.360 3524-3543/com.workzonemobile D/BluetoothAdapter: STATE_ON 04-13 17:51:31.362 11401-11421/? D/BtGatt.GattService: onScanFilterParamsConfigured() - clientIf=5, status=0, action=1, availableSpace=16 04-13 17:51:31.362 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:51:31.362 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=0 04-13 17:51:31.362 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=0 04-13 17:51:31.362 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue emtpy, scan stopped 04-13 17:51:31.367 11401-11456/? D/BtGatt.GattService: registerClient() - UUID=25b0c522-5506-4976-8843-d57fa774c50b 04-13 17:51:31.368 11401-11421/? D/BtGatt.GattService: onClientRegistered() - UUID=25b0c522-5506-4976-8843-d57fa774c50b, clientIf=5 04-13 17:51:31.368 3524-3538/com.workzonemobile D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5 mClientIf=0 04-13 17:51:31.369 11401-11455/? D/BtGatt.GattService: start scan with filters 04-13 17:51:31.374 11401-11424/? D/BtGatt.ScanManager: handling starting scan 04-13 17:51:31.379 11401-11421/? D/BtGatt.GattService: onScanFilterEnableDisabled() - clientIf=5, status=0, action=1 04-13 17:51:31.379 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:51:31.379 11401-11424/? D/BtGatt.ScanManager: configureFilterParamter 500 10000 1 0 04-13 17:51:31.381 11401-11421/? D/BtGatt.GattService: onScanFilterParamsConfigured() - clientIf=5, status=0, action=0, availableSpace=15 04-13 17:51:31.381 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:51:31.381 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=1 04-13 17:51:31.381 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648 04-13 17:51:31.381 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams - scanInterval = 8000configureRegularScanParams - scanWindow = 8000 04-13 17:51:31.383 11401-11421/? D/BtGatt.GattService: onScanParamSetupCompleted : 0 04-13 17:51:32.310 2102-1620/? I/BroadcastQueue: am_broadcast_enqueue: [background,0,Intent { act=android.bluetooth.device.action.NAME_CHANGED flg=0x4000010 (has extras) },1] 04-13 17:51:32.312 2102-2135/? I/BroadcastQueue: am_broadcast_finished: [background,0,Intent { act=android.bluetooth.device.action.NAME_CHANGED flg=0x4000010 (has extras) }] 04-13 17:51:32.315 2102-5969/? I/BroadcastQueue: am_broadcast_enqueue: [background,0,Intent { act=android.bluetooth.device.action.CLASS_CHANGED flg=0x4000010 (has extras) },2] 04-13 17:51:32.317 2102-2135/? I/BroadcastQueue: am_broadcast_finished: [background,0,Intent { act=android.bluetooth.device.action.CLASS_CHANGED flg=0x4000010 (has extras) }] 04-13 17:51:32.500 9120-9120/? I/libmdmdetect: ESOC framework not supported 04-13 17:51:32.500 9120-9120/? I/libmdmdetect: Found internal modem: modem 04-13 17:51:32.497 9120-9120/? W/qcom-system-dae: type=1400 audit(0.0:266131): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:51:32.501 9120-9120/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:51:32.501 9120-9120/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:51:32.501 9120-9120/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:51:32.501 9120-9120/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:51:35.278 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:51:35.279 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:51:36.945 2102-2135/? I/ActivityManager: Waited long enough for: ServiceRecord{f229130 u0 com.sonyericsson.advancedwidget.weather/com.sonymobile.weatherservice.service.WeatherService} 04-13 17:51:37.515 11020-11070/? V/ClClient: SEND(411) KeepAliveRequest_4{} UID:a8ad154c-6d6c-46fc-8ff1-6a86ef230e78 04-13 17:51:37.580 9193-9193/? I/libmdmdetect: ESOC framework not supported 04-13 17:51:37.577 9193-9193/? W/qcom-system-dae: type=1400 audit(0.0:266132): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:51:37.581 9193-9193/? I/libmdmdetect: Found internal modem: modem 04-13 17:51:37.582 9193-9193/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:51:37.582 9193-9193/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:51:37.582 9193-9193/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:51:37.582 9193-9193/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:51:37.782 11020-11068/? V/ClClient: RECV(411) +0,3s KeepAliveResponse_5{hasEstablishedSession=true} 04-13 17:51:41.332 2102-2388/? I/BroadcastQueue: am_broadcast_enqueue: [background,1,Intent { act=X.2U7.ACTION_ALARM.com.facebook.katana.Mqtt_Wakeup flg=0x14 pkg=com.facebook.katana (has extras) },1] 04-13 17:51:41.344 2102-2117/? I/BroadcastQueue: am_broadcast_finished: [background,1,Intent { act=X.2U7.ACTION_ALARM.com.facebook.katana.Mqtt_Wakeup flg=0x14 pkg=com.facebook.katana (has extras) }] 04-13 17:51:41.349 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:51:41.349 11401-11401/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=3 mRoam=0 mBatteryCharge=2 04-13 17:51:41.349 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:51:41.349 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 11, size: 0 04-13 17:51:41.414 3524-3543/com.workzonemobile D/BluetoothAdapter: STATE_ON 04-13 17:51:41.415 11401-11412/? D/BtGatt.GattService: stopScan() - queue size =1 04-13 17:51:41.416 11401-11424/? D/BtGatt.ScanManager: stop scan 04-13 17:51:41.416 11401-11413/? D/BtGatt.GattService: unregisterClient() - clientIf=5 04-13 17:51:41.422 3524-3543/com.workzonemobile D/BluetoothAdapter: STATE_ON 04-13 17:51:41.428 11401-11421/? D/BtGatt.GattService: onScanFilterParamsConfigured() - clientIf=5, status=0, action=1, availableSpace=16 04-13 17:51:41.428 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:51:41.429 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=0 04-13 17:51:41.429 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=2 04-13 17:51:41.429 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue emtpy, scan stopped 04-13 17:51:41.431 11401-11413/? D/BtGatt.GattService: registerClient() - UUID=35f07f8d-a3a2-4d71-9d28-1db8ad2262fc 04-13 17:51:41.433 11401-11421/? D/BtGatt.GattService: onClientRegistered() - UUID=35f07f8d-a3a2-4d71-9d28-1db8ad2262fc, clientIf=5 04-13 17:51:41.433 3524-3537/com.workzonemobile D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5 mClientIf=0 04-13 17:51:41.434 11401-11433/? D/BtGatt.GattService: start scan with filters 04-13 17:51:41.440 11401-11424/? D/BtGatt.ScanManager: handling starting scan 04-13 17:51:41.445 11401-11421/? D/BtGatt.GattService: onScanFilterEnableDisabled() - clientIf=5, status=0, action=1 04-13 17:51:41.445 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:51:41.445 11401-11424/? D/BtGatt.ScanManager: addFilterToController: 5 04-13 17:51:41.447 11401-11421/? D/BtGatt.GattService: onScanFilterConfig() - clientIf=5, action = 0 status = 0, filterType=5, availableSpace=47 04-13 17:51:41.447 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:51:41.447 11401-11424/? D/BtGatt.ScanManager: configureFilterParamter 500 10000 1 0 04-13 17:51:41.449 11401-11421/? D/BtGatt.GattService: onScanFilterParamsConfigured() - clientIf=5, status=0, action=0, availableSpace=15 04-13 17:51:41.449 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:51:41.449 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=1 04-13 17:51:41.449 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=0 mLastConfiguredScanSetting=-2147483648 04-13 17:51:41.449 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams - scanInterval = 8000configureRegularScanParams - scanWindow = 800 04-13 17:51:41.456 11401-11421/? D/BtGatt.GattService: onScanParamSetupCompleted : 0 04-13 17:51:42.657 9273-9273/? W/qcom-system-dae: type=1400 audit(0.0:266133): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:51:42.663 9273-9273/? I/libmdmdetect: ESOC framework not supported 04-13 17:51:42.664 9273-9273/? I/libmdmdetect: Found internal modem: modem 04-13 17:51:42.664 9273-9273/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:51:42.664 9273-9273/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:51:42.664 9273-9273/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:51:42.664 9273-9273/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:51:44.236 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:51:44.237 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:51:46.477 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:51:46.478 11401-11401/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=0 mRoam=0 mBatteryCharge=2 04-13 17:51:46.478 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:51:46.478 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 11, size: 0 04-13 17:51:47.550 11020-11070/? V/ClClient: SEND(412) KeepAliveRequest_4{} UID:95cae389-7bb7-456c-a60b-b460ab6802f6 04-13 17:51:47.728 9353-9353/? I/libmdmdetect: ESOC framework not supported 04-13 17:51:47.729 9353-9353/? I/libmdmdetect: Found internal modem: modem 04-13 17:51:47.717 9353-9353/? W/qcom-system-dae: type=1400 audit(0.0:266134): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:51:47.729 9353-9353/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:51:47.729 9353-9353/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:51:47.729 9353-9353/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:51:47.729 9353-9353/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:51:47.809 11020-11068/? V/ClClient: RECV(412) +0,3s KeepAliveResponse_5{hasEstablishedSession=true} 04-13 17:51:50.422 2102-2932/? I/BroadcastQueue: am_broadcast_enqueue: [background,0,Intent { act=android.bluetooth.device.action.NAME_CHANGED flg=0x4000010 (has extras) },1] 04-13 17:51:50.424 2102-2135/? I/BroadcastQueue: am_broadcast_finished: [background,0,Intent { act=android.bluetooth.device.action.NAME_CHANGED flg=0x4000010 (has extras) }] 04-13 17:51:50.427 2102-1617/? I/BroadcastQueue: am_broadcast_enqueue: [background,0,Intent { act=android.bluetooth.device.action.CLASS_CHANGED flg=0x4000010 (has extras) },2] 04-13 17:51:50.428 2102-2135/? I/BroadcastQueue: am_broadcast_finished: [background,0,Intent { act=android.bluetooth.device.action.CLASS_CHANGED flg=0x4000010 (has extras) }] 04-13 17:51:50.956 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:51:50.957 11401-11401/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=2 mRoam=0 mBatteryCharge=2 04-13 17:51:50.957 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:51:50.957 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 11, size: 0 04-13 17:51:52.011 2102-1616/? I/ActivityManager: Killing 3592:com.foursquare.robin/u0a146 (adj 906): empty #17 04-13 17:51:52.062 2102-5710/? D/ActivityManager: cleanUpApplicationRecord -- 3592 04-13 17:51:52.807 9421-9421/? W/qcom-system-dae: type=1400 audit(0.0:266135): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:51:52.813 9421-9421/? I/libmdmdetect: ESOC framework not supported 04-13 17:51:52.813 9421-9421/? I/libmdmdetect: Found internal modem: modem 04-13 17:51:52.813 9421-9421/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:51:52.813 9421-9421/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:51:52.814 9421-9421/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:51:52.814 9421-9421/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:51:53.198 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:51:53.199 11401-11401/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=0 mRoam=0 mBatteryCharge=2 04-13 17:51:53.199 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:51:53.200 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 11, size: 0 04-13 17:51:57.551 11020-11070/? V/ClClient: SEND(413) KeepAliveRequest_4{} UID:03758b58-901d-47fc-8474-e020b3e27a6b 04-13 17:51:57.776 2102-2102/? I/BroadcastQueue: am_broadcast_enqueue: [background,0,Intent { act=android.intent.action.BATTERY_CHANGED flg=0x60000010 (has extras) },27] 04-13 17:51:57.781 2534-2534/? D/KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED 04-13 17:51:57.781 3186-3315/? W/QCNEJ: |CORE| CNE received unexpected action: android.intent.action.BATTERY_CHANGED 04-13 17:51:57.787 2495-2495/? D/TransmitPowerReceiver: Old PowerLevel: 6, current PowerLevel: 6 04-13 17:51:57.790 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 10, size: 0 04-13 17:51:57.790 11401-11434/? D/HeadsetStateMachine: Enter processIntentBatteryChanged() 04-13 17:51:57.790 11401-11434/? D/HeadsetStateMachine: Exit processIntentBatteryChanged() 04-13 17:51:57.790 11401-11434/? D/HeadsetStateMachine: Exit Disconnected processMessage() 04-13 17:51:57.792 2102-2135/? I/BroadcastQueue: am_broadcast_finished: [background,0,Intent { act=android.intent.action.BATTERY_CHANGED flg=0x60000010 (has extras) }] 04-13 17:51:57.795 2534-2534/? D/KeyguardUpdateMonitor: handleBatteryUpdate 04-13 17:51:57.857 9496-9496/? W/qcom-system-dae: type=1400 audit(0.0:266136): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:51:57.867 9496-9496/? I/libmdmdetect: ESOC framework not supported 04-13 17:51:57.868 9496-9496/? I/libmdmdetect: Found internal modem: modem 04-13 17:51:57.868 9496-9496/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:51:57.868 9496-9496/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:51:57.868 9496-9496/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:51:57.868 9496-9496/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:51:57.910 11020-11068/? V/ClClient: RECV(413) +0,4s KeepAliveResponse_5{hasEstablishedSession=true} 04-13 17:51:59.588 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:51:59.588 11401-11401/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=2 mRoam=0 mBatteryCharge=2 04-13 17:51:59.588 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:51:59.589 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 11, size: 0 04-13 17:52:02.154 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:52:02.155 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:52:02.947 9577-9577/? W/qcom-system-dae: type=1400 audit(0.0:266137): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:52:02.952 9577-9577/? I/libmdmdetect: ESOC framework not supported 04-13 17:52:02.952 9577-9577/? I/libmdmdetect: Found internal modem: modem 04-13 17:52:02.952 9577-9577/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:52:02.952 9577-9577/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:52:02.953 9577-9577/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:52:02.953 9577-9577/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:52:04.396 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:52:04.396 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:52:07.551 11020-11070/? V/ClClient: SEND(414) KeepAliveRequest_4{} UID:e30cefc4-a17c-4fae-95d4-42b2f0d71d33 04-13 17:52:07.839 11020-11068/? V/ClClient: RECV(414) +0,3s KeepAliveResponse_5{hasEstablishedSession=true} 04-13 17:52:08.030 9646-9646/? I/libmdmdetect: ESOC framework not supported 04-13 17:52:08.031 9646-9646/? I/libmdmdetect: Found internal modem: modem 04-13 17:52:08.031 9646-9646/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:52:08.031 9646-9646/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:52:08.031 9646-9646/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:52:08.031 9646-9646/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:52:08.027 9646-9646/? W/qcom-system-dae: type=1400 audit(0.0:266138): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:52:08.879 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:52:08.879 11401-11401/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=3 mRoam=0 mBatteryCharge=2 04-13 17:52:08.879 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:52:08.880 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 11, size: 0 04-13 17:52:11.116 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:52:11.117 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:52:11.332 3524-3543/com.workzonemobile D/BluetoothAdapter: STATE_ON 04-13 17:52:11.333 11401-11433/? D/BtGatt.GattService: stopScan() - queue size =1 04-13 17:52:11.335 11401-11424/? D/BtGatt.ScanManager: stop scan 04-13 17:52:11.338 11401-11456/? D/BtGatt.GattService: unregisterClient() - clientIf=5 04-13 17:52:11.349 3524-3543/com.workzonemobile D/BluetoothAdapter: STATE_ON 04-13 17:52:11.351 11401-11421/? D/BtGatt.GattService: onScanFilterParamsConfigured() - clientIf=5, status=0, action=1, availableSpace=16 04-13 17:52:11.351 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:52:11.351 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=0 04-13 17:52:11.351 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=0 04-13 17:52:11.351 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue emtpy, scan stopped 04-13 17:52:11.355 11401-11413/? D/BtGatt.GattService: registerClient() - UUID=97dd9d99-06c9-41c0-8696-517aa5360489 04-13 17:52:11.356 11401-11421/? D/BtGatt.GattService: onClientRegistered() - UUID=97dd9d99-06c9-41c0-8696-517aa5360489, clientIf=5 04-13 17:52:11.356 3524-5572/com.workzonemobile D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5 mClientIf=0 04-13 17:52:11.357 11401-11456/? D/BtGatt.GattService: start scan with filters 04-13 17:52:11.364 11401-11424/? D/BtGatt.ScanManager: handling starting scan 04-13 17:52:11.367 11401-11421/? D/BtGatt.GattService: onScanFilterEnableDisabled() - clientIf=5, status=0, action=1 04-13 17:52:11.367 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:52:11.367 11401-11424/? D/BtGatt.ScanManager: configureFilterParamter 500 10000 1 0 04-13 17:52:11.369 11401-11421/? D/BtGatt.GattService: onScanFilterParamsConfigured() - clientIf=5, status=0, action=0, availableSpace=15 04-13 17:52:11.369 11401-11421/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0 04-13 17:52:11.370 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=1 04-13 17:52:11.370 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648 04-13 17:52:11.370 11401-11424/? D/BtGatt.ScanManager: configureRegularScanParams - scanInterval = 8000configureRegularScanParams - scanWindow = 8000 04-13 17:52:11.371 11401-11421/? D/BtGatt.GattService: onScanParamSetupCompleted : 0 04-13 17:52:11.511 2102-5969/? I/BroadcastQueue: am_broadcast_enqueue: [background,0,Intent { act=android.bluetooth.device.action.NAME_CHANGED flg=0x4000010 (has extras) },1] 04-13 17:52:11.512 2102-2135/? I/BroadcastQueue: am_broadcast_finished: [background,0,Intent { act=android.bluetooth.device.action.NAME_CHANGED flg=0x4000010 (has extras) }] 04-13 17:52:11.519 2102-22925/? I/BroadcastQueue: am_broadcast_enqueue: [background,0,Intent { act=android.bluetooth.device.action.CLASS_CHANGED flg=0x4000010 (has extras) },2] 04-13 17:52:11.520 2102-2135/? I/BroadcastQueue: am_broadcast_finished: [background,0,Intent { act=android.bluetooth.device.action.CLASS_CHANGED flg=0x4000010 (has extras) }] 04-13 17:52:13.107 9723-9723/? W/qcom-system-dae: type=1400 audit(0.0:266139): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:52:13.113 9723-9723/? I/libmdmdetect: ESOC framework not supported 04-13 17:52:13.114 9723-9723/? I/libmdmdetect: Found internal modem: modem 04-13 17:52:13.114 9723-9723/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:52:13.114 9723-9723/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:52:13.114 9723-9723/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13 04-13 17:52:13.114 9723-9723/? E/QCOMSysDaemon: Diag_LSM_Init failed : 0 04-13 17:52:13.356 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:52:13.356 11401-11401/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=2 mRoam=0 mBatteryCharge=2 04-13 17:52:13.357 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:52:13.357 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 11, size: 0 04-13 17:52:16.909 11401-11401/? D/HeadsetPhoneState: Enter onSignalStrengthsChanged 04-13 17:52:16.909 11401-11401/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=3 mRoam=0 mBatteryCharge=2 04-13 17:52:16.909 11401-11401/? D/HeadsetPhoneState: Exit onSignalStrengthsChanged 04-13 17:52:16.910 11401-11434/? D/HeadsetStateMachine: Disconnected process message: 11, size: 0 04-13 17:52:17.541 11020-11070/? V/ClClient: SEND(415) KeepAliveRequest_4{} UID:784cef6d-1b6e-4f96-92ed-54b37f0eb936 04-13 17:52:17.828 11020-11068/? V/ClClient: RECV(415) +0,3s KeepAliveResponse_5{hasEstablishedSession=true} 04-13 17:52:18.187 9795-9795/? W/qcom-system-dae: type=1400 audit(0.0:266140): avc: denied { read write } for name="diag" dev="tmpfs" ino=1993 scontext=u:r:qcomsysd:s0 tcontext=u:object_r:diag_device:s0 tclass=chr_file permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init" 04-13 17:52:18.194 9795-9795/? I/libmdmdetect: ESOC framework not supported 04-13 17:52:18.195 9795-9795/? I/libmdmdetect: Found internal modem: modem 04-13 17:52:18.195 9795-9795/? E/QCOMSysDaemon: Can't find/open bootselect node: (No such file or directory) 04-13 17:52:18.195 9795-9795/? I/QCOMSysDaemon: Starting qcom system daemon 04-13 17:52:18.195 9795-9795/? E/Diag_Lib: Diag_LSM_Init: Failed to open handle to diag driver, error = 13

当应用程序处于后台时,Sony Z5 似乎根本没有检测到蓝牙 LE 数据包。 这可能是特定于设备的问题,也可能是特定于供应商的 OS 修改。

这可能有助于找到一种解决方法,以在应用程序进行全面扫描的后台期间捕获额外的调试日志记录(包括系统级调试消息,而不仅仅是您的应用程序)。使用问题中显示的设置,这将每 40 秒发生 10 秒,并将由如下调试行指示:

04-12 15:52:20.989 15256-15256/com.workzonemobile D/CycledLeScannerForLollipop: starting non-filtered scan in SCAN_MODE_LOW_LATENCY

如果您可以围绕这样一行提供 60 秒摘录的此类日志,我也许可以用更有用的内容来修改此答案以解决您的问题。