android.content.Intent#ACTION_MANAGED_PROFILE_REMOVED源码实例Demo

下面列出了android.content.Intent#ACTION_MANAGED_PROFILE_REMOVED 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android_9.0.0_r45   文件: CameraServiceProxy.java
@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
    }

}
 
源代码2 项目: android_9.0.0_r45   文件: UserManagerService.java
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);
}
 
 方法所在类
 同类方法