-
Notifications
You must be signed in to change notification settings - Fork 24
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
Merging PD2.0 into OPD #12
Comments
I've been looking over some of the changes in PDroid 1.54 (in the context of the comments above). First, with the PrivacyPersistenceAdapter: You and I have taken a somewhat different approach as to where an error is handled, and indeed how it is handled. I have taken the approach of passing Exceptions up and then handling them in the original caller, whereas you have trapped the error and returned an object based on that in the PrivacyPersistenceAdapter itself. i.e. if an SQLiteException happens when doing a 'getSettings' in OpenPDroid, then an exception is thrown (and indeed throw upward by the service, out to the PrivacySettingsManager). The implication is that in extending the current OpenPDroid code, the 'default' action would tend to be handled in the PrivacySettingsManager object or even the object calling it, rather than in the PrivacySettingsManager. The use of a 'flag' package name in the returned settings is PDroid 2.0 1.54 is good in terms of allowing some identification of the cause - whether or not it is a 'valid' response or not. In terms of the caching you and I have taken quite different approaches. I've used the Google-provided LRUCache (basically just because they recommend that, and I was aiming for a small cache including the most-used items, rather than caching everything as it is used). Both have their pros and cons. Originally, I wanted to use a 'cache-everything-until-memory-becomes-a-problem' using SoftReferences, but apparently Android doesn't hold on to SoftReferences at all - it just scraps them, so that wouldn't work as a cache. Using an LRUCache was basically my way of being conservative with holding stuff in memory. I'm not sure one method is especially better than another here. Using the LRUCache means the hashmap is smaller so lookups are faster (although there is the overhead of tracking the LRU), but if there is a lot of switching between more apps than the size of the cache then there are more database calls. I suspect the performance difference between a reasonably-sized (e.g. 20-30 item) LRUCache and your custom hashmap-based implementation is marginal at best. I like the PrivacyDebugger. It is nice to have the level of debugging switchable, rather than what I've currently got in OpenPDroid which is some compiled-in flags for level of debug logging. I'm not exactly sure why you are using that thread in the constructor to get the debugger state. With the ResolveHelper: It may be possible to get the specific package by PID rather than UID (where you have the problem of multiple packages with the same UID). I have some code I was testing about somewhere and I'll try to track it down. Mind you, it would be ideal to implement both so it falls back from one to the other. Likewise, the PrivacyConstants is excellent. I would also quite like to have validation functions that management apps could check against. With the PrivacySettingsManager object, one thing we need to be very wary of is the IPrivacySettingsManager interface. Having the 'service' variable as an IPrivacySettingsManager means reflection can be used to inject a custom subclass in there rather than a valid service. I've tried to address that in OpenPDroid (devel) by actually using getClass to check the class against known-good class-names. If an invalid class name is detected, then the 'service' object is dropped and reconnection is attempted. And there is more, but that's all I'm going to dig through tonight. There is plenty to be done. |
Okay, I have (perhaps) settled on a working format. In order to not demolish wsot's or CollegeDev's work (since this is still the only place either of their current work is hosted or available), I have started yet another merge branch. If things continue like they are now, once the merge is done I intend to remove 80% of our branches. Anyway, the new working merge branches are going to hopefully be uniform and be called openpdroid-pdroid2-merge. I am going to try and actually add features in a sane manner, something that has eluded us since the beginning of the project. That may end up being ambitious, especially because I am likely to go file by file and miss some things. But I will attempt to rebase some of the inevitable mistakes before I merge the opendpdroid-pdroid2-merge branch into the -devel branch. See the ContextImpl merge for an example, and as always, anyone who wants to jump in can do so or contact me for the ability to do so. |
Hey guys,
I would like to start the work on merging PD2.0 features into OPD.
Before I will describe some things:
PD2.0 is completely ported by my self and not a fork of OPD
Therefore I think it is a good way to review and compare the whole code and merging the best solutions together. Who would like to help??!
I haven't had a "deep" look at OPD yet, but that is what I can say now:
Hopefully there is someone out there who would like to start with merging.
Furthermore: I will talk with matoe about how to handle it on github.
Cheers
The text was updated successfully, but these errors were encountered: