[core] Fix compatibility with 8.1 (#683)

This commit is contained in:
LoveSy 2021-05-26 23:09:26 +08:00 committed by GitHub
parent c741133b67
commit 18c7f60171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -82,6 +82,8 @@ public class UserService {
public static int getProfileParent(int userId) throws RemoteException {
IUserManager um = getUserManager();
if (um == null) return -1;
return um.getProfileParentId(userId);
var userInfo = um.getProfileParent(userId);
if (userInfo == null) return userId;
else return userInfo.id;
}
}

View File

@ -7,9 +7,6 @@ import androidx.annotation.RequiresApi;
import java.util.List;
public interface IUserManager extends IInterface {
int getProfileParentId(int userId) throws RemoteException;
@RequiresApi(26)
boolean isUserUnlocked(int userId)
throws RemoteException;
@ -20,6 +17,8 @@ public interface IUserManager extends IInterface {
List<UserInfo> getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated)
throws RemoteException;
UserInfo getProfileParent(int userId) throws RemoteException;
abstract class Stub extends Binder implements IUserManager {
public static IUserManager asInterface(IBinder obj) {