Skip to content
This repository has been archived by the owner on Apr 20, 2020. It is now read-only.

Application crashes when Bluetooth is disabled #8

Open
assert-not-singularity opened this issue Mar 29, 2020 · 0 comments
Open

Application crashes when Bluetooth is disabled #8

assert-not-singularity opened this issue Mar 29, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@assert-not-singularity
Copy link
Member

When starting the application and Bluetooth is globally disabled in Android, the application crashes.

How to reproduce:

  1. Turn of bluetooth
  2. Start application with debugger attached

Expected behaviour:
Application requests user to turn on bluetooth or turns bluetooth on by itself.

Actual behaviour:
Application crashes with the following exception:

E/AndroidRuntime: FATAL EXCEPTION: main Process: app.bandemic, PID: 2171 java.lang.RuntimeException: Unable to create service app.bandemic.strict.service.TracingService: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.bluetooth.le.BluetoothLeAdvertiser.startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback)' on a null object reference at android.app.ActivityThread.handleCreateService(ActivityThread.java:3581) at android.app.ActivityThread.access$1300(ActivityThread.java:201) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6745) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.bluetooth.le.BluetoothLeAdvertiser.startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback)' on a null object reference at app.bandemic.strict.service.BleAdvertiser.startAdvertising(BleAdvertiser.java:74) at app.bandemic.strict.service.TracingService.onCreate(TracingService.java:109) at android.app.ActivityThread.handleCreateService(ActivityThread.java:3569) at android.app.ActivityThread.access$1300(ActivityThread.java:201)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6745)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

@assert-not-singularity assert-not-singularity added the bug Something isn't working label Mar 29, 2020
@assert-not-singularity assert-not-singularity changed the title application crashes when bluetooth is disabled Application crashes when Bluetooth is disabled Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant