congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
VUserHandle.getUid
Code IndexAdd Tabnine to your IDE (free)

How to use
getUid
method
in
com.lody.virtual.os.VUserHandle

Best Java code snippets using com.lody.virtual.os.VUserHandle.getUid (Showing top 18 results out of 315)

origin: android-hacker/VirtualXposed

@Override
public int getPackageUid(String packageName, int userId) {
  checkUserId(userId);
  synchronized (mPackages) {
    VPackage p = mPackages.get(packageName);
    if (p != null) {
      PackageSetting ps = (PackageSetting) p.mExtras;
      return VUserHandle.getUid(userId, ps.appId);
    }
    return -1;
  }
}
origin: android-hacker/VirtualXposed

private void sendFirstLaunchBroadcast(PackageSetting ps, int userId) {
  Intent intent = new Intent(Intent.ACTION_PACKAGE_FIRST_LAUNCH, Uri.fromParts("package", ps.packageName, null));
  intent.setPackage(ps.packageName);
  intent.putExtra(Intent.EXTRA_UID, VUserHandle.getUid(ps.appId, userId));
  intent.putExtra("android.intent.extra.user_handle", userId);
  sendBroadcastAsUser(intent, null);
}
origin: android-hacker/VirtualXposed

@Override
public String[] getPackagesForUid(int uid) {
  int userId = VUserHandle.getUserId(uid);
  checkUserId(userId);
  synchronized (this) {
    List<String> pkgList = new ArrayList<>(2);
    for (VPackage p : mPackages.values()) {
      PackageSetting settings = (PackageSetting) p.mExtras;
      if (VUserHandle.getUid(userId, settings.appId) == uid) {
        pkgList.add(p.packageName);
      }
    }
    return pkgList.toArray(new String[pkgList.size()]);
  }
}
origin: android-hacker/VirtualXposed

boolean handleStaticBroadcast(int appId, ActivityInfo info, Intent intent,
               PendingResultData result) {
  Intent realIntent = intent.getParcelableExtra("_VA_|_intent_");
  ComponentName component = intent.getParcelableExtra("_VA_|_component_");
  int userId = intent.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL);
  if (realIntent == null) {
    return false;
  }
  if (userId < 0) {
    VLog.w(TAG, "Sent a broadcast without userId " + realIntent);
    return false;
  }
  int vuid = VUserHandle.getUid(userId, appId);
  return handleUserBroadcast(vuid, info, component, realIntent, result);
}
origin: android-hacker/VirtualXposed

@Override
public void processRestarted(String packageName, String processName, int userId) {
  int callingPid = getCallingPid();
  int appId = VAppManagerService.get().getAppId(packageName);
  int uid = VUserHandle.getUid(userId, appId);
  synchronized (this) {
    ProcessRecord app = findProcessLocked(callingPid);
    if (app == null) {
      ApplicationInfo appInfo = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
      appInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
      String stubProcessName = getProcessName(callingPid);
      int vpid = parseVPid(stubProcessName);
      if (vpid != -1) {
        performStartProcessLocked(uid, vpid, appInfo, processName);
      }
    }
  }
}
origin: android-hacker/VirtualXposed

ProcessRecord startProcessIfNeedLocked(String processName, int userId, String packageName) {
  if (VActivityManagerService.get().getFreeStubCount() < 3) {
    // run GC
    killAllApps();
  }
  PackageSetting ps = PackageCacheManager.getSetting(packageName);
  ApplicationInfo info = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
  if (ps == null || info == null) {
    return null;
  }
  if (!ps.isLaunched(userId)) {
    sendFirstLaunchBroadcast(ps, userId);
    ps.setLaunched(userId, true);
    VAppManagerService.get().savePersistenceData();
  }
  int uid = VUserHandle.getUid(userId, ps.appId);
  ProcessRecord app = mProcessNames.get(processName, uid);
  if (app != null && app.client.asBinder().pingBinder()) {
    return app;
  }
  int vpid = queryFreeStubProcessLocked();
  if (vpid == -1) {
    return null;
  }
  app = performStartProcessLocked(uid, vpid, info, processName);
  if (app != null) {
    app.pkgList.add(info.packageName);
  }
  return app;
}
origin: darkskygit/VirtualApp

@Override
public int getPackageUid(String packageName, int userId) {
  checkUserId(userId);
  synchronized (mPackages) {
    VPackage p = mPackages.get(packageName);
    if (p != null) {
      PackageSetting ps = (PackageSetting) p.mExtras;
      return VUserHandle.getUid(userId, ps.appId);
    }
    return -1;
  }
}
origin: bzsome/VirtualApp-x326

@Override
public int getPackageUid(String packageName, int userId) {
  checkUserId(userId);
  synchronized (mPackages) {
    VPackage p = mPackages.get(packageName);
    if (p != null) {
      PackageSetting ps = (PackageSetting) p.mExtras;
      return VUserHandle.getUid(userId, ps.appId);
    }
    return -1;
  }
}
origin: darkskygit/VirtualApp

private void sendFirstLaunchBroadcast(PackageSetting ps, int userId) {
  Intent intent = new Intent(Intent.ACTION_PACKAGE_FIRST_LAUNCH, Uri.fromParts("package", ps.packageName, null));
  intent.setPackage(ps.packageName);
  intent.putExtra(Intent.EXTRA_UID, VUserHandle.getUid(ps.appId, userId));
  intent.putExtra("android.intent.extra.user_handle", userId);
  sendBroadcastAsUser(intent, null);
}
origin: bzsome/VirtualApp-x326

private void sendFirstLaunchBroadcast(PackageSetting ps, int userId) {
  Intent intent = new Intent(Intent.ACTION_PACKAGE_FIRST_LAUNCH, Uri.fromParts("package", ps.packageName, null));
  intent.setPackage(ps.packageName);
  intent.putExtra(Intent.EXTRA_UID, VUserHandle.getUid(ps.appId, userId));
  intent.putExtra("android.intent.extra.user_handle", userId);
  sendBroadcastAsUser(intent, null);
}
origin: darkskygit/VirtualApp

@Override
public String[] getPackagesForUid(int uid) {
  int userId = VUserHandle.getUserId(uid);
  checkUserId(userId);
  synchronized (this) {
    List<String> pkgList = new ArrayList<>(2);
    for (VPackage p : mPackages.values()) {
      PackageSetting settings = (PackageSetting) p.mExtras;
      if (VUserHandle.getUid(userId, settings.appId) == uid) {
        pkgList.add(p.packageName);
      }
    }
    return pkgList.toArray(new String[pkgList.size()]);
  }
}
origin: bzsome/VirtualApp-x326

@Override
public String[] getPackagesForUid(int uid) {
  int userId = VUserHandle.getUserId(uid);
  checkUserId(userId);
  synchronized (this) {
    List<String> pkgList = new ArrayList<>(2);
    for (VPackage p : mPackages.values()) {
      PackageSetting settings = (PackageSetting) p.mExtras;
      if (VUserHandle.getUid(userId, settings.appId) == uid) {
        pkgList.add(p.packageName);
      }
    }
    return pkgList.toArray(new String[pkgList.size()]);
  }
}
origin: darkskygit/VirtualApp

boolean handleStaticBroadcast(int appId, ActivityInfo info, Intent intent,
               PendingResultData result) {
  Intent realIntent = intent.getParcelableExtra("_VA_|_intent_");
  ComponentName component = intent.getParcelableExtra("_VA_|_component_");
  int userId = intent.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL);
  if (realIntent == null) {
    return false;
  }
  if (userId < 0) {
    VLog.w(TAG, "Sent a broadcast without userId " + realIntent);
    return false;
  }
  int vuid = VUserHandle.getUid(userId, appId);
  return handleUserBroadcast(vuid, info, component, realIntent, result);
}
origin: bzsome/VirtualApp-x326

boolean handleStaticBroadcast(int appId, ActivityInfo info, Intent intent,
               PendingResultData result) {
  Intent realIntent = intent.getParcelableExtra("_VA_|_intent_");
  ComponentName component = intent.getParcelableExtra("_VA_|_component_");
  int userId = intent.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL);
  if (realIntent == null) {
    return false;
  }
  if (userId < 0) {
    VLog.w(TAG, "Sent a broadcast without userId " + realIntent);
    return false;
  }
  int vuid = VUserHandle.getUid(userId, appId);
  return handleUserBroadcast(vuid, info, component, realIntent, result);
}
origin: bzsome/VirtualApp-x326

@Override
public void processRestarted(String packageName, String processName, int userId) {
  int callingPid = getCallingPid();
  int appId = VAppManagerService.get().getAppId(packageName);
  int uid = VUserHandle.getUid(userId, appId);
  synchronized (this) {
    ProcessRecord app = findProcessLocked(callingPid);
    if (app == null) {
      ApplicationInfo appInfo = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
      appInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
      String stubProcessName = getProcessName(callingPid);
      int vpid = parseVPid(stubProcessName);
      if (vpid != -1) {
        performStartProcessLocked(uid, vpid, appInfo, processName);
      }
    }
  }
}
origin: darkskygit/VirtualApp

@Override
public void processRestarted(String packageName, String processName, int userId) {
  int callingPid = getCallingPid();
  int appId = VAppManagerService.get().getAppId(packageName);
  int uid = VUserHandle.getUid(userId, appId);
  synchronized (this) {
    ProcessRecord app = findProcessLocked(callingPid);
    if (app == null) {
      ApplicationInfo appInfo = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
      appInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
      String stubProcessName = getProcessName(callingPid);
      int vpid = parseVPid(stubProcessName);
      if (vpid != -1) {
        performStartProcessLocked(uid, vpid, appInfo, processName);
      }
    }
  }
}
origin: darkskygit/VirtualApp

ProcessRecord startProcessIfNeedLocked(String processName, int userId, String packageName) {
  if (VActivityManagerService.get().getFreeStubCount() < 3) {
    // run GC
    killAllApps();
  }
  PackageSetting ps = PackageCacheManager.getSetting(packageName);
  ApplicationInfo info = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
  if (ps == null || info == null) {
    return null;
  }
  if (!ps.isLaunched(userId)) {
    sendFirstLaunchBroadcast(ps, userId);
    ps.setLaunched(userId, true);
    VAppManagerService.get().savePersistenceData();
  }
  int uid = VUserHandle.getUid(userId, ps.appId);
  ProcessRecord app = mProcessNames.get(processName, uid);
  if (app != null && app.client.asBinder().pingBinder()) {
    return app;
  }
  int vpid = queryFreeStubProcessLocked();
  if (vpid == -1) {
    return null;
  }
  app = performStartProcessLocked(uid, vpid, info, processName);
  if (app != null) {
    app.pkgList.add(info.packageName);
  }
  return app;
}
origin: bzsome/VirtualApp-x326

ProcessRecord startProcessIfNeedLocked(String processName, int userId, String packageName) {
  if (VActivityManagerService.get().getFreeStubCount() < 3) {
    // run GC
    killAllApps();
  }
  PackageSetting ps = PackageCacheManager.getSetting(packageName);
  ApplicationInfo info = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
  if (ps == null || info == null) {
    return null;
  }
  if (!ps.isLaunched(userId)) {
    sendFirstLaunchBroadcast(ps, userId);
    ps.setLaunched(userId, true);
    VAppManagerService.get().savePersistenceData();
  }
  int uid = VUserHandle.getUid(userId, ps.appId);
  ProcessRecord app = mProcessNames.get(processName, uid);
  if (app != null && app.client.asBinder().isBinderAlive()) {
    return app;
  }
  int vpid = queryFreeStubProcessLocked();
  if (vpid == -1) {
    return null;
  }
  app = performStartProcessLocked(uid, vpid, info, processName);
  if (app != null) {
    app.pkgList.add(info.packageName);
  }
  return app;
}
com.lody.virtual.osVUserHandlegetUid

Javadoc

Returns the vuid that is composed from the userId and the appId.

Popular methods of VUserHandle

  • <init>
    Instantiate a new VUserHandle from the data in a Parcel that was previously written with #writeToPar
  • equals
  • formatUid
  • getAppId
    Returns the app id (or base vuid) for a given vuid, stripping out the user id from it.
  • getCallingUserId
  • getIdentifier
    Returns the userId stored in this VUserHandle.
  • getUserId
    Returns the user id for a given vuid.
  • myUserId
    Returns the user id of the current process
  • writeToParcel
    Write a VUserHandle to a Parcel, handling null pointers. Must be read with #readFromParcel(Parcel).
  • myAppId

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • requestLocationUpdates (LocationManager)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now