How to check if "Use GPS-provided time" is selected in "Automatic date & time" programmatically?

227 views Asked by At

I have a device with Android 7 that has "Use GPS-provided time" option in "Automatic date & time". I use this code to know if "Automatic date & time" vale

android.provider.Settings.Global.getInt(getContentResolver(), android.provider.Settings.Global.AUTO_TIME, 0);
  • "Use network-provided time" returns 1.
  • "Use GPS-provided time" returns 0.
  • "Off" returns 0.

So 0 value has 2 meanings. How can I know if "Use GPS-provided time" is selected?

0

There are 0 answers