Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e836aae authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Merge "Don't obtain parent user when not necessary in native permission helper" am: 527024a3

am: f3b138c3

Change-Id: I84a035ad4181a25f4f777ed2d2ffb981fdb234af
parents 058a77f3 f3b138c3
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -63,6 +63,10 @@ bool isCallerActiveUserOrManagedProfile() {
  uid_t callingUser = callingUid / PER_USER_RANGE;
  // if (!callingUid) return true;  // It's a local call

  if ((foregroundUserId == callingUser) || (systemUiUid == callingUid) ||
      (SYSTEM_UID == callingUid))
    return true;

  uid_t parentUser = callingUser;

  sp<IServiceManager> sm = defaultServiceManager();
@@ -75,9 +79,7 @@ bool isCallerActiveUserOrManagedProfile() {
    ipcState->restoreCallingIdentity(ident);
  }

  return (foregroundUserId == callingUser) ||
         (foregroundUserId == parentUser) || (systemUiUid == callingUid) ||
         (SYSTEM_UID == callingUid);
  return foregroundUserId == parentUser;
}

}  // namespace bluetooth