Loading core/java/android/accounts/AccountManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -384,7 +384,7 @@ public class AccountManager { new PropertyInvalidatedCache<UserIdPackage, Account[]>( CACHE_ACCOUNTS_DATA_SIZE, CACHE_KEY_ACCOUNTS_DATA_PROPERTY) { @Override protected Account[] recompute(UserIdPackage userAndPackage) { public Account[] recompute(UserIdPackage userAndPackage) { try { return mService.getAccountsAsUser(null, userAndPackage.userId, userAndPackage.packageName); } catch (RemoteException e) { Loading @@ -392,11 +392,11 @@ public class AccountManager { } } @Override protected boolean bypass(UserIdPackage query) { public boolean bypass(UserIdPackage query) { return query.userId < 0; } @Override protected boolean debugCompareQueryResults(Account[] l, Account[] r) { public boolean resultEquals(Account[] l, Account[] r) { if (l == r) { return true; } else if (l == null || r == null) { Loading Loading @@ -455,7 +455,7 @@ public class AccountManager { new PropertyInvalidatedCache<AccountKeyData, String>(CACHE_USER_DATA_SIZE, CACHE_KEY_USER_DATA_PROPERTY) { @Override protected String recompute(AccountKeyData accountKeyData) { public String recompute(AccountKeyData accountKeyData) { Account account = accountKeyData.account; String key = accountKeyData.key; Loading core/java/android/app/ApplicationPackageManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -802,7 +802,7 @@ public class ApplicationPackageManager extends PackageManager { new PropertyInvalidatedCache<HasSystemFeatureQuery, Boolean>( 256, "cache_key.has_system_feature") { @Override protected Boolean recompute(HasSystemFeatureQuery query) { public Boolean recompute(HasSystemFeatureQuery query) { try { return ActivityThread.currentActivityThread().getPackageManager(). hasSystemFeature(query.name, query.version); Loading Loading @@ -1098,7 +1098,7 @@ public class ApplicationPackageManager extends PackageManager { new PropertyInvalidatedCache<Integer, GetPackagesForUidResult>( 32, CACHE_KEY_PACKAGES_FOR_UID_PROPERTY) { @Override protected GetPackagesForUidResult recompute(Integer uid) { public GetPackagesForUidResult recompute(Integer uid) { try { return new GetPackagesForUidResult( ActivityThread.currentActivityThread(). Loading core/java/android/app/PropertyInvalidatedCache.java +5 −5 Original line number Diff line number Diff line Loading @@ -505,13 +505,13 @@ public abstract class PropertyInvalidatedCache<Query, Result> { * block. If this function returns null, the result of the cache query is null. There is no * "negative cache" in the query: we don't cache null results at all. */ protected abstract Result recompute(Query query); public abstract Result recompute(Query query); /** * Return true if the query should bypass the cache. The default behavior is to * always use the cache but the method can be overridden for a specific class. */ protected boolean bypass(Query query) { public boolean bypass(Query query) { return false; } Loading @@ -519,7 +519,7 @@ public abstract class PropertyInvalidatedCache<Query, Result> { * Determines if a pair of responses are considered equal. Used to determine whether * a cache is inadvertently returning stale results when VERIFY is set to true. */ protected boolean debugCompareQueryResults(Result cachedResult, Result fetchedResult) { protected boolean resultEquals(Result cachedResult, Result fetchedResult) { // If a service crashes and returns a null result, the cached value remains valid. if (fetchedResult != null) { return Objects.equals(cachedResult, fetchedResult); Loading Loading @@ -990,11 +990,11 @@ public abstract class PropertyInvalidatedCache<Query, Result> { } } protected Result maybeCheckConsistency(Query query, Result proposedResult) { private Result maybeCheckConsistency(Query query, Result proposedResult) { if (VERIFY) { Result resultToCompare = recompute(query); boolean nonceChanged = (getCurrentNonce() != mLastSeenNonce); if (!nonceChanged && !debugCompareQueryResults(proposedResult, resultToCompare)) { if (!nonceChanged && !resultEquals(proposedResult, resultToCompare)) { Log.e(TAG, TextUtils.formatSimple( "cache %s inconsistent for %s is %s should be %s", cacheName(), queryToString(query), Loading core/java/android/app/compat/ChangeIdStateCache.java +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ public final class ChangeIdStateCache } @Override protected Boolean recompute(ChangeIdStateQuery query) { public Boolean recompute(ChangeIdStateQuery query) { final long token = Binder.clearCallingIdentity(); try { if (query.type == ChangeIdStateQuery.QUERY_BY_PACKAGE_NAME) { Loading core/java/android/bluetooth/BluetoothAdapter.java +4 −4 Original line number Diff line number Diff line Loading @@ -1062,7 +1062,7 @@ public final class BluetoothAdapter { 8, BLUETOOTH_GET_STATE_CACHE_PROPERTY) { @Override @SuppressLint("AndroidFrameworkRequiresPermission") protected Integer recompute(Void query) { public Integer recompute(Void query) { try { return mService.getState(); } catch (RemoteException e) { Loading Loading @@ -2085,7 +2085,7 @@ public final class BluetoothAdapter { 8, BLUETOOTH_FILTERING_CACHE_PROPERTY) { @Override @SuppressLint("AndroidFrameworkRequiresPermission") protected Boolean recompute(Void query) { public Boolean recompute(Void query) { try { mServiceLock.readLock().lock(); if (mService != null) { Loading Loading @@ -2540,7 +2540,7 @@ public final class BluetoothAdapter { */ @Override @SuppressLint("AndroidFrameworkRequiresPermission") protected Integer recompute(Void query) { public Integer recompute(Void query) { try { return mService.getAdapterConnectionState(); } catch (RemoteException e) { Loading Loading @@ -2605,7 +2605,7 @@ public final class BluetoothAdapter { 8, BLUETOOTH_PROFILE_CACHE_PROPERTY) { @Override @SuppressLint("AndroidFrameworkRequiresPermission") protected Integer recompute(Integer query) { public Integer recompute(Integer query) { try { mServiceLock.readLock().lock(); if (mService != null) { Loading Loading
core/java/android/accounts/AccountManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -384,7 +384,7 @@ public class AccountManager { new PropertyInvalidatedCache<UserIdPackage, Account[]>( CACHE_ACCOUNTS_DATA_SIZE, CACHE_KEY_ACCOUNTS_DATA_PROPERTY) { @Override protected Account[] recompute(UserIdPackage userAndPackage) { public Account[] recompute(UserIdPackage userAndPackage) { try { return mService.getAccountsAsUser(null, userAndPackage.userId, userAndPackage.packageName); } catch (RemoteException e) { Loading @@ -392,11 +392,11 @@ public class AccountManager { } } @Override protected boolean bypass(UserIdPackage query) { public boolean bypass(UserIdPackage query) { return query.userId < 0; } @Override protected boolean debugCompareQueryResults(Account[] l, Account[] r) { public boolean resultEquals(Account[] l, Account[] r) { if (l == r) { return true; } else if (l == null || r == null) { Loading Loading @@ -455,7 +455,7 @@ public class AccountManager { new PropertyInvalidatedCache<AccountKeyData, String>(CACHE_USER_DATA_SIZE, CACHE_KEY_USER_DATA_PROPERTY) { @Override protected String recompute(AccountKeyData accountKeyData) { public String recompute(AccountKeyData accountKeyData) { Account account = accountKeyData.account; String key = accountKeyData.key; Loading
core/java/android/app/ApplicationPackageManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -802,7 +802,7 @@ public class ApplicationPackageManager extends PackageManager { new PropertyInvalidatedCache<HasSystemFeatureQuery, Boolean>( 256, "cache_key.has_system_feature") { @Override protected Boolean recompute(HasSystemFeatureQuery query) { public Boolean recompute(HasSystemFeatureQuery query) { try { return ActivityThread.currentActivityThread().getPackageManager(). hasSystemFeature(query.name, query.version); Loading Loading @@ -1098,7 +1098,7 @@ public class ApplicationPackageManager extends PackageManager { new PropertyInvalidatedCache<Integer, GetPackagesForUidResult>( 32, CACHE_KEY_PACKAGES_FOR_UID_PROPERTY) { @Override protected GetPackagesForUidResult recompute(Integer uid) { public GetPackagesForUidResult recompute(Integer uid) { try { return new GetPackagesForUidResult( ActivityThread.currentActivityThread(). Loading
core/java/android/app/PropertyInvalidatedCache.java +5 −5 Original line number Diff line number Diff line Loading @@ -505,13 +505,13 @@ public abstract class PropertyInvalidatedCache<Query, Result> { * block. If this function returns null, the result of the cache query is null. There is no * "negative cache" in the query: we don't cache null results at all. */ protected abstract Result recompute(Query query); public abstract Result recompute(Query query); /** * Return true if the query should bypass the cache. The default behavior is to * always use the cache but the method can be overridden for a specific class. */ protected boolean bypass(Query query) { public boolean bypass(Query query) { return false; } Loading @@ -519,7 +519,7 @@ public abstract class PropertyInvalidatedCache<Query, Result> { * Determines if a pair of responses are considered equal. Used to determine whether * a cache is inadvertently returning stale results when VERIFY is set to true. */ protected boolean debugCompareQueryResults(Result cachedResult, Result fetchedResult) { protected boolean resultEquals(Result cachedResult, Result fetchedResult) { // If a service crashes and returns a null result, the cached value remains valid. if (fetchedResult != null) { return Objects.equals(cachedResult, fetchedResult); Loading Loading @@ -990,11 +990,11 @@ public abstract class PropertyInvalidatedCache<Query, Result> { } } protected Result maybeCheckConsistency(Query query, Result proposedResult) { private Result maybeCheckConsistency(Query query, Result proposedResult) { if (VERIFY) { Result resultToCompare = recompute(query); boolean nonceChanged = (getCurrentNonce() != mLastSeenNonce); if (!nonceChanged && !debugCompareQueryResults(proposedResult, resultToCompare)) { if (!nonceChanged && !resultEquals(proposedResult, resultToCompare)) { Log.e(TAG, TextUtils.formatSimple( "cache %s inconsistent for %s is %s should be %s", cacheName(), queryToString(query), Loading
core/java/android/app/compat/ChangeIdStateCache.java +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ public final class ChangeIdStateCache } @Override protected Boolean recompute(ChangeIdStateQuery query) { public Boolean recompute(ChangeIdStateQuery query) { final long token = Binder.clearCallingIdentity(); try { if (query.type == ChangeIdStateQuery.QUERY_BY_PACKAGE_NAME) { Loading
core/java/android/bluetooth/BluetoothAdapter.java +4 −4 Original line number Diff line number Diff line Loading @@ -1062,7 +1062,7 @@ public final class BluetoothAdapter { 8, BLUETOOTH_GET_STATE_CACHE_PROPERTY) { @Override @SuppressLint("AndroidFrameworkRequiresPermission") protected Integer recompute(Void query) { public Integer recompute(Void query) { try { return mService.getState(); } catch (RemoteException e) { Loading Loading @@ -2085,7 +2085,7 @@ public final class BluetoothAdapter { 8, BLUETOOTH_FILTERING_CACHE_PROPERTY) { @Override @SuppressLint("AndroidFrameworkRequiresPermission") protected Boolean recompute(Void query) { public Boolean recompute(Void query) { try { mServiceLock.readLock().lock(); if (mService != null) { Loading Loading @@ -2540,7 +2540,7 @@ public final class BluetoothAdapter { */ @Override @SuppressLint("AndroidFrameworkRequiresPermission") protected Integer recompute(Void query) { public Integer recompute(Void query) { try { return mService.getAdapterConnectionState(); } catch (RemoteException e) { Loading Loading @@ -2605,7 +2605,7 @@ public final class BluetoothAdapter { 8, BLUETOOTH_PROFILE_CACHE_PROPERTY) { @Override @SuppressLint("AndroidFrameworkRequiresPermission") protected Integer recompute(Integer query) { public Integer recompute(Integer query) { try { mServiceLock.readLock().lock(); if (mService != null) { Loading