Is there a variable or formula that indicates if location is set ON or OFF on the individual device?

Android users can toggle their location ON or OFF on their device. Is there any variable or formula to detect this?

I'm looking for something boolean like $si(alarmon)$ but for location. Something along the lines of a non-existing $si(locationon)$ which would return 1 or 0.

Not 0 and 1 but hope it helps :D

How did I miss that? lol Thanks a lot!