/** * Return the serial number for a user. This is a device-unique * number assigned to that user; if the user is deleted and then a new * user created, the new users will not be given the same serial number. * @param user The user whose serial number is to be retrieved. * @return The serial number of the given user; returns -1 if the * given VUserHandle does not exist. * @see #getUserForSerialNumber(long) */ public long getSerialNumberForUser(VUserHandle user) { return getUserSerialNumber(user.getIdentifier()); }
public void sendBroadcastAsUser(Intent intent, VUserHandle user, String permission) { SpecialComponentList.protectIntent(intent); Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } // TODO: checkPermission context.sendBroadcast(intent); }
public void sendBroadcastAsUser(Intent intent, VUserHandle user) { SpecialComponentList.protectIntent(intent); Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } context.sendBroadcast(intent); }
public boolean bindServiceAsUser(Intent service, ServiceConnection connection, int flags, VUserHandle user) { service = new Intent(service); if (user != null) { service.putExtra("_VA_|_user_id_", user.getIdentifier()); } return VirtualCore.get().getContext().bindService(service, connection, flags); }
public void sendOrderedBroadcastAsUser(Intent intent, VUserHandle user, String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } // TODO: checkPermission context.sendOrderedBroadcast(intent, null/* permission */, resultReceiver, scheduler, initialCode, initialData, initialExtras); }
@Override public void handleMessage(Message msg) { final int userId = msg.arg2; final int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { final IPackageInstallerCallback callback = mCallbacks.getBroadcastItem(i); final VUserHandle user = (VUserHandle) mCallbacks.getBroadcastCookie(i); // TODO: dispatch notifications for slave profiles if (userId == user.getIdentifier()) { try { invokeCallback(callback, msg); } catch (RemoteException ignored) { } } } mCallbacks.finishBroadcast(); }
/** * Return the serial number for a user. This is a device-unique * number assigned to that user; if the user is deleted and then a new * user created, the new users will not be given the same serial number. * @param user The user whose serial number is to be retrieved. * @return The serial number of the given user; returns -1 if the * given VUserHandle does not exist. * @see #getUserForSerialNumber(long) */ public long getSerialNumberForUser(VUserHandle user) { return getUserSerialNumber(user.getIdentifier()); }
/** * Return the serial number for a user. This is a device-unique * number assigned to that user; if the user is deleted and then a new * user created, the new users will not be given the same serial number. * @param user The user whose serial number is to be retrieved. * @return The serial number of the given user; returns -1 if the * given VUserHandle does not exist. * @see #getUserForSerialNumber(long) */ public long getSerialNumberForUser(VUserHandle user) { return getUserSerialNumber(user.getIdentifier()); }
public void sendBroadcastAsUser(Intent intent, VUserHandle user) { SpecialComponentList.protectIntent(intent); Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } context.sendBroadcast(intent); }
public void sendBroadcastAsUser(Intent intent, VUserHandle user, String permission) { SpecialComponentList.protectIntent(intent); Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } // TODO: checkPermission context.sendBroadcast(intent); }
public void sendBroadcastAsUser(Intent intent, VUserHandle user, String permission) { SpecialComponentList.protectIntent(intent); Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } // TODO: checkPermission context.sendBroadcast(intent); }
public boolean bindServiceAsUser(Intent service, ServiceConnection connection, int flags, VUserHandle user) { service = new Intent(service); if (user != null) { service.putExtra("_VA_|_user_id_", user.getIdentifier()); } return VirtualCore.get().getContext().bindService(service, connection, flags); }
public void sendBroadcastAsUser(Intent intent, VUserHandle user) { SpecialComponentList.protectIntent(intent); Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } context.sendBroadcast(intent); }
public boolean bindServiceAsUser(Intent service, ServiceConnection connection, int flags, VUserHandle user) { service = new Intent(service); if (user != null) { service.putExtra("_VA_|_user_id_", user.getIdentifier()); } return VirtualCore.get().getContext().bindService(service, connection, flags); }
public void sendOrderedBroadcastAsUser(Intent intent, VUserHandle user, String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } // TODO: checkPermission context.sendOrderedBroadcast(intent, null/* permission */, resultReceiver, scheduler, initialCode, initialData, initialExtras); }
public void sendOrderedBroadcastAsUser(Intent intent, VUserHandle user, String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { Context context = VirtualCore.get().getContext(); if (user != null) { intent.putExtra("_VA_|_user_id_", user.getIdentifier()); } // TODO: checkPermission context.sendOrderedBroadcast(intent, null/* permission */, resultReceiver, scheduler, initialCode, initialData, initialExtras); }
@Override public void handleMessage(Message msg) { final int userId = msg.arg2; final int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { final IPackageInstallerCallback callback = mCallbacks.getBroadcastItem(i); final VUserHandle user = (VUserHandle) mCallbacks.getBroadcastCookie(i); // TODO: dispatch notifications for slave profiles if (userId == user.getIdentifier()) { try { invokeCallback(callback, msg); } catch (RemoteException ignored) { } } } mCallbacks.finishBroadcast(); }
@Override public void handleMessage(Message msg) { final int userId = msg.arg2; final int n = mCallbacks.beginBroadcast(); for (int i = 0; i < n; i++) { final IPackageInstallerCallback callback = mCallbacks.getBroadcastItem(i); final VUserHandle user = (VUserHandle) mCallbacks.getBroadcastCookie(i); // TODO: dispatch notifications for slave profiles if (userId == user.getIdentifier()) { try { invokeCallback(callback, msg); } catch (RemoteException ignored) { } } } mCallbacks.finishBroadcast(); }