I'm using 2 apps, "MacroDroid" and AutoInput", I set a command(Macro) that would turn on mobile data and location. But when I sent the text, it shows that mobile data and location are "on" but only location works. And when I try to manually turn on data it won't work unless I restart my phone. Why is this happening?

Edit : From comments. OP used commands to give elevated privileges to an unrooted device for MacroDroid


3 Answers 3


Using commands to gain elevated privileges is a hack and is not guaranteed to give you behavior as on a rooted device

With this holds true for turning data off /on. See my comment in the app forums and developer 's reply

The common behaviour I see is that it does actually enable/disable data but then you cannot modify it later using the system controls until you reboot. However anything that is done via a hack like this may be subject to failure on different devices as it's always possible to have different implementations from other manufacturers that prevent the hack working.

  • You may need to log in to see the link the forum. You can access the forum from within the app too
    – beeshyams
    Aug 25, 2018 at 5:33
  • @ beeshyams This is helpful, however I can't find the "else" clause. Do you know where that would be?
    – Samurai
    Aug 25, 2018 at 17:53
  • I suppose you are asking for "else" clause in actions. Else is always associated with if. Create an "if" condition and tap on that to reveal a menu by which you can create else
    – beeshyams
    Aug 25, 2018 at 18:04

Provided that you have already set permission to modify SECURE_SETTINGS, then this trick may work for you. I read from the forum that they are using Wifi toggle to enable Mobile data for unrooted device.

BUT it's not useful in all cases since, other than turning on the Wifi Macrodroid also needed to connect to a Wifi connection before turning off Wifi to make the Mobile data trick turn on.

So what I discover instead, which is not present yet in the forum, and have not posted yet. Instead of using Wifi, you can:

  • Mobile data on
  • Turn on Hotspot
  • Turn off Hotspot

After that Mobile data should turn on. It's working on my device using Android 8.0.

PS. I can't find any trick to turn off the mobile data. Let me know if you find some. Thanks.


My problem is, that mobile data is not switched off. To be exact, mobile data indicator is off, but real data transfer is still on.

My solution for this is, to set in Macrodroid sequence:

  • Turn off mobile data
  • Turn on airplane mode
  • Sleep 5 sec.
  • Turn off airplane mode

It's working with my device with Android 9.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .