Home
last modified time | relevance | path

Searched refs:cache (Results 1 – 25 of 175) sorted by relevance

1234567

/packages/modules/Bluetooth/system/gd/common/
Dlru_cache_test.cc30 LruCache<int, int> cache(3); // capacity = 3; in TEST() local
31 EXPECT_EQ(cache.size(), 0ul); in TEST()
32 EXPECT_EQ(cache.find(42), cache.end()); in TEST()
33 cache.clear(); // should not crash in TEST()
34 EXPECT_EQ(cache.find(42), cache.end()); in TEST()
35 EXPECT_FALSE(cache.contains(42)); in TEST()
36 EXPECT_FALSE(cache.extract(42)); in TEST()
72 LruCache<int, int> cache(2); in TEST() local
73 cache.insert_or_assign(1, 10); in TEST()
74 cache.insert_or_assign(2, 20); in TEST()
[all …]
/packages/modules/Bluetooth/system/common/
Dlru_unittest.cc33 LegacyLruCache<int, int> cache(3, "testing"); // capacity = 3; in TEST() local
34 cache.Put(1, 10); in TEST()
35 EXPECT_EQ(cache.Size(), 1); in TEST()
36 EXPECT_FALSE(cache.Put(2, 20)); in TEST()
37 EXPECT_FALSE(cache.Put(3, 30)); in TEST()
38 EXPECT_EQ(cache.Size(), 3); in TEST()
41 EXPECT_TRUE(cache.Get(1, value)); in TEST()
43 EXPECT_TRUE(cache.Get(2, value)); in TEST()
45 EXPECT_TRUE(cache.Get(3, value)); in TEST()
47 EXPECT_EQ(cache.Size(), 3); in TEST()
[all …]
/packages/apps/Gallery/tests/src/com/android/camera/gallery/
DLruCacheUnitTests.java9 LruCache<Integer, Integer> cache = new LruCache<Integer, Integer>(2); in testPut() local
12 cache.put(key, value); in testPut()
13 assertEquals(value, cache.get(key)); in testPut()
17 LruCache<Integer, Integer> cache = new LruCache<Integer, Integer>(2); in testTracingInUsedObject() local
20 cache.put(key, value); in testTracingInUsedObject()
22 cache.put(i + 10, i * i); in testTracingInUsedObject()
25 assertEquals(value, cache.get(key)); in testTracingInUsedObject()
29 LruCache<Integer, Integer> cache = new LruCache<Integer, Integer>(2); in testLruAlgorithm() local
30 cache.put(0, new Integer(0)); in testLruAlgorithm()
32 cache.put(i + 1, i * i); in testLruAlgorithm()
[all …]
/packages/modules/DnsResolver/
Dres_cache.cpp1007 cache = std::make_unique<Cache>(); in NetConfig()
1030 std::unique_ptr<Cache> cache; member
1060 static bool cache_has_pending_request_locked(Cache* cache, const Entry* key, in cache_has_pending_request_locked() argument
1062 if (!cache || !key) return false; in cache_has_pending_request_locked()
1064 Cache::pending_req_info* ri = cache->pending_requests.next; in cache_has_pending_request_locked()
1065 Cache::pending_req_info* prev = &cache->pending_requests; in cache_has_pending_request_locked()
1085 static void cache_notify_waiting_tid_locked(struct Cache* cache, const Entry* key) { in cache_notify_waiting_tid_locked() argument
1086 if (!cache || !key) return; in cache_notify_waiting_tid_locked()
1088 Cache::pending_req_info* ri = cache->pending_requests.next; in cache_notify_waiting_tid_locked()
1089 Cache::pending_req_info* prev = &cache->pending_requests; in cache_notify_waiting_tid_locked()
[all …]
/packages/apps/Messaging/src/com/android/messaging/datamodel/media/
DMediaCacheManager.java50 MediaCache<?> cache = mCaches.get(id); in getOrCreateMediaCacheById() local
51 if (cache == null) { in getOrCreateMediaCacheById()
52 cache = createMediaCacheById(id); in getOrCreateMediaCacheById()
53 if (cache != null) { in getOrCreateMediaCacheById()
54 mCaches.put(id, cache); in getOrCreateMediaCacheById()
57 return cache; in getOrCreateMediaCacheById()
61 final MediaCache<?> cache = getOrCreateMediaCacheById(cacheId); in getOrCreateBitmapPoolForCache() local
62 if (cache != null && cache instanceof PoolableImageCache) { in getOrCreateBitmapPoolForCache()
63 return ((PoolableImageCache) cache).asReusableBitmapPool(); in getOrCreateBitmapPoolForCache()
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/pipeline/
DCacheProcessing.java22 import com.android.gallery3d.filtershow.cache.BitmapCache;
37 Bitmap cache; field in CacheProcessing.CacheStep
122 environment.cache(source); in apply()
169 environment.cache(cacheStep.cache); in process()
181 && mSteps.elementAt(findBaseImageIndex).cache == null) { in process()
184 cacheBitmap = mSteps.elementAt(findBaseImageIndex).cache; in process()
200 environment.cache(prev); in process()
224 if (step.cache == null) { in process()
231 step.cache = cacheBitmap; in process()
235 environment.cache(originalCopy); in process()
[all …]
DFilterEnvironment.java24 import com.android.gallery3d.filtershow.cache.BitmapCache;
58 public void setBitmapCache(BitmapCache cache) { in setBitmapCache() argument
59 mBitmapCache = cache; in setBitmapCache()
62 public void cache(Buffer buffer) { in cache() method in FilterEnvironment
63 mBitmapCache.cache(buffer); in cache()
66 public void cache(Bitmap bitmap) { in cache() method in FilterEnvironment
67 mBitmapCache.cache(bitmap); in cache()
137 cache(bitmap); in applyRepresentation()
DBuffer.java24 import com.android.gallery3d.filtershow.cache.BitmapCache;
37 BitmapCache cache = PrimaryImage.getImage().getBitmapCache(); in Buffer() local
38 mBitmap = cache.getBitmapCopy(bitmap, BitmapCache.PREVIEW_CACHE); in Buffer()
91 BitmapCache cache = PrimaryImage.getImage().getBitmapCache(); in remove() local
92 if (cache.cache(mBitmap)) { in remove()
/packages/modules/DnsResolver/doh/
Dconfig.rs202 let cache = Cache::new(); in different_keys() localVariable
206 let config_a = cache.get(&key_a).unwrap(); in different_keys()
207 let config_b = cache.get(&key_b).unwrap(); in different_keys()
208 let _config_b = cache.get(&key_b).unwrap(); in different_keys()
209 let config_c = cache.get(&key_c).unwrap(); in different_keys()
210 let _config_c = cache.get(&key_c).unwrap(); in different_keys()
222 let cache = Cache::new(); in lifetimes() localVariable
225 let config_none = cache.get(&Key { cert_path: None, max_idle_timeout: 1000 }).unwrap(); in lifetimes()
226 let config_a = cache.get(&key_a).unwrap(); in lifetimes()
227 let config_b = cache.get(&key_b).unwrap(); in lifetimes()
[all …]
/packages/apps/Dialer/java/com/android/dialer/logging/
Dcontact_lookup_result.proto39 // Number was found in Dialer's local cache but we don't know how it was
43 // Number was found in Dialer's local cache and was originally identified
47 // Number was found in Dialer's local cache and was originally identified
51 // Number was found in Dialer's local cache and was originally identified
55 // Number was found in Dialer's local cache and was originally identified
59 // Number was found in Dialer's local cache and was originally identified
64 // Number was found in Dialer's local cache and was originally identified
71 // Number was found in Dialer's local cache and was originally identified
78 // Number was found in Dialer's local cache and was originally identified
85 // Number was found in Dialer's local cache and was originally identified
[all …]
/packages/apps/Dialer/java/com/android/dialer/util/
DExpirableCache.java103 private LruCache<K, CachedValue<V>> cache; field in ExpirableCache
105 private ExpirableCache(LruCache<K, CachedValue<V>> cache) { in ExpirableCache() argument
106 this.cache = cache; in ExpirableCache()
121 public static <K, V> ExpirableCache<K, V> create(LruCache<K, CachedValue<V>> cache) { in create() argument
122 return new ExpirableCache<K, V>(cache); in create()
150 return cache.get(key); in getCachedValue()
193 cache.put(key, newCachedValue(value)); in put()
/packages/apps/Messaging/src/com/android/messaging/datamodel/
DMemoryCacheManager.java45 public void registerMemoryCache(final MemoryCache cache) { in registerMemoryCache() argument
47 mMemoryCaches.add(cache); in registerMemoryCache()
54 public void unregisterMemoryCache(final MemoryCache cache) { in unregisterMemoryCache() argument
56 mMemoryCaches.remove(cache); in unregisterMemoryCache()
71 for (final MemoryCache cache : shallowCopy) { in reclaimMemory()
72 cache.reclaim(); in reclaimMemory()
/packages/apps/Contacts/src/com/android/contacts/
DSplitAggregateView.java240 SplitAggregateItemCache cache = (SplitAggregateItemCache)convertView.getTag(); in getView() local
241 if (cache == null) { in getView()
242 cache = new SplitAggregateItemCache(); in getView()
243 cache.name = (TextView)convertView.findViewById(R.id.name); in getView()
244 cache.additionalData = (TextView)convertView.findViewById(R.id.additionalData); in getView()
245 cache.sourceIcon = (ImageView)convertView.findViewById(R.id.sourceIcon); in getView()
246 convertView.setTag(cache); in getView()
250 cache.name.setText(info.name); in getView()
251 cache.additionalData.setText(info.getAdditionalData()); in getView()
259 cache.sourceIcon.setImageDrawable(icon); in getView()
[all …]
/packages/apps/Launcher3/src/com/android/launcher3/allapps/
DWorkPausedCard.java60 StringCache cache = mActivityContext.getStringCache(); in onFinishInflate() local
61 if (cache != null) { in onFinishInflate()
62 setWorkProfilePausedResources(cache); in onFinishInflate()
66 private void setWorkProfilePausedResources(StringCache cache) { in setWorkProfilePausedResources() argument
68 title.setText(cache.workProfilePausedTitle); in setWorkProfilePausedResources()
71 body.setText(cache.workProfilePausedDescription); in setWorkProfilePausedResources()
74 button.setText(cache.workProfileEnableButton); in setWorkProfilePausedResources()
/packages/apps/Dialer/java/com/android/dialer/app/contactinfo/
DContactInfoCache.java54 private final ExpirableCache<NumberWithCountryIso, ContactInfo> cache; field in ContactInfoCache
93 cache = internalCache; in ContactInfoCache()
110 ExpirableCache.CachedValue<ContactInfo> cachedInfo = cache.getCachedValue(numberCountryIso); in getValue()
117 cache.put(numberCountryIso, ContactInfo.EMPTY); in getValue()
198 ContactInfo existingInfo = cache.getPossiblyExpired(numberCountryIso); in queryContactInfo()
213 cache.put(numberCountryIso, info); in queryContactInfo()
267 cache.expireAll(); in invalidate()
327 cache.put(numberCountryIso, contactInfo); in injectContactInfoForTest()
/packages/modules/IntentResolver/java/src-debug/com/android/intentresolver/flags/
DDebugFeatureFlagRepository.kt33 private val cache = hashMapOf<String, Boolean>() constant
40 synchronized(cache) { in isEnabled()
41 cache[flag.name]?.let { return it } in isEnabled()
44 return synchronized(cache) { in isEnabled()
46 cache.getOrPut(flag.name) { flagValue } in isEnabled()
/packages/apps/Gallery2/src/com/android/gallery3d/util/
DCacheManager.java46 BlobCache cache = sCacheMap.get(filename); in getCache() local
47 if (cache == null) { in getCache()
51 cache = new BlobCache(path, maxEntries, maxBytes, false, in getCache()
53 sCacheMap.put(filename, cache); in getCache()
58 return cache; in getCache()
/packages/modules/Bluetooth/system/gd/storage/
Dlegacy_config_file.cc43 ConfigCache cache(temp_devices_capacity, Device::kLinkKeyProperties); in Read() local
67 cache.SetProperty(section, tokens[0], std::move(tokens[1])); in Read()
70 return cache; in Read()
73 bool LegacyConfigFile::Write(const ConfigCache& cache) { in Write() argument
74 return os::WriteToFile(path_, cache.SerializeToLegacyFormat()); in Write()
/packages/apps/Gallery2/src/com/android/gallery3d/data/
DLocalMergeAlbum.java228 ArrayList<MediaItem> cache = null; in getItem() local
233 cache = mCacheRef.get(); in getItem()
234 if (cache == null) { in getItem()
240 cache = mBaseSet.getMediaItem(index, PAGE_SIZE); in getItem()
241 mCacheRef = new SoftReference<ArrayList<MediaItem>>(cache); in getItem()
245 if (index < mStartPos || index >= mStartPos + cache.size()) { in getItem()
249 return cache.get(index - mStartPos); in getItem()
/packages/modules/IntentResolver/java/src/com/android/intentresolver/
DImagePreviewImageLoader.kt49 private val cache = LruCache<Uri, CompletableDeferred<Bitmap?>>(cacheSize) in <lambda>() constant
63 uris.asSequence().take(cache.maxSize()).forEach { uri -> in <lambda>()
71 return synchronized(cache) { in <lambda>()
72 cache.get(uri) ?: CompletableDeferred<Bitmap?>().also { result -> in <lambda>()
73 cache.put(uri, result) in <lambda>()
/packages/providers/MediaProvider/src/com/android/providers/media/util/
DCachedSupplier.java23 private volatile T cache; field in CachedSupplier
31 if (cache == null) { in get()
32 cache = wrapped.get(); in get()
34 return cache; in get()
/packages/modules/Bluetooth/system/embdrv/lc3/test/
Dbitstream.py110 self.cache = -1
139 if self.cache >= 0:
140 self.bytes[self.bp] = self.cache + self.carry
148 self.cache = self.low >> 16
178 if self.cache >= 0:
217 val = self.cache
220 self.bytes[self.bp] = self.cache
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/
DDictionaryFacilitatorLruCacheTests.java37 final DictionaryFacilitatorLruCache cache = in testGetFacilitator() local
40 final DictionaryFacilitator dictionaryFacilitatorEnUs = cache.get(Locale.US); in testGetFacilitator()
44 final DictionaryFacilitator dictionaryFacilitatorFr = cache.get(Locale.FRENCH); in testGetFacilitator()
48 final DictionaryFacilitator dictionaryFacilitatorDe = cache.get(Locale.GERMANY); in testGetFacilitator()
/packages/modules/Bluetooth/system/embdrv/lc3/src/
Dbits.c52 ((ac->cache >= 0) + ac->carry_count) * 8; in ac_get_pending_bits()
90 .cache = -1 in lc3_setup_bits()
175 if (ac->cache >= 0) in ac_shift()
176 ac_put(buffer, ac->cache + ac->carry); in ac_shift()
181 ac->cache = ac->low >> 16; in ac_shift()
227 int end_val = ac->cache >> (8 - nbits); in ac_terminate()
230 ac_put(buffer, ac->cache); in ac_terminate()
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/cache/
DBitmapCache.java17 package com.android.gallery3d.filtershow.cache;
117 public void setCacheProcessing(CacheProcessing cache) { in setCacheProcessing() argument
118 mCacheProcessing = cache; in setCacheProcessing()
121 public void cache(Buffer buffer) { in cache() method in BitmapCache
126 cache(bitmap); in cache()
129 public synchronized boolean cache(Bitmap bitmap) { in cache() method in BitmapCache

1234567