Skip to content

Commit

Permalink
add more comments to avoid misunderstanding and confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
infinity0 committed Aug 29, 2023
1 parent 26da19c commit 9a5bb05
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/dev/ukanth/ufirewall/MultiUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static List<UserInfo> getUsers() {
UserInfo ui = new UserInfo();
ui.id = user_id;
ui.name = username;
//ui.flags = flag; // LSPosed doesn't yet expose this, we don't need it anyway
//ui.flags = flag; // hiddenapi-stub doesn't yet expose this, we don't need it anyway
res.add(ui);
}
}
Expand All @@ -74,7 +74,7 @@ public static void setup() {
public static final int PER_USER_RANGE = 100000;

// Copied from LSPosed daemon/**/PackageService.java
// We drop MATCH_ANY_USER as we don't need it, and it requires MANAGE_USERS which we can't get.
// We drop MATCH_ANY_USER as we don't need it, and it requires MANAGE_USERS which we can't get, as explained above
public static final int MATCH_ALL_FLAGS = PackageManager.MATCH_DISABLED_COMPONENTS | PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE | PackageManager.MATCH_UNINSTALLED_PACKAGES; // | MATCH_ANY_USER;

public static final int MATCH_ALL_METADATA = PackageManager.GET_META_DATA | MATCH_ALL_FLAGS;
Expand Down Expand Up @@ -121,6 +121,8 @@ public static int applicationUserId(ApplicationInfo info) {
// Copied from LSPosed daemon/**/PackageService.java
// This requires INTERACT_ACROSS_USERS permission. LSPosed already has it, but
// we need to grant it at runtime - make sure you call setup() in app.onCreate(_)
// We use this instead of `pm list packages` so that we have ApplicationInfo
// objects, which allows us to get the icons and labels in a convenient manner.
public static List<PackageInfo> getInstalledPackagesFromAllUsers(int flags/*, boolean filterNoProcess*/) throws RemoteException {
List<PackageInfo> res = new ArrayList<>();
IPackageManager pm = getPackageManager();
Expand Down

0 comments on commit 9a5bb05

Please sign in to comment.