New Leo_6.3.24: Nosuchmethodexception: Setmobiledataenabled [boolean]


Mixxalych

Members
Mar 28, 2016
104
28
Hi guys,

Today I have installed the latest ROM [ xiaomi.eu_multi_leo_6.3.24_v7-5.1 ] to my Mi Note Pro followed by the installation of "Where is My Droid" application from Google Play:

While perfectly working on "legitimate" EU mobiles, it never worked properly on Xiaomi for various resons. In this particular case, I was able to see the probable cause via logcat (please see relevant part attached). It looks like once mobile receives the request to return its location:

Code:
> I/GCM     ( 5125): GCM message com.alienmanfc6.wheresmyandroid 0:1459283109279756%e9b9e882000190aa

> I/ActivityManager( 1140): Start proc 12381:com.alienmanfc6.wheresmyandroid/u0a80 for broadcast com.alienmanfc6.wheresmyandroid/.receivers.GcmReceiver

the following exception is thrown:

Code:
> java.lang.NoSuchMethodException: setMobileDataEnabled [boolean]

It is my understanding that this happens because the method either does not exist (which I doubt) or not made public .

This can be easily reproduced on a free version of a "Where Is My Droid" app if required.

Please comment.
Thanks a lot!

Cheers,
Mixxalych
 

Attachments

  • log-xiaomi.txt
    10.6 KB · Views: 625
UPDATE: Having researched the case a bit more I bumped on the threads 1 and 2 and Google Issue #78084 that suggest that this is working as intended:

In Android L 5.xx the hidden API setMobileDataEnabled method is removed and it can no longer be used. You can verify this in android lolipop source code under /frameworks/base/core/java/android/net/ConnectivityManager.java

Would you guys please confirm that it is indeed the case with leo 6.3.24 ?
 
Hmmm, this is where it gets interesting - received a reply from their Lead Developer:

Hello I am the lead developer for the Where's My Droid app.

The setMobileDataEnabled function is something of our making. I was unaware that there even was a hidden API in the system named the same thing. We built our own method for enabling and disabling mobile data by manipulating some system settings though the ConnectivityManager.

The app has been tested and works all the way up though Android 6.0 with no issues. Does the device your using have mobile data? Its possible that if its a tablet with no mobile data that this function may fail. We should be catching any possible error, but you know how that goes.

I will look into this issue more for you though.

I probably should tell him that this is, in fact, a Xiaomi Mi Pro that does have mobile data. Still, is there a chance that the are somehow calling the System API instead of their proprietary one?

SIDE NOTE: Is there any way I could access LEO ROM repositories? Not that I am an awesome programmer, but could give it a look :)