MIUI-autostart icon indicating copy to clipboard operation
MIUI-autostart copied to clipboard

Autostart permission always returns true in Poco phones

Open nizam-betterapp opened this issue 9 months ago • 3 comments

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

nizam-betterapp avatar May 11 '24 06:05 nizam-betterapp

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

XomaDev avatar May 11 '24 08:05 XomaDev

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

nizam-betterapp avatar May 11 '24 09:05 nizam-betterapp

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

XomaDev avatar May 12 '24 10:05 XomaDev

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

ahuvab avatar May 19 '24 11:05 ahuvab

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

XomaDev avatar May 19 '24 11:05 XomaDev

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

ahuvab avatar May 22 '24 10:05 ahuvab

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.

XomaDev avatar May 22 '24 13:05 XomaDev

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?

ahuvab avatar May 23 '24 08:05 ahuvab

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.

XomaDev avatar May 23 '24 11:05 XomaDev