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

Commit

Permalink
Select all enabled applications
Browse files Browse the repository at this point in the history
Fixes #1977
M66B committed Sep 12, 2014

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 4490655 commit 8004993
Showing 3 changed files with 25 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@ See for more information about XPrivacy 3 [this FAQ](https://github.com/M66B/XPr

**Next release**

* Select all enabled applications ([issue](/../../issues/1977))

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

**Version 3.1.4 BETA**
7 changes: 4 additions & 3 deletions src/biz/bokhorst/xprivacy/ActivityApp.java
Original file line number Diff line number Diff line change
@@ -360,9 +360,10 @@ protected void onResume() {
super.onResume();

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

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

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

if (mSelecting) {
// 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));
// 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));
}
}
} else
mListAppSelected.clear();

4 comments on commit 8004993

@kindle-mate
Copy link

Choose a reason for hiding this comment

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

This fix make my gps work again !
Maybe some code restrict closed app.

@M66B
Copy link
Owner Author

@M66B M66B commented on 8004993 Sep 12, 2014

Choose a reason for hiding this comment

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

This change has really nothing to do with the GPS.

@kindle-mate
Copy link

Choose a reason for hiding this comment

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

restrict Android on ,1000 close,3.13 and 3.14 gps can't work
after this fix gps work fine

@kindle-mate
Copy link

Choose a reason for hiding this comment

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

Maybe restrict Android on ,1000 closed is mistake

Please sign in to comment.