Closed aea91 closed 1 year ago
What does the getAutoStartState()
method return?
return always => state = Autostart.State.ENABLED The code is written below return always true
` Autostart autostart = new Autostart(getApplicationContext()); Autostart.State state = autostart.getAutoStartState();
if (state == Autostart.State.DISABLED) {
// now we are sure that autostart is disabled
// ask user to enable it manually in the settings app
result.success(false);
} else if (state == Autostart.State.ENABLED) {
// now we are also sure that autostart is enabled
result.success(true);
}`
Can you tell me more about the device? What is the Android version, and is the "MIUI Optimization" disabled?
I'm not talking about normal optimization, the special one which MIUI has.
If it gets disabled, the state
result could be inaccurate.
Closing the issue, no response from the OP.
On my test device the same situation. Method getAutoStartState() returns ENABLED. Device: Redmi Note 9 MIUI version: 12.5.4 Android version: 11 MIUI Optimization: not depend on whether this parameter is enabled or disabled
Hi we tested with Xiaomi device MIUI 12.5.6 In all conditions response is "autostart open"