Skip to content

Commit 2293acb

Browse files
authored
Fix support for Android 16 QPR Beta 3 (#326)
The function signature of `getUsers` in class `android.os.IUserManager` is changed to `getUsers(Z)Ljava/util/List;` in Android 16 QPR Beta 3. The corresponding calls to this function are updated to fix this incompatibility, which was initially observed on Android Canary.
1 parent 5e040f9 commit 2293acb

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

daemon/src/main/java/org/lsposed/lspd/service/UserService.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,10 @@ public static List<UserInfo> getUsers() throws RemoteException {
7171
IUserManager um = getUserManager();
7272
List<UserInfo> users = new LinkedList<>();
7373
if (um == null) return users;
74-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
74+
try {
75+
users = um.getUsers(true);
76+
} catch (NoSuchMethodError e) {
7577
users = um.getUsers(true, true, true);
76-
} else {
77-
try {
78-
users = um.getUsers(true);
79-
} catch (NoSuchMethodError e) {
80-
users = um.getUsers(true, true, true);
81-
}
8278
}
8379
if (Utils.isLENOVO) { // lenovo hides user [900, 910) for app cloning
8480
var gotUsers = new boolean[10];

0 commit comments

Comments
 (0)