Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Whitelisting extras #1401

Merged
merged 4 commits into from
Feb 21, 2014
Merged

Whitelisting extras #1401

merged 4 commits into from
Feb 21, 2014

Conversation

jpeg729
Copy link
Contributor

@jpeg729 jpeg729 commented Feb 21, 2014

I trust that the settings and restrictions caches deal with any performance issues and don't introduce any bugs. I haven't tested that aspect thoroughly, but it seems to work.

I have added a dialog in ActivityApp for managing the different types of whitelists. One aspect that might seem counter-intuitive is that you have to check to allow. This is similar to the allowed Accounts, Contacts and App, but dissimilar to the logic of restricting elsewhere. It might be wise to change this.

Currently the dialog uses the values of cWhitelistWhatever for the whitelist types, there is, as yet, no provision for using localised values.

Refs #1375

public static Boolean checkWhitelist(int uid, String type, String name, boolean useCache) {
// For getRestriction we need to be able to indicate whether it is
// whitelisted, blacklisted, or not stored.
String value = PrivacyManager.getSetting(uid, type + "." + name, "", useCache);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use null as default value to simplify the check for empty settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because reading a string from an sqlite db where the stored value is null, might or might not work depending on the implementation of sqlite. (That's roughly what the android docs say.)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have done your homework, good!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we should later the column to be not nullable.
I will see if this is possible and take care of it.

@M66B M66B added the pull label Feb 21, 2014
@M66B M66B merged commit 8eaae7c into M66B:master Feb 21, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants