@Override public Object call(Object who, Method method, Object... args) throws Throwable { IInterface caller = (IInterface) args[0]; IBinder token = (IBinder) args[1]; Intent service = (Intent) args[2]; String resolvedType = (String) args[3]; IServiceConnection conn = (IServiceConnection) args[4]; int flags = (int) args[5]; int userId = VUserHandle.myUserId(); if (isServerProcess()) { userId = service.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL); } if (userId == VUserHandle.USER_NULL) { return method.invoke(who, args); } ServiceInfo serviceInfo = VirtualCore.get().resolveServiceInfo(service, userId); if (serviceInfo != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { service.setComponent(new ComponentName(serviceInfo.packageName, serviceInfo.name)); } conn = ServiceConnectionDelegate.getDelegate(conn); return VActivityManager.get().bindService(caller.asBinder(), token, service, resolvedType, conn, flags, userId); } return method.invoke(who, args); }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { IInterface caller = (IInterface) args[0]; IBinder token = (IBinder) args[1]; Intent service = (Intent) args[2]; String resolvedType = (String) args[3]; IServiceConnection conn = (IServiceConnection) args[4]; int flags = (int) args[5]; int userId = VUserHandle.myUserId(); if (isServerProcess()) { userId = service.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL); } if (userId == VUserHandle.USER_NULL) { return method.invoke(who, args); } ServiceInfo serviceInfo = VirtualCore.get().resolveServiceInfo(service, userId); if (serviceInfo != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { service.setComponent(new ComponentName(serviceInfo.packageName, serviceInfo.name)); } conn = ServiceConnectionDelegate.getDelegate(conn); return VActivityManager.get().bindService(caller.asBinder(), token, service, resolvedType, conn, flags, userId); } return method.invoke(who, args); }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { IInterface caller = (IInterface) args[0]; IBinder token = (IBinder) args[1]; Intent service = (Intent) args[2]; String resolvedType = (String) args[3]; IServiceConnection conn = (IServiceConnection) args[4]; int flags = (int) args[5]; int userId = VUserHandle.myUserId(); if (isServerProcess()) { userId = service.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL); } if (userId == VUserHandle.USER_NULL) { return method.invoke(who, args); } ServiceInfo serviceInfo = VirtualCore.get().resolveServiceInfo(service, userId); if (serviceInfo != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { service.setComponent(new ComponentName(serviceInfo.packageName, serviceInfo.name)); } conn = ServiceConnectionDelegate.getDelegate(conn); return VActivityManager.get().bindService(caller.asBinder(), token, service, resolvedType, conn, flags, userId); } return method.invoke(who, args); }