Skip to content
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

simple code for check intent is exist #29

Closed
captain-miao opened this issue Jan 10, 2020 · 2 comments
Closed

simple code for check intent is exist #29

captain-miao opened this issue Jan 10, 2020 · 2 comments
Milestone

Comments

@captain-miao
Copy link

        Intent intent = new Intent();
        intent.setComponent(new ComponentName(packageName, componentName));
        if (intent.resolveActivity(context.getPackageManager()) != null) {
            // the intent is exist
        }
@judemanutd
Copy link
Owner

thanks @captain-miao , I've added this to the existing roadmap and should be integrated once the v2 is complete

@judemanutd judemanutd added this to the 2.0 milestone Jan 12, 2020
awoisoak added a commit to awoisoak/AutoStarter that referenced this issue Jun 4, 2021
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
@judemanutd
Copy link
Owner

Added support for this in #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants