@Override
 public Object call(Object who, Method method, Object... args) throws Throwable {
   ComponentName componentName = (ComponentName) args[0];
   int flags = (int) args[1];
   if (getHostPkg().equals(componentName.getPackageName())) {
     return method.invoke(who, args);
   }
   int userId = VUserHandle.myUserId();
   return VPackageManager.get().getProviderInfo(componentName, flags, userId);
 }
示例#2
0
 public static int onGetCallingUid(int originUid) {
   int callingPid = Binder.getCallingPid();
   if (callingPid == Process.myPid()) {
     return VClientImpl.getClient().getBaseVUid();
   }
   if (callingPid == VirtualCore.get().getSystemPid()) {
     return Process.SYSTEM_UID;
   }
   int vuid = VActivityManager.get().getUidByPid(callingPid);
   if (vuid != -1) {
     return VUserHandle.getAppId(vuid);
   }
   VLog.d(TAG, "Ops, who are you ? " + callingPid);
   return VClientImpl.getClient().getBaseVUid();
 }