In my application i got the Device Owner permissions, set through Adb shell.
Now I'm able to create a kios mode enviroment which allow the user to interact only with my app.
Next step, I'd like to programmatically turn on the Bluetooth and Location services without asking for any permissions.
In the Blutooth case I only need to get through the "Would you like to turn on bluetooth?" message, while with location is a bit more complicated.
Location to works requires the system permission, and then requires the user to turn it on.
How can I directly turn them on now that my App is in Device Owner Mode?
Thanks.
You can use the following command for enabling gps :
DevicePolicyManagerdpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
dpm.setSecureSetting(mDeviceAdmin, Settings.Secure.LOCATION_MODE, String.valueOf(Settings.Secure.LOCATION_MODE_HIGH_ACCURACY));
and the following for bluetooth
dpm.setSecureSetting(mDeviceAdmin, Settings.Secure.BLUETOOTH_ON, String.valueOf(1));