Fix IActivityManager.bindService for Android 14 (#2700)
This commit is contained in:
parent
0229e294d0
commit
32e0daf1b4
|
|
@ -143,7 +143,10 @@ public class ActivityManagerService {
|
||||||
|
|
||||||
IActivityManager am = getActivityManager();
|
IActivityManager am = getActivityManager();
|
||||||
if (am == null || appThread == null) return -1;
|
if (am == null || appThread == null) return -1;
|
||||||
return am.bindService(appThread, token, service, resolvedType, connection, flags, callingPackage, userId);
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||||
|
return am.bindService(appThread, token, service, resolvedType, connection, (long) flags, callingPackage, userId);
|
||||||
|
else
|
||||||
|
return am.bindService(appThread, token, service, resolvedType, connection, flags, callingPackage, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean unbindService(IServiceConnection connection) throws RemoteException {
|
public static boolean unbindService(IServiceConnection connection) throws RemoteException {
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,11 @@ public interface IActivityManager extends IInterface {
|
||||||
String resolvedType, IServiceConnection connection, int flags,
|
String resolvedType, IServiceConnection connection, int flags,
|
||||||
String callingPackage, int userId) throws RemoteException;
|
String callingPackage, int userId) throws RemoteException;
|
||||||
|
|
||||||
|
@RequiresApi(34)
|
||||||
|
int bindService(IApplicationThread caller, IBinder token, Intent service,
|
||||||
|
String resolvedType, IServiceConnection connection, long flags,
|
||||||
|
String callingPackage, int userId) throws RemoteException;
|
||||||
|
|
||||||
boolean unbindService(IServiceConnection connection) throws RemoteException;
|
boolean unbindService(IServiceConnection connection) throws RemoteException;
|
||||||
|
|
||||||
boolean switchUser(int userid) throws RemoteException;
|
boolean switchUser(int userid) throws RemoteException;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue