-
Notifications
You must be signed in to change notification settings - Fork 51
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
Redesign the app (un)install receiver #94
Comments
I can implement this myself; the purpose of this issue is to get it acknowledged by @ligi (or someone else close to the project) and to find a way how to get a ResolveInfo object or something comparable for a specific package. |
Querying the full list from the Package Manager and then seeking the right one would be an option but that still seems a bit inefficient to me. |
Sounds great! I love efficiency - would be happy to merge a PR like this |
Okay I got it working. |
How far should efficiency go? Any arguments against directly modifying SearchActivity.appInfoList when refreshing? |
Okay I've been using this now for a couple of days (without direct modification of SearchActivity.appInfoList though) and it is very stable. I only had about one time when it did't get a newly installed app. |
I won't be able to clean up and polish it until the end of next week but I think it might still be neccesary to test this on some other devices anyway (maybe there could be some device dependent broadcast issues...don't know). Also I would measure the time it takes for the refreshing to complete and how to implement it at best since after reading about Broadcast Receivers I want to make sure that nothing gets killed before it's done. |
Concerning direct modification of SearchActivity.appInfoList: |
The JobScheduler is not useful for subscribing to app list updates. What I figured out to be working instead might be updating the app list in SearchActivity.onCreate() and then registering for live app list updates. Contemporary AlternativeStarting at API Level 21, there seems to be a new, better way for querying a list of installed apps & subscribing to changes in said list: LaucherApps Currently, I'm about to implement this with full legacy support, i.e.: If running on Android Oreo or newer (Version Code 26+) FAST will use the LauncherApps class to keep its app list up to date. The existing methods using broadcasts will stay unchanged and take effect when broadcasts are received which will only happen if FAST is running on Nougat or earlier, since implicit broadcasts are still allowed there. However, a cleaner way would be releasing 2 seperate versions of FAST, one for API levels up to 20 or 25, implementing the existing methods and one for API level 21 or higher, implementing the new method without registering the affected broadcasts in its receiver. ( This should be about the behaviour I've seen implemented in Trebuchet from Lineage 16.0, which is using LauncherApps to query information, does not register broadcasts related to package installs and |
After some tests I've found out that it takes at least just as long to query a full activity list from LauncherApps service than to query from the Package Manager. Also I don't see anything in the LaucherApps Class that our logic could benefit from in terms of efficiency. TL;DR: I'm just going to implement the update in onCreate if running on Oreo or newer and then register for the Broadcasts at run time. |
I have found a very interesting method in the Package Manager available on Android Oreo and Above. I implemented this and now it allows FAST to use this to update it's app list when being launched on Android Oreo and above without having to refresh the whole list all the time. The implementation should now be completely done and only needs to be tested and cleaned up now! |
Currently the app install receiver causes some unecesary work:
Also I think the Receiver should delete corresponding icons from cache to either clean up when uninstalling or to cause an icon refresh for an updated application.
The text was updated successfully, but these errors were encountered: