unable to set preferred network type

336 views
Skip to first unread message

boleslav...@gmail.com

unread,
Jul 11, 2016, 5:05:55 AM7/11/16
to Automate
Hi!
When I try to use block "Set mobile network" with any option except 2G, it raises the error "java.lang.IllegalStateException: Failed to set preferred network type". If 2G option is selected, it does nothing. All permissions are installed.
Any suggestions?

Device Xiaomi Redmi Note 2
Android 5.0.1 MIUI 8 6.7.7
Rooted SuperSu

Henrik "The Developer" Lindqvist

unread,
Jul 11, 2016, 2:21:24 PM7/11/16
to Automate, boleslav...@gmail.com
The block work, the error is raised by Android when it fail to set the value.

Please enable the "Debug logging" option in Automate settings and run the flow again. The flow log will then contain some additional information.
Message has been deleted

boleslav...@gmail.com

unread,
Jul 12, 2016, 4:25:03 AM7/12/16
to Automate, boleslav...@gmail.com
2016-07-12 11:20:17.714 INFO 74@3: Mobile network preferred set
2016-07-12 11:20:17.715 DBUG 74@3: MobileNetworkPreferredSet PREFERRED_NETWORK_MODE: 9
2016-07-12 11:20:17.715 DBUG 74@3: MobileNetworkPreferredSet getLteOnCdmaModeStatic: false
2016-07-12 11:20:17.718 DBUG 74@3: MobileNetworkPreferredSet Setting preferred network type: 9
2016-07-12 11:20:18.380 FAIL 74@3: java.lang.IllegalStateException: Failed to set preferred network type
2016-07-12 11:20:18.382 INFO 74@3: Stopped by failure

Henrik "The Developer" Lindqvist

unread,
Jul 12, 2016, 5:40:38 PM7/12/16
to Automate, boleslav...@gmail.com
Android doesn't even allow setting value 9 which is the default mode (PREFERRED_NETWORK_MODE).
Why? It's impossible for me to tell since Android just returns false (java.lang.IllegalStateException) without any further error description.

boleslav...@gmail.com

unread,
Jul 14, 2016, 5:24:55 AM7/14/16
to Automate, boleslav...@gmail.com
Woohoo! I solved the problem!

LogCat showed me "[PhoneIntfMgr] setPreferredNetworkType: CommandException: com.android.internal.telephony.CommandException: MODE_NOT_SUPPORTED".
My phone has 2 SIM cards. First slot was for calls and second was for the internet. I swapped SIM cards and now everything works fine. I think Automate can set preferred network type only to the first SIM card.

Henrik "The Developer" Lindqvist

unread,
Jul 14, 2016, 2:47:27 PM7/14/16
to Automate, boleslav...@gmail.com
Yes, the Android API doesn't support specifying a SIM, or at least it didn't. I'll check if it Android N supports it.
Reply all
Reply to author
Forward
0 new messages