summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Bookatz <bookatz@google.com> 2020-07-24 17:42:33 -0700
committer Adam Bookatz <bookatz@google.com> 2020-07-24 17:42:33 -0700
commitd9807a663e2b26079bd486632b432b07ff9099dd (patch)
tree9c7ea27c4e48fdce4c6372e9e5da04d033b2efff
parent75301c4bc6de506074e01b91385ee83c2f657f7c (diff)
Don't calculate isSameProfileGroup twice
Minor improvement: we already calculated isSameProfileGroup immediately above; no need to calculate again. Test: compiles Change-Id: I2cb1722511004ffceee88dc4b9eb0b8a9e292db6
-rw-r--r--services/core/java/com/android/server/am/UserController.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
index 9562158f9bb6..1bf761ff9d2a 100644
--- a/services/core/java/com/android/server/am/UserController.java
+++ b/services/core/java/com/android/server/am/UserController.java
@@ -1891,8 +1891,7 @@ class UserController implements Handler.Callback {
if (callingUid != 0 && callingUid != SYSTEM_UID) {
final boolean allow;
final boolean isSameProfileGroup = isSameProfileGroup(callingUserId, targetUserId);
- if (mInjector.isCallerRecents(callingUid)
- && isSameProfileGroup(callingUserId, targetUserId)) {
+ if (mInjector.isCallerRecents(callingUid) && isSameProfileGroup) {
// If the caller is Recents and the caller has ownership of the profile group,
// we then allow it to access its profiles.
allow = true;