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