There are many apps which require location permission to operate. For example, BUMBLE. While using the app, if I disable location from the notification bar, it immediately knows, and degrades the functionality, while preserving the state of the app. When I turn it back on, it resumes full functionality. How to implement the same thing in my Android app? Bluetooth being enabled is crucial to the functioning of my app.
EDIT: I'm mainly interested in implementing a similar system for Bluetooth. My app involves many activities like scanning for ble devices, maintaining ble connections and communication, etc, which makes the app crash when the user turns off bluetooth from the notification bar.