I am making a system app SDK9+ ( has WRITE_SECURE_SETTINGS permissions )
I repeat this is for a close group of people and is a system app
I can turn GPS on but can't turn it off with this code :
public void gpsOn () { //This works
try {
Settings.Secure.setLocationProviderEnabled(mContext.getContentResolver(), LocationManager.GPS_PROVIDER, true);
} catch (Exception e) {
Log.i(TAG, e.getMessage());
}
}
public void gpsOff () { // This doesn't work why?
try {
Settings.Secure.setLocationProviderEnabled(mContext.getContentResolver(), LocationManager.GPS_PROVIDER, false);
} catch (Exception e) {
Log.i(TAG, e.getMessage());
}
}
It just fails silently no log/exception what so ever