Tabnine Logo
VBinder.getCallingUid
Code IndexAdd Tabnine to your IDE (free)

How to use
getCallingUid
method
in
com.lody.virtual.os.VBinder

Best Java code snippets using com.lody.virtual.os.VBinder.getCallingUid (Showing top 20 results out of 315)

origin: android-hacker/VirtualXposed

/** @hide */
public static int getCallingUserId() {
  return getUserId(VBinder.getCallingUid());
}
origin: android-hacker/VirtualXposed

public static int getBaseCallingUid() {
  return VUserHandle.getAppId(getCallingUid());
}
origin: android-hacker/VirtualXposed

/** @hide */
public static VUserHandle getCallingUserHandle() {
  int userId = getUserId(VBinder.getCallingUid());
  VUserHandle userHandle = userHandles.get(userId);
  // Intentionally not synchronized to save time
  if (userHandle == null) {
    userHandle = new VUserHandle(userId);
    userHandles.put(userId, userHandle);
  }
  return userHandle;
}
origin: android-hacker/VirtualXposed

@Override
public void cancelAll() throws RemoteException {
  int vuid = VBinder.getCallingUid();
  synchronized (mJobStore) {
    boolean changed = false;
    Iterator<Map.Entry<JobId, JobConfig>> iterator = mJobStore.entrySet().iterator();
    while (iterator.hasNext()) {
      Map.Entry<JobId, JobConfig> entry = iterator.next();
      JobId job = entry.getKey();
      if (job.vuid == vuid) {
        JobConfig config = entry.getValue();
        mScheduler.cancel(config.virtualJobId);
        changed = true;
        iterator.remove();
        break;
      }
    }
    if (changed) {
      saveJobs();
    }
  }
}
origin: android-hacker/VirtualXposed

@Override
public void cancel(int jobId) throws RemoteException {
  int vuid = VBinder.getCallingUid();
  synchronized (mJobStore) {
    boolean changed = false;
    Iterator<Map.Entry<JobId, JobConfig>> iterator = mJobStore.entrySet().iterator();
    while (iterator.hasNext()) {
      Map.Entry<JobId, JobConfig> entry = iterator.next();
      JobId job = entry.getKey();
      JobConfig config = entry.getValue();
      if (job.vuid == vuid && job.clientJobId == jobId) {
        changed = true;
        mScheduler.cancel(config.virtualJobId);
        iterator.remove();
        break;
      }
    }
    if (changed) {
      saveJobs();
    }
  }
}
origin: android-hacker/VirtualXposed

/**
 * Enforces that only the system UID or root's UID or apps that have the
 * {android.Manifest.permission.MANAGE_USERS MANAGE_USERS}
 * permission can make certain calls to the VUserManager.
 *
 * @param message used as message if SecurityException is thrown
 * @throws SecurityException if the caller is not system or root
 */
private static void checkManageUsersPermission(String message) {
  final int uid = VBinder.getCallingUid();
  if (uid != VirtualCore.get().myUid()) {
    throw new SecurityException("You need MANAGE_USERS permission to: " + message);
  }
}
origin: android-hacker/VirtualXposed

  public static VUserHandle getCallingUserHandle() {
    return new VUserHandle(VUserHandle.getUserId(getCallingUid()));
  }
}
origin: android-hacker/VirtualXposed

@Override
public List<JobInfo> getAllPendingJobs() throws RemoteException {
  int vuid = VBinder.getCallingUid();
  List<JobInfo> jobs = mScheduler.getAllPendingJobs();
  synchronized (mJobStore) {
    Iterator<JobInfo> iterator = jobs.listIterator();
    while (iterator.hasNext()) {
      JobInfo job = iterator.next();
      if (!VASettings.STUB_JOB.equals(job.getService().getClassName())) {
        // Schedule by Host, invisible in VA.
        iterator.remove();
        continue;
      }
      Map.Entry<JobId, JobConfig> jobEntry = findJobByVirtualJobId(job.getId());
      if (jobEntry == null) {
        iterator.remove();
        continue;
      }
      JobId jobId = jobEntry.getKey();
      JobConfig config = jobEntry.getValue();
      if (jobId.vuid != vuid) {
        iterator.remove();
        continue;
      }
      mirror.android.app.job.JobInfo.jobId.set(job, jobId.clientJobId);
      mirror.android.app.job.JobInfo.service.set(job, new ComponentName(jobId.packageName, config.serviceName));
    }
  }
  return jobs;
}
origin: android-hacker/VirtualXposed

private int createSessionInternal(SessionParams params, String installerPackageName, int userId)
    throws IOException {
  final int callingUid = VBinder.getCallingUid();
  final int sessionId;
  final PackageInstallerSession session;
  synchronized (mSessions) {
    // Sanity check that installer isn't going crazy
    final int activeCount = getSessionCount(mSessions, callingUid);
    if (activeCount >= MAX_ACTIVE_SESSIONS) {
      throw new IllegalStateException(
          "Too many active sessions for UID " + callingUid);
    }
    sessionId = allocateSessionIdLocked();
    session = new PackageInstallerSession(mInternalCallback, mContext, mInstallHandler.getLooper(), installerPackageName, sessionId, userId, callingUid, params, VEnvironment.getPackageInstallerStageDir());
  }
  mCallbacks.notifySessionCreated(session.sessionId, session.userId);
  return sessionId;
}
origin: android-hacker/VirtualXposed

@Override
public int schedule(JobInfo job) throws RemoteException {
  int vuid = VBinder.getCallingUid();
  int id = job.getId();
  ComponentName service = job.getService();
  JobId jobId = new JobId(vuid, service.getPackageName(), id);
  JobConfig config = mJobStore.get(jobId);
  if (config == null) {
    config = new JobConfig(mGlobalJobId++, service.getClassName(), job.getExtras());
    mJobStore.put(jobId, config);
  } else {
    config.serviceName = service.getClassName();
    config.extras = job.getExtras();
  }
  saveJobs();
  mirror.android.app.job.JobInfo.jobId.set(job, config.virtualJobId);
  mirror.android.app.job.JobInfo.service.set(job, mJobProxyComponent);
  return mScheduler.schedule(job);
}
origin: android-hacker/VirtualXposed

final boolean customTokens = info.desc.customTokens;
loginOptions.putInt(AccountManager.KEY_CALLER_UID, VBinder.getCallingUid());
loginOptions.putInt(AccountManager.KEY_CALLER_PID, Binder.getCallingPid());
if (notifyOnAuthFailure) {
origin: darkskygit/VirtualApp

/** @hide */
public static int getCallingUserId() {
  return getUserId(VBinder.getCallingUid());
}
origin: bzsome/VirtualApp-x326

/** @hide */
public static int getCallingUserId() {
  return getUserId(VBinder.getCallingUid());
}
origin: darkskygit/VirtualApp

public static int getBaseCallingUid() {
  return VUserHandle.getAppId(getCallingUid());
}
origin: bzsome/VirtualApp-x326

public static int getBaseCallingUid() {
  return VUserHandle.getAppId(getCallingUid());
}
origin: bzsome/VirtualApp-x326

/** @hide */
public static VUserHandle getCallingUserHandle() {
  int userId = getUserId(VBinder.getCallingUid());
  VUserHandle userHandle = userHandles.get(userId);
  // Intentionally not synchronized to save time
  if (userHandle == null) {
    userHandle = new VUserHandle(userId);
    userHandles.put(userId, userHandle);
  }
  return userHandle;
}
origin: darkskygit/VirtualApp

/** @hide */
public static VUserHandle getCallingUserHandle() {
  int userId = getUserId(VBinder.getCallingUid());
  VUserHandle userHandle = userHandles.get(userId);
  // Intentionally not synchronized to save time
  if (userHandle == null) {
    userHandle = new VUserHandle(userId);
    userHandles.put(userId, userHandle);
  }
  return userHandle;
}
origin: darkskygit/VirtualApp

/**
 * Enforces that only the system UID or root's UID or apps that have the
 * {android.Manifest.permission.MANAGE_USERS MANAGE_USERS}
 * permission can make certain calls to the VUserManager.
 *
 * @param message used as message if SecurityException is thrown
 * @throws SecurityException if the caller is not system or root
 */
private static void checkManageUsersPermission(String message) {
  final int uid = VBinder.getCallingUid();
  if (uid != VirtualCore.get().myUid()) {
    throw new SecurityException("You need MANAGE_USERS permission to: " + message);
  }
}
origin: darkskygit/VirtualApp

  public static VUserHandle getCallingUserHandle() {
    return new VUserHandle(VUserHandle.getUserId(getCallingUid()));
  }
}
origin: bzsome/VirtualApp-x326

  public static VUserHandle getCallingUserHandle() {
    return new VUserHandle(VUserHandle.getUserId(getCallingUid()));
  }
}
com.lody.virtual.osVBindergetCallingUid

Popular methods of VBinder

  • getCallingPid

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Reference (javax.naming)
  • JPanel (javax.swing)
  • Top 12 Jupyter Notebook extensions
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