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

Commit

Permalink
Revert "Select all enabled applications"
Browse files Browse the repository at this point in the history
This reverts commit 8004993.

Conflicts:
	CHANGELOG.md

Refs #1977
Fixes #1986
  • Loading branch information
M66B committed Sep 19, 2014
1 parent f8fa19d commit 405be35
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ See for more information about XPrivacy 3 [this FAQ](https://github.com/M66B/XPr
**Next release**

* Added option to rename templates ([issue](/../../issues/1723))
* Restored select all ([issue](/../../issues/1977)) ([issue](/../../issues/1986))
* Updated Dutch translation

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
Expand Down
7 changes: 3 additions & 4 deletions src/biz/bokhorst/xprivacy/ActivityApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,9 @@ protected void onResume() {
super.onResume();

// Update switch
if (swEnabled != null) {
boolean enabled = PrivacyManager.getSettingBool(mAppInfo.getUid(), PrivacyManager.cSettingRestricted, true);
swEnabled.setChecked(enabled);
}
if (swEnabled != null)
swEnabled.setChecked(PrivacyManager.getSettingBool(mAppInfo.getUid(), PrivacyManager.cSettingRestricted,
true));

// Update on demand check box
int userId = Util.getUserId(Process.myUid());
Expand Down
27 changes: 8 additions & 19 deletions src/biz/bokhorst/xprivacy/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -1633,31 +1633,20 @@ public int[] getSelectedOrVisibleUid(int flags) {
}

public void selectAllVisible() {
// Look through the visible, enabled apps to figure out what to do
// Look through the visible apps to figure out what to do
mSelecting = false;
for (int i = 0; i < this.getCount(); i++) {
ApplicationInfoEx appInfo = this.getItem(i);
if (!mListAppSelected.contains(appInfo)) {
boolean enabled = PrivacyManager.getSettingBool(appInfo.getUid(),
PrivacyManager.cSettingRestricted, true);
if (enabled) {
mSelecting = true;
break;
}
if (!mListAppSelected.contains(this.getItem(i))) {
mSelecting = true;
break;
}
}

if (mSelecting) {
// Add the visible, enabled apps not already selected
for (int i = 0; i < this.getCount(); i++) {
ApplicationInfoEx appInfo = this.getItem(i);
if (!mListAppSelected.contains(appInfo)) {
boolean enabled = PrivacyManager.getSettingBool(appInfo.getUid(),
PrivacyManager.cSettingRestricted, true);
if (enabled)
mListAppSelected.add(this.getItem(i));
}
}
// Add the visible apps not already selected
for (int i = 0; i < this.getCount(); i++)
if (!mListAppSelected.contains(this.getItem(i)))
mListAppSelected.add(this.getItem(i));
} else
mListAppSelected.clear();

Expand Down

0 comments on commit 405be35

Please sign in to comment.