- Oct 6, 2016
- 9,851
- 322
Whoever told you "once I use a custom rom I can't help it and they recommended me to use the official version" is a lazy idiot. This is not our ROM's fault and not even the theme designers' fault. Xiaomi's implementation for "Data" Action for MAML themes is broken. This is from class com.miui.maml.util.MobileDataUtils of MiuiSystemUI.apk from Android 12:I tried everything to find a solution to the problem of lockscreen in which I can not activate and deactivate the mobile data if the theme I have has come up with something like that. I tried different official themes but the result is the same. I went from beta to stable with data format using first install script and the same problem, I switched from stable to beta again in vain, the problem persists. I sent an email to xiaomi with this problem and their answer was that once I use a custom rom I can't help it and they recommended me to use the official version.
I want to believe that Xiaomi has slowly started making fun of its own customers and future customers. I don't want their software variant because it has a lot of bugs.
I prefer custom in which their problems are eliminated by the developers. I don't know if in their official rom the users have this problem.
The fact that annoys me the most is that I didn't find anyone to test their official rom if they have this problem, who I asked said it was a bug as long as I use beta, but honestly stable is the same thing. In short, I do not blame anyone in this community. The only culprits are those who accept Xiaomi with all their flaws.
Code:
public void enableMobileData(Context context, boolean enabled) {
try {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
ReflectionHelper.invoke(connectivityManager.getClass(), connectivityManager, "setMobileDataEnabled", new Class[]{Boolean.TYPE}, Boolean.FALSE);
} catch (Exception e) {
Log.e("BaseMobileDataUtils", "Invoke | ConnectivityManager_enableMobileData() occur EXCEPTION: " + e.getMessage());
}
}
I checked as low as Android 8, there is no such function "setMobileDataEnabled" under the android.net.ConnectivityManager class. There's only "getMobileDataEnabled", but not a "set" method, so this call always fails. Also, this function was written in a way that it only disables mobile data, it can't enable it because argument "enabled" is not used and Boolean.FALSE is hardcoded. So this is completely Xiaomi's fault.