Frameworks: Annotate trivial @GuardedBy in services/core
Add @GuardedBy for simple functions that require locks and have a name in
one of the frameworks naming styles for locks ("^.*(Locked|LPw|LPr|L[a-zA-Z]|UL|AL|NL)$").
Changelist for permission manager.
Derived by errorprone.
Bug: 73000847
Test: m
Change-Id: I54bb3a18cbe88d24028d9a90600cd6102598b358
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
index 8aed957..8a6fbaa 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
@@ -2059,6 +2059,7 @@
}
}
+ @GuardedBy({"mSettings.mLock", "mLock"})
private int calculateCurrentPermissionFootprintLocked(BasePermission tree) {
int size = 0;
for (BasePermission perm : mSettings.mPermissions.values()) {
@@ -2067,6 +2068,7 @@
return size;
}
+ @GuardedBy({"mSettings.mLock", "mLock"})
private void enforcePermissionCapLocked(PermissionInfo info, BasePermission tree) {
// We calculate the max size of permissions defined by this uid and throw
// if that plus the size of 'info' would exceed our stated maximum.