/** * Read a VUserHandle from a Parcel that was previously written * with {@link #writeToParcel(VUserHandle, Parcel)}, returning either * a null or new object as appropriate. * * @param in The Parcel from which to read the VUserHandle * @return Returns a new VUserHandle matching the previously written * object, or null if a null had been written. * * @see #writeToParcel(VUserHandle, Parcel) */ public static VUserHandle readFromParcel(Parcel in) { int h = in.readInt(); return h != USER_NULL ? new VUserHandle(h) : null; }
/** * Return the user associated with a serial number previously * returned by {@link #getSerialNumberForUser(VUserHandle)}. * @param serialNumber The serial number of the user that is being * retrieved. * @return Return the user associated with the serial number, or null * if there is not one. * @see #getSerialNumberForUser(VUserHandle) */ public VUserHandle getUserForSerialNumber(long serialNumber) { int ident = getUserHandle((int)serialNumber); return ident >= 0 ? new VUserHandle(ident) : null; }
public static VUserHandle myUserHandle() { return new VUserHandle(myUserId()); }
public void register(IPackageInstallerCallback callback, int userId) { mCallbacks.register(callback, new VUserHandle(userId)); }
/** @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; }
private void sendUserInfoChangedBroadcast(int userId) { Intent changedIntent = new Intent(Constants.ACTION_USER_INFO_CHANGED); changedIntent.putExtra(Constants.EXTRA_USER_HANDLE, userId); changedIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); VActivityManagerService.get().sendBroadcastAsUser(changedIntent, new VUserHandle(userId)); }
private void broadcastCheckInNowIfNeed(int userId) { long time = System.currentTimeMillis(); if (Math.abs(time - lastAccountChangeTime) > CHECK_IN_TIME) { lastAccountChangeTime = time; saveAllAccounts(); Intent intent = new Intent("android.server.checkin.CHECKIN_NOW"); VActivityManagerService.get().sendBroadcastAsUser(intent, new VUserHandle(userId)); } }
public static VUserHandle getCallingUserHandle() { return new VUserHandle(VUserHandle.getUserId(getCallingUid())); } }
public boolean performOptimize(String packageName, int userId) { VActivityManagerService.get().sendBroadcastAsUser( specifyApp(new Intent(Intent.ACTION_BOOT_COMPLETED), packageName, userId) , new VUserHandle(userId)); return true; }
private void sendAccountsChangedBroadcast(int userId) { Intent intent = new Intent(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION); VActivityManagerService.get().sendBroadcastAsUser(intent, new VUserHandle(userId)); broadcastCheckInNowIfNeed(userId); }
/** * Return the user associated with a serial number previously * returned by {@link #getSerialNumberForUser(VUserHandle)}. * @param serialNumber The serial number of the user that is being * retrieved. * @return Return the user associated with the serial number, or null * if there is not one. * @see #getSerialNumberForUser(VUserHandle) */ public VUserHandle getUserForSerialNumber(long serialNumber) { int ident = getUserHandle((int)serialNumber); return ident >= 0 ? new VUserHandle(ident) : null; }
private void sendUserInfoChangedBroadcast(int userId) { Intent changedIntent = new Intent(Constants.ACTION_USER_INFO_CHANGED); changedIntent.putExtra(Constants.EXTRA_USER_HANDLE, userId); changedIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); VActivityManagerService.get().sendBroadcastAsUser(changedIntent, new VUserHandle(userId)); }
private void sendUserInfoChangedBroadcast(int userId) { Intent changedIntent = new Intent(Constants.ACTION_USER_INFO_CHANGED); changedIntent.putExtra(Constants.EXTRA_USER_HANDLE, userId); changedIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); VActivityManagerService.get().sendBroadcastAsUser(changedIntent, new VUserHandle(userId)); }
/** @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; }
/** @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; }
private void broadcastCheckInNowIfNeed(int userId) { long time = System.currentTimeMillis(); if (Math.abs(time - lastAccountChangeTime) > CHECK_IN_TIME) { lastAccountChangeTime = time; saveAllAccounts(); Intent intent = new Intent("android.server.checkin.CHECKIN_NOW"); VActivityManagerService.get().sendBroadcastAsUser(intent, new VUserHandle(userId)); } }
public static VUserHandle getCallingUserHandle() { return new VUserHandle(VUserHandle.getUserId(getCallingUid())); } }
public static VUserHandle getCallingUserHandle() { return new VUserHandle(VUserHandle.getUserId(getCallingUid())); } }
private void sendAccountsChangedBroadcast(int userId) { Intent intent = new Intent(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION); VActivityManagerService.get().sendBroadcastAsUser(intent, new VUserHandle(userId)); broadcastCheckInNowIfNeed(userId); }
public boolean performOptimize(String packageName, int userId) { VActivityManagerService.get().sendBroadcastAsUser( specifyApp(new Intent(Intent.ACTION_BOOT_COMPLETED), packageName, userId) , new VUserHandle(userId)); return true; }