Java Code Examples for android.content.Intent#ACTION_MANAGED_PROFILE_REMOVED

The following examples show how to use android.content.Intent#ACTION_MANAGED_PROFILE_REMOVED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CameraServiceProxy.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@Override
public void onReceive(Context context, Intent intent) {
    final String action = intent.getAction();
    if (action == null) return;

    switch (action) {
        case Intent.ACTION_USER_ADDED:
        case Intent.ACTION_USER_REMOVED:
        case Intent.ACTION_USER_INFO_CHANGED:
        case Intent.ACTION_MANAGED_PROFILE_ADDED:
        case Intent.ACTION_MANAGED_PROFILE_REMOVED:
            synchronized(mLock) {
                // Return immediately if we haven't seen any users start yet
                if (mEnabledCameraUsers == null) return;
                switchUserLocked(mLastUser);
            }
            break;
        default:
            break; // do nothing
    }

}
 
Example 2
Source File: UserManagerService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private void sendProfileRemovedBroadcast(int parentUserId, int removedUserId) {
    Intent managedProfileIntent = new Intent(Intent.ACTION_MANAGED_PROFILE_REMOVED);
    managedProfileIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY |
            Intent.FLAG_RECEIVER_FOREGROUND);
    managedProfileIntent.putExtra(Intent.EXTRA_USER, new UserHandle(removedUserId));
    managedProfileIntent.putExtra(Intent.EXTRA_USER_HANDLE, removedUserId);
    mContext.sendBroadcastAsUser(managedProfileIntent, new UserHandle(parentUserId), null);
}