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

Commit

Permalink
Fixed exporting of on demand restricting function settings
Browse files Browse the repository at this point in the history
Closes #1508
  • Loading branch information
M66B committed Mar 6, 2014
1 parent 9d219f8 commit 6da6c2f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Changelog
**Next release**

* Fixed exporting of template ([issue](/../../issues/1506))
* Fixed exporting of on demand restricting function settings ([issue](/../../issues/1508))
* Added *uid* to *restricted by* dialog (requested on XDA)
* On demand restricting for dangerous functions with a whitelist always enabled
* Updated Italian translation
Expand Down
43 changes: 21 additions & 22 deletions src/biz/bokhorst/xprivacy/ActivityShare.java
Original file line number Diff line number Diff line change
Expand Up @@ -759,28 +759,27 @@ protected Throwable doInBackground(File... params) {
// Category
// TODO: use getRestrictionList
PRestriction crestricted = PrivacyManager.getRestrictionEx(uid, restrictionName, null);
if (crestricted.restricted || crestricted.asked) {
serializer.startTag(null, "Restriction");
serializer.attribute(null, "Id", Integer.toString(uid));
serializer.attribute(null, "Name", restrictionName);
serializer.attribute(null, "Restricted", Boolean.toString(crestricted.restricted));
serializer.attribute(null, "Asked", Boolean.toString(crestricted.asked));
serializer.endTag(null, "Restriction");

// Methods
for (Hook md : PrivacyManager.getHooks(restrictionName)) {
PRestriction mrestricted = PrivacyManager.getRestrictionEx(uid,
restrictionName, md.getName());
if (!mrestricted.restricted || !mrestricted.asked || md.isDangerous()) {
serializer.startTag(null, "Restriction");
serializer.attribute(null, "Id", Integer.toString(uid));
serializer.attribute(null, "Name", restrictionName);
serializer.attribute(null, "Method", md.getName());
serializer.attribute(null, "Restricted",
Boolean.toString(mrestricted.restricted));
serializer.attribute(null, "Asked", Boolean.toString(mrestricted.asked));
serializer.endTag(null, "Restriction");
}
serializer.startTag(null, "Restriction");
serializer.attribute(null, "Id", Integer.toString(uid));
serializer.attribute(null, "Name", restrictionName);
serializer.attribute(null, "Restricted", Boolean.toString(crestricted.restricted));
serializer.attribute(null, "Asked", Boolean.toString(crestricted.asked));
serializer.endTag(null, "Restriction");

// Methods
for (Hook md : PrivacyManager.getHooks(restrictionName)) {
PRestriction mrestricted = PrivacyManager.getRestrictionEx(uid, restrictionName,
md.getName());
if ((crestricted.restricted && !mrestricted.restricted)
|| (!crestricted.asked && mrestricted.asked) || md.isDangerous()) {
serializer.startTag(null, "Restriction");
serializer.attribute(null, "Id", Integer.toString(uid));
serializer.attribute(null, "Name", restrictionName);
serializer.attribute(null, "Method", md.getName());
serializer.attribute(null, "Restricted",
Boolean.toString(mrestricted.restricted));
serializer.attribute(null, "Asked", Boolean.toString(mrestricted.asked));
serializer.endTag(null, "Restriction");
}
}
}
Expand Down

0 comments on commit 6da6c2f

Please sign in to comment.