Added swipe refresh layout to notify user of repository update
See #341 (closed) , #425
Merge request reports
Activity
Thanks @paresh, I think many people will be happy with this change. I had one minor nitpick in my comment above, but that shouldn't stop this feature going in because it is more an opinion rather than an objective "the code is wrong" thing. In general code looks great. TIL about sticky broadcasts :)
This isn't fixing #341 (closed), right? But it should be fixing #425.
@paresh, @mvdan: Do you think we can remove the "update" action bar item now? Do you think swipe to refresh is known enough to make this redundant? I think it is redundant having it in the action bar as well as supported by swipe. It will just be a matter of having a changelog entry that we can point people to when they ask "Where is the update menu item?".
@paresh: As per IRC, this is going to go into master, but we've branched of stable-v0.100 which means this will end up in v0.101 as it is a new feature. We are in the process of ironing out bugs for the upcoming stable.
Milestone changed to 0.101
I understand @paresh you have exams on now if I remember correctly, and I don't think we are in any particular rush. But yes, I would like to see that comment addressed before merging some time in the future if people are alright with that.
humm, I might need few more days to see If we need to call
removeStickyBroadcast
in case sticky broadcast persists which would result in weird behavior, due tosendStickyBroadcast
being called multiple times.Edited by username-removed-273687Sticky broadcasts should not be used in F-Droid at all. They have security issues and are slow.
Use
LocalBroadcastManager
.I think sticky broadcasts might even be deprecated https://stackoverflow.com/questions/3490913/what-is-a-sticky-broadcast
@eighthave, It's more of a prevention deprecation as that would prevent (new)developers from using it. if you are passing sensitive[1] information you should refrain from using it. but in our case we aren't.
Sticky broadcasts cannot be secured with a permission and therefore are accessible to any receiver. If these broadcasts contain sensitive data or reach a malicious receiver, the application may be compromised.
The android OS uses sticky broadcast for various functionalities like telling apps that battery is low.
Information exposure is the biggest threat if we are using sticky broadcast (exposure from intents)
[2] Though I can find a workaround using LocalBroadcastManager and SharedPreferences (by saving state) but sticky broadcast should be used (not abused) whenever they can be. Anyhow I do agree that the security issue is a concern (or might be in near future)[2] https://www.appvigil.co/blog/2015/03/sticky-broadcast-security-vulnerabilities-in-android-apps/
This should use a
LocalBroadcastManager
for the broadcast, and to save state, why not use the standard Android way of saving and restoring GUI state: https://developer.android.com/training/basics/activity-lifecycle/recreating.htmlI really do not want to see any Broadcasts outside of
LocalBroadcastManager
. It is too easy to mess up security-wise, and its not always apparent what can be a security issue. This is not just some app, it is the app store, so we need to be especially careful.@eighthave , my pleasure to help you guys out with as much as I am capable of, It's good learning experience. Not only I love FOSS apps but an FOSS appstore which makes them available to everyone is a dream come true for FOSS app users, the effort required to maintain such application store is overwhelming and the F-Droid team is doing a very good job at it.
Not only is F-Droid one stop for all(almost) the FOSS apps out there but also a good place for newbies(like me) to learn about and to contribute to open source project, through F-Droid I found various interesting projects to contribute to.
Edited by username-removed-273687