@Override
public boolean isUserRunning(int userId, int flags) {
- if (userId != UserHandle.getCallingUserId() && checkCallingPermission(
- INTERACT_ACROSS_USERS) != PackageManager.PERMISSION_GRANTED) {
+ if (!mUserController.isSameProfileGroup(userId, UserHandle.getCallingUserId())
+ && checkCallingPermission(INTERACT_ACROSS_USERS)
+ != PackageManager.PERMISSION_GRANTED) {
String msg = "Permission Denial: isUserRunning() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
}
boolean isSameProfileGroup(int callingUserId, int targetUserId) {
+ if (callingUserId == targetUserId) {
+ return true;
+ }
synchronized (mUserProfileGroupIdsSelfLocked) {
int callingProfile = mUserProfileGroupIdsSelfLocked.get(callingUserId,
UserInfo.NO_PROFILE_GROUP_ID);