-
Notifications
You must be signed in to change notification settings - Fork 14
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
PackageManager$NameNotFoundException no query permission #60
Comments
After we have fixed the sample, could you re-upload the new one in google? It is not visible for recent devices anymore. |
Hello Falco, Are you able to simulate this problem? If so, you may try to add to your manifest following 'queries'.
|
I can not reproduce it. It happens only once a month or so. And even worse, nobody notice it since it happens only in my SelectVersion context. So I now have compared the sometimes broken call with the known working call. here is the stack which does not tell anything
This is the context source of the function without complaints:
but the following sometimes does not work:
Keep in mind, this could be a false positive - maybe context.getApplicationContext() is failing as well and I just never got a complaint about it because it happens so rarely. However, most of the TaskerActionFireReceiver.onReceive(context):context work flawless, only one of many does not see any locus package |
Found a 2nd context which never works if you hit a usecase where package was hidden. Phone Reboot is needed to fix it. So only after phonereboot TaskerActionFireReceiver.onReceive(context):context and SelectVersion.onCreate().this works again. This is the 2nd broken function context, it uses AppCompatActivity directly as context. It is my own activity but was started in Tasker. So not a broadcastReceiver but an Activity directly startet in Tasker
getAvailableVersions does not crash, but return an empty list if all packages are hidden. So it does not matter if it is activity or receiver, both direct usages of context variables sometimes fail but no fail report from context.getApplicationContext()
Based on the getApplicationContext() documentation I would say it makes no difference to use context vs context.getApplicationContext() because it only documents differences in lifecycle |
This version is now in test since 4 days Falcosc/locus-addon-tasker@804efe5 |
Sometimes, Android losses access to your package names. Maybe because we lose the reason why it is visible automatically in some use cases https://developer.android.com/training/package-visibility/automatic
If it happens, createLocusVersion will fail with PackageManager$NameNotFoundException
And getAvailableVersions will return nothing because all packages run into the ignored NameNotFoundException catch.
Do we need to define all packages in the manifest like this https://developer.android.com/training/package-visibility/declaring? I ask it because your example doesn't do it.
Or do you need to define the queries in your API like in this https://developer.android.com/training/package-visibility/declaring#communicate-host-app library use case?
I don't know if your API structure applies to this concept or if it isn't a library use case.
Unfortunately we don't know how to trigger the issue Falcosc/locus-addon-tasker#38 We only know that a reboot is needed to restore access.
I guess the error will be fixed with adding the query permissions, and that's why I ask how we should add it. Either every app or on library level.
The text was updated successfully, but these errors were encountered: