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

Application crashes when Bluetooth is disabled #8

Description

@assert-not-singularity

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions