XomaDev / MIUI-Autostart

A library to check hidden MIUI autostart permission.
MIT License
127 stars 33 forks source link

Autostart permission always returns true in Poco phones #15

Closed nizam-betterapp closed 4 months ago

nizam-betterapp commented 5 months ago

Thanks for the great library. Autostart permission always returns true in Poco phones. I can donate for your work in case you can fix it for us. Sorry, we badly need a fix here.

Screenshot 2024-05-11 at 11 39 58 AM
XomaDev commented 5 months ago

Hi buddy, please test the library in a real phone to get realistic results, testing in an emulator may differ.

You can donate me via Paypal: paypal.me/XomaDev

nizam-betterapp commented 5 months ago

Thanks for the quick reply. I testing using real device in https://www.lambdatest.com/intl/en-in Autostart permission always returns true

XomaDev commented 5 months ago

Hi, as I said before, testing with a real device may yield a better result.

ahuvab commented 4 months ago

it's happen also in miui version 13.0.7 . There is any solution?

XomaDev commented 4 months ago

Are you testing on emulator? Or do you have MIUI Optimizations turned off?

ahuvab commented 4 months ago

I'm testing with a real device. I tried turn on/off MIUI Optimizations and it's the same result

XomaDev commented 4 months ago

Can you please call getAutoStartState(Context) and see what happens? It will return a State object. On some phones, whenever there isnt any state available, it may return true.

ahuvab commented 4 months ago

OK I'm trying again with MIUI Optimizations on and I get the right value. thanks!!! there is a way to know if the MIUI Optimizations turn on or off from code? and I'm also want to understand- from which MIUI version this Autostart library return the right value? for all versions I'll get Autostart permission true if the MIUI Optimizations turn off?

XomaDev commented 4 months ago

Hello, it is nice to hear that now it's working fine 😊 unfortunately it is not possible to know if MIUI Optimizations is turned on or off, I believe Autostart mainly has an affect if MIUI Optimizations is turned on.

Since MIUI does not officially document APIs, we really do not have more information of how it behaves on different Android versions.