Turning off/on all data - conflict feature control??

RP
Ricky Palmer
Breezemount UK Limited

Hi I have used the .cmd method, script below, but had the off/on all in one file, this worked fine turning off and back on the WIFI, Bluetooth but when I tried with mobile data I received a log entry Script command is not supported by device (setmobiledata) so the  setmobiledata 0 does not seem to work. This is on a Honeywell EDA51 on Android Enterprise and carrier O2?

setradioenable bt 0
setradioenable wifi 0
setradioenable phone 0
setmobiledata 0
setradioenable bt 1
setradioenable wifi 1
setradioenable phone 1
setmobiledata 1

Reading the help it says

Note: These settings may conflict with device feature control, and settings are non-restrictive and non-persistent.

Not sure where to look for this

Edited 4 years ago
Android Scripting
ANSWERS
RC
Raymond Chan Diamond Contributor
4 years ago (edited 4 years ago)

If there is log entry explicitly stating that  a script command ("setmobiledata" in your case)  is not supported, then no time should be wasted to try it out any more on the same device agent.

If  a device is enrolled with an Android-Enterprise device agent, then the following command might be used to turn off mobile data:

   writesecureprofstring DeviceFeature DisableCellularData 1

   apply featurecontrol

If the above doesn't work, and if it's OK to turn off even cellular voice and SMS/MMS, then the following supposedly standard Android-Enterprise script command for turning off the cellular radio may also be tried  :

      writesecuresetting -glo radio_cell   0

RP
Ricky Palmer
4 years ago

Hi Raymond

Thanks for your reply, do either of these options turn off and then turn back on? The problem I have is an app is started via a lockdown and over time this app starts buffering and not sending back data, I have worked out that turning off all data, wifi etc and restarting forces the app to stop buffering and send the data. So this is just a stop start instruction that can be run from a .CMD file

Thanks

RC
Raymond Chan Diamond Contributor
4 years ago (edited 4 years ago)

Hi Ricky,

Assuming that the script commands mentioned earlier work on your device, you can try something like the following with an arbitrary delay of 5 seconds, which you should tune to the right value for your device:

   writesecureprofstring DeviceFeature DisableCellularData 1

   apply featurecontrol

   sleep 5

   writesecureprofstring DeviceFeature DisableCellularData 0

   apply featurecontrol

OR

     writesecuresetting -glo radio_cell  0

     sleep  5

     writesecuresetting -glo radio_cell  1

RP
Ricky Palmer
4 years ago

Hi Raymond

the 

   writesecureprofstring DeviceFeature DisableCellularData 1

   apply featurecontrol

script works to turn off data but the same with zero does not turn it back on

Thanks

RC
Raymond Chan Diamond Contributor
4 years ago

Hi Ricky,

I am not aware that setting a value of zero to this key does not reverse the operation.  This was actually the cases for a handful of other feature-control policies (e.g. enforce hardware GPS) in the past.   

So, unless Google and/or Soti change the behaviour of the MDM API to allow reversing the action with the script command parameter 0, there is nothing we can do   I am not aware of any other substitute script command that can be used to support your use case.  Maybe someone from Soti can reveal alternative or some workaround.

RP
Ricky Palmer
4 years ago

Hi Raymond

Thanks for the update, if you don't know then I doubt any one at Soti will no

R
Rafael Gold Contributor
4 years ago

I think why it doesn't turn on  when you send

   writesecureprofstring DeviceFeature DisableCellularData 0

   apply featurecontrol

Because it only sets the featurecontrol, so 0 says you just enable the use of celluar data but doesn't turn it on.

To disable/enable mobile data you should be able to use following after you changed the feature control:

   writesecureprofstring DeviceFeature DisableCellularData 1

   apply featurecontrol

   sleep 5

   writesecureprofstring DeviceFeature DisableCellularData 0

   apply featurecontrol

   setradioenable phone 1

RC
Raymond Chan Diamond Contributor
4 years ago

Please note that, based on my tests done some weeks ago,  the script command  "setradioenable" does not work for some argument(s)  for devices running some newer Android version(s).    I am not sure if this problem is temporary, and if it will work 100% as before for new device agent/firmware versions with relevant patch(es).