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.
This commit is contained in:
parent
5e040f97e8
commit
2293acbe27
|
|
@ -71,15 +71,11 @@ public class UserService {
|
|||
IUserManager um = getUserManager();
|
||||
List<UserInfo> users = new LinkedList<>();
|
||||
if (um == null) return users;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
users = um.getUsers(true, true, true);
|
||||
} else {
|
||||
try {
|
||||
users = um.getUsers(true);
|
||||
} catch (NoSuchMethodError e) {
|
||||
users = um.getUsers(true, true, true);
|
||||
}
|
||||
}
|
||||
if (Utils.isLENOVO) { // lenovo hides user [900, 910) for app cloning
|
||||
var gotUsers = new boolean[10];
|
||||
for (var user : users) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue