Wheellog / Wheellog.Android

App for EUC on Android. Various popular unicycle manufacturers are supported.
GNU General Public License v3.0
61 stars 20 forks source link

fix when ble permission is denied #373

Closed paymicro closed 2 years ago

paymicro commented 2 years ago

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cooper.wheellog/com.cooper.wheellog.MainActivity}: java.lang.SecurityException: Permission Denial: starting Intent { act=android.bluetooth.adapter.action.REQUEST_ENABLE cmp=com.android.settings/.bluetooth.RequestPermissionActivity } from ProcessRecord{24e61f2 6370:com.cooper.wheellog/u0a381} (pid=6370, uid=10381) requires android.permission.BLUETOOTH_CONNECT at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4166) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4312) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2571) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8741) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.bluetooth.adapter.action.REQUEST_ENABLE cmp=com.android.settings/.bluetooth.RequestPermissionActivity } from ProcessRecord{24e61f2 6370:com.cooper.wheellog/u0a381} (pid=6370, uid=10381) requires android.permission.BLUETOOTH_CONNECT at android.os.Parcel.createExceptionOrNull(Parcel.java:3023) at android.os.Parcel.createException(Parcel.java:3007) at android.os.Parcel.readException(Parcel.java:2990) at android.os.Parcel.readException(Parcel.java:2932) at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2774) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1801) at android.app.Activity.startActivityForResult(Activity.java:5583) at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:712) at androidx.core.app.ActivityCompat$Api16Impl.startActivityForResult(ActivityCompat.java:809) at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:246) at com.cooper.wheellog.MainActivity.onCreate(MainActivity.java:524)