diff options
author | 2025-03-24 12:48:41 +0000 | |
---|---|---|
committer | 2025-03-24 12:48:41 +0000 | |
commit | 91e4d15fe06de4bf7e1f83c600518e5d7c7b8a21 (patch) | |
tree | 81c27bcffb2fc885975f7a738f3227c259e3970f | |
parent | fe8165446947dab07ad081a4879836a2a4498407 (diff) |
Fix: Replace modsFlagOnOrNone with mods in CachedProperty
Flag: EXEMPT bugfix
Test: atest cached-property-annotation-processor-test
Bug: 404520337
Change-Id: I4af8059635bbe1ddaa15bb198c612e4e599b08dd
4 files changed, 11 insertions, 11 deletions
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index c01c3cdc7ace..cc789694f05f 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -5901,7 +5901,7 @@ public class UserManager { * @param userHandle The user handle of the profile to be queried. * @return true if the profile is in quiet mode, false otherwise. */ - @CachedProperty(modsFlagOnOrNone = {}) + @CachedProperty(mods = {}) public boolean isQuietModeEnabled(UserHandle userHandle) { if (android.multiuser.Flags.cacheQuietModeState()) { final int userId = userHandle.getIdentifier(); @@ -6662,7 +6662,7 @@ public class UserManager { * @hide */ @UnsupportedAppUsage - @CachedProperty(modsFlagOnOrNone = {}, api = "user_manager_users") + @CachedProperty(mods = {}, api = "user_manager_users") public int getUserSerialNumber(@UserIdInt int userId) { // Read only flag should is to fix early access to this API // cacheUserSerialNumber to be removed after the diff --git a/tools/processors/property_cache/src/java/android/processor/property_cache/CacheConfig.java b/tools/processors/property_cache/src/java/android/processor/property_cache/CacheConfig.java index c665c840f376..45ea322cb301 100644 --- a/tools/processors/property_cache/src/java/android/processor/property_cache/CacheConfig.java +++ b/tools/processors/property_cache/src/java/android/processor/property_cache/CacheConfig.java @@ -46,7 +46,7 @@ public class CacheConfig { : methodAnnotation.module(); mClassName = classElement.getSimpleName().toString(); mQualifiedName = classElement.getQualifiedName().toString(); - mModifiers = new CacheModifiers(methodAnnotation.modsFlagOnOrNone()); + mModifiers = new CacheModifiers(methodAnnotation.mods()); mMethodName = method.getSimpleName().toString(); mPropertyName = getPropertyName(mMethodName); mApiName = methodAnnotation.api().isEmpty() ? getUniqueApiName(mClassName, mPropertyName) diff --git a/tools/processors/property_cache/test/resources/Custom.java b/tools/processors/property_cache/test/resources/Custom.java index 05024da67e6c..d5660705db46 100644 --- a/tools/processors/property_cache/test/resources/Custom.java +++ b/tools/processors/property_cache/test/resources/Custom.java @@ -48,7 +48,7 @@ public class Custom { * @param userId - user Id * @return number of days till birthday of given user Id */ - @CachedProperty(modsFlagOnOrNone = {CacheModifier.STATIC}) + @CachedProperty(mods = {CacheModifier.STATIC}) public int getDaysTillBirthday(int userId) { return CustomCache.getDaysTillBirthday(mService::getDaysTillBirthday, userId); } @@ -59,7 +59,7 @@ public class Custom { * @param userId - user Id * @return number of days since birthday of given user Id */ - @CachedProperty(modsFlagOnOrNone = {}) + @CachedProperty(mods = {}) public int getDaysSinceBirthday(int userId) { return ((CustomCache) mCache).getDaysSinceBirthday(mService::getDaysSinceBirthday, userId); } @@ -69,7 +69,7 @@ public class Custom { * * @return number of days till birthay of current user */ - @CachedProperty(modsFlagOnOrNone = {CacheModifier.STATIC}, max = 1) + @CachedProperty(mods = {CacheModifier.STATIC}, max = 1) public int getDaysTillMyBirthday() { return CustomCache.getDaysTillMyBirthday((Void) -> mService.getDaysTillMyBirthday()); } @@ -80,7 +80,7 @@ public class Custom { * * @return number of days since birthay of current user */ - @CachedProperty(modsFlagOnOrNone = {}, max = 1, api = "my_unique_key") + @CachedProperty(mods = {}, max = 1, api = "my_unique_key") public int getDaysSinceMyBirthday() { return ((CustomCache) mCache).getDaysSinceMyBirthday( (Void) -> mService.getDaysSinceMyBirthday()); diff --git a/tools/processors/property_cache/test/resources/Default.java b/tools/processors/property_cache/test/resources/Default.java index d2449aad656c..81966014c4e9 100644 --- a/tools/processors/property_cache/test/resources/Default.java +++ b/tools/processors/property_cache/test/resources/Default.java @@ -42,7 +42,7 @@ public class Default { * @param userId - user Id * @return number of days till birthday of given user Id */ - @CachedProperty(modsFlagOnOrNone = {CacheModifier.STATIC}) + @CachedProperty(mods = {CacheModifier.STATIC}) public int getDaysTillBirthday(int userId) { return DefaultCache.getDaysTillBirthday(mService::getDaysTillBirthday, userId); } @@ -52,7 +52,7 @@ public class Default { * @param userId - user Id * @return number of days since birthday of given user Id */ - @CachedProperty(modsFlagOnOrNone = {}) + @CachedProperty(mods = {}) public int getDaysSinceBirthday(int userId) { return ((DefaultCache) mCache).getDaysSinceBirthday(mService::getDaysSinceBirthday, userId); } @@ -62,7 +62,7 @@ public class Default { * @return number of days till birthay of current user */ @CachedProperty( - modsFlagOnOrNone = {CacheModifier.STATIC}, + mods = {CacheModifier.STATIC}, max = 1) public int getDaysTillMyBirthday() { return DefaultCache.getDaysTillMyBirthday((Void) -> mService.getDaysTillMyBirthday()); @@ -74,7 +74,7 @@ public class Default { * @return number of days since birthay of current user */ @CachedProperty( - modsFlagOnOrNone = {}, + mods = {}, max = 1, api = "my_unique_key") public int getDaysSinceMyBirthday() { |