Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show snackbar if sensor can't be enabled due to missing permissions #2549

Merged
merged 2 commits into from
May 29, 2022

Conversation

jpelgrom
Copy link
Member

Summary

When enabling a sensor, instead of silently failing if not all required permissions are granted, inform the user that a sensor cannot be enabled due to missing permissions and provide a link to change the setting. If possible, name the specific permission that is required. This is especially useful if the permission has been 'permanently' denied and Android doesn't even show a dialog; without this PR it simply looks like nothing is happening.

Screenshots

Light Dark
Settings for the Bluetooth connection sensor, with an alert at the bottom of the screen because the user tried enabling the sensor but hasn't granted the required permissions. The alert text is "Requires 'Nearby devices' permission" and a button "Settings" is shown on the right. Light mode. Settings for the Bluetooth connection sensor, with an alert at the bottom of the screen because the user tried enabling the sensor but hasn't granted the required permissions. The alert text is "Requires 'Nearby devices' permission" and a button "Settings" is shown on the right. Dark mode

Link to pull request in Documentation repository

n/a

Any other notes

 - Instead of silently failing, inform the user that a sensor cannot be enabled due to missing permissions and provide a link to change the setting. If possible, name the specific permission that is required.
…-denied

# Conflicts:
#	app/src/main/java/io/homeassistant/companion/android/settings/sensor/views/SensorDetailView.kt
@JBassett JBassett merged commit 0094f91 into home-assistant:master May 29, 2022
@jpelgrom jpelgrom deleted the sensor-permission-denied branch May 29, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants