enviroCar / enviroCar-app

enviroCar Android Application
https://envirocar.org
GNU General Public License v3.0
87 stars 153 forks source link

Add Permission Checks #971

Open javaman97 opened 1 year ago

javaman97 commented 1 year ago

Description

OnStart() method requests Bluetooth On/Off Permission which may be rejected or accepted by the user and similarly ensureDiscoverable() method requests Bluetooth discoverable permission, so we need to check permission if user has alloted or not.

Branch

develop( OBDSimulator.java )

Solution

We can explicitly import check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityException

check_permission_2 check_permission_1

SebaDro commented 1 year ago

Hi @javaman97 . Thanks for your contribution. I have to admit, that I do not really understand your report. Is there a critical issue with the permission check, which should be fixed? Can you explain the problem a little bit more in detail?

javaman97 commented 1 year ago

@SebaDro Thanks for appreciating my first-ever open-source contribution. Yes, while debugging the app, I come across this issue with adding checkPermission by the User to handle RunTime Permission. It is a critical issue as without handling it the app will crash. We can handle it manually or by just importing the "checkselfPermission" method in it.

For more details, please refer to https://developer.android.com/training/permissions/requesting#manage-request-code-yourself

Please assign me this task, I will fix it

SebaDro commented 9 months ago

Seems reasonable to me. Feel free to work on it 😃