-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with Huawei P10 #38
Comments
Hey @giudon010 thanks, the library essentially is looking for a combination of package names so if huawei changes their package names, there is a very good chance it would either not find the package or it would find 1 and not the next one because huawei shuffed them up, did the current setup of the library open up the autostart on the P10? |
Hello @judemanutd, thank your for your answer. No, the current setup doesn't work. I try to explain better the trouble, because it's a "rare case", but it happens. On My Huawei P10 (Android 8.0.0, EMUI 8.0.0), are available both Intents that you check with AutoStarter:
The first one is still-present Intent, but never used by the phone because is unreachable from the Phone Settings (I think it is an Intent left wrongly by the old versions of Huawei smartphones), the second one is the real activity that I should view with AutoStarter, but it is never showed because AutoStarter find (wrongly) the first one. A possible solution is simply to replace the most recent Intent with the old ones (I think that it could be a good solutions also for other manufacturers managed by AutoStarters).
or, in alternative, try to check for both ones presences, something like:
I hope that my proposed solutions can help me and other developers too. Let me know what you think about it. |
That actually helps alot, thanks for taking the time and debugging this. I'll probably implement that last suggestion that you made and keep both intents just so that it can work with older devices as well since that was the one that worked initially. I'll have to wait until the weekend to actually make a change and have it up but in the mean time if you can make a pull request instead that would be great. |
It checks the existence of the activities before attempting to open them. Now if the activity can really not be opened, getAutoStartPermission will return false. Related issues: judemanutd#29 judemanutd#30 isAutoStartPermissionAvailable is checking the existence of the activity in order to avoid 'false positives' when the library is not able to open a specific settings screen. Inverted the Huawei intents to process the newer ones first (I didn't invert the rest of the manufacturers as I can't test all of them). This fix known issue with Huawei P 10 Lite judemanutd#38 (tested) Use Build.BRAND.toLowerCase(Locale.ROOT) to avoid issues with certain languages as Turkish as mentioned here: judemanutd#66 (tested) Includes FLAG_ACTIVITY_NEW_TASK so that it can be called outside an Activity. Fixed this: judemanutd#62 Add a new activity to be opened in Samsung devices as: This one open the exact Sleeping Apps setting com.samsung.android.lool/com.samsung.android.sm.battery.ui.usage.CheckableAppListActivity While this one opens the main battery settings com.samsung.android.lool/com.samsung.android.sm.battery.ui.BatteryActivity That should fixes theses (Tested with Note 8, Note 9 & Note 20): judemanutd#37 judemanutd#33
This should be resolved by #69 but feel free to open the issue if it is not. |
Hello,
I just want to report a problem with Huawei P10.
In the "autoStartHuawei" method, if the intent "PACKAGE_HUAWEI_COMPONENT" exist and gets correctly called, but also exist the intent "PACKAGE_HUAWEI_COMPONENT_FALLBACK", the second one don't get called because the first one do not throw an exception.
Is this wanted?
Best regards, and thank you for your wonderful library
The text was updated successfully, but these errors were encountered: