Home
last modified time | relevance | path

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

12345

/frameworks/base/core/tests/coretests/src/android/util/
DLruCacheTest.java34 LruCache<String, String> cache = new LruCache<String, String>(3); in testStatistics() local
35 assertStatistics(cache); in testStatistics()
37 assertEquals(null, cache.put("a", "A")); in testStatistics()
39 assertStatistics(cache); in testStatistics()
40 assertHit(cache, "a", "A"); in testStatistics()
41 assertSnapshot(cache, "a", "A"); in testStatistics()
43 assertEquals(null, cache.put("b", "B")); in testStatistics()
45 assertStatistics(cache); in testStatistics()
46 assertHit(cache, "a", "A"); in testStatistics()
47 assertHit(cache, "b", "B"); in testStatistics()
[all …]
/frameworks/base/core/tests/coretests/src/android/content/pm/
DRegisteredServicesCacheTest.java76 TestServicesCache cache = new TestServicesCache(); in testGetAllServicesHappyPath() local
77 cache.addServiceForQuerying(U0, r1, newServiceInfo(t1, UID1)); in testGetAllServicesHappyPath()
78 cache.addServiceForQuerying(U0, r2, newServiceInfo(t2, UID2)); in testGetAllServicesHappyPath()
79 assertEquals(2, cache.getAllServicesSize(U0)); in testGetAllServicesHappyPath()
80 assertEquals(2, cache.getPersistentServicesSize(U0)); in testGetAllServicesHappyPath()
81 assertNotEmptyFileCreated(cache, U0); in testGetAllServicesHappyPath()
83 cache = new TestServicesCache(); in testGetAllServicesHappyPath()
84 assertEquals(2, cache.getPersistentServicesSize(U0)); in testGetAllServicesHappyPath()
88 TestServicesCache cache = new TestServicesCache(); in testGetAllServicesReplaceUid() local
89 cache.addServiceForQuerying(U0, r1, newServiceInfo(t1, UID1)); in testGetAllServicesReplaceUid()
[all …]
/frameworks/native/cmds/installd/
Dutils.cpp496 cache_t* cache = (cache_t*)calloc(1, sizeof(cache_t)); in start_cache_collection() local
497 return cache; in start_cache_collection()
502 static void* _cache_malloc(cache_t* cache, size_t len) in _cache_malloc() argument
515 if (cache->memBlocks == NULL) { in _cache_malloc()
517 cache->memBlocks = res; in _cache_malloc()
519 *(void**)res = *(void**)cache->memBlocks; in _cache_malloc()
520 *(void**)cache->memBlocks = res; in _cache_malloc()
524 int8_t* res = cache->curMemBlockAvail; in _cache_malloc()
526 if (cache->memBlocks == NULL || nextPos > cache->curMemBlockEnd) { in _cache_malloc()
532 *(void**)newBlock = cache->memBlocks; in _cache_malloc()
[all …]
/frameworks/base/core/java/android/net/
DSSLSessionCache.java57 public static void install(SSLSessionCache cache, SSLContext context) { in install() argument
61 cache == null ? null : cache.mSessionCache); in install()
74 public SSLSessionCache(Object cache) { in SSLSessionCache() argument
75 mSessionCache = (SSLClientSessionCache) cache; in SSLSessionCache()
98 SSLClientSessionCache cache = null; in SSLSessionCache() local
100 cache = FileClientSessionCache.usingDirectory(dir); in SSLSessionCache()
104 mSessionCache = cache; in SSLSessionCache()
DSSLCertificateSocketFactory.java103 int handshakeTimeoutMillis, SSLSessionCache cache, boolean secure) { in SSLCertificateSocketFactory() argument
105 mSessionCache = cache == null ? null : cache.mSessionCache; in SSLCertificateSocketFactory()
129 public static SSLSocketFactory getDefault(int handshakeTimeoutMillis, SSLSessionCache cache) { in getDefault() argument
130 return new SSLCertificateSocketFactory(handshakeTimeoutMillis, cache, true); in getDefault()
145 public static SSLSocketFactory getInsecure(int handshakeTimeoutMillis, SSLSessionCache cache) { in getInsecure() argument
146 return new SSLCertificateSocketFactory(handshakeTimeoutMillis, cache, false); in getInsecure()
167 int handshakeTimeoutMillis, SSLSessionCache cache) { in getHttpSocketFactory() argument
169 new SSLCertificateSocketFactory(handshakeTimeoutMillis, cache, true)); in getHttpSocketFactory()
/frameworks/base/docs/html/training/displaying-bitmaps/
Dcache-bitmap.jd14 <li><a href="#memory-cache">Use a Memory Cache</a></li>
15 <li><a href="#disk-cache">Use a Disk Cache</a></li>
44 and disk cache can often help here, allowing components to quickly reload processed images.</p>
46 <p>This lesson walks you through using a memory and disk bitmap cache to improve the responsiveness
49 <h2 id="memory-cache">Use a Memory Cache</h2>
51 <p>A memory cache offers fast access to bitmaps at the cost of taking up valuable application
56 recently used member before the cache exceeds its designated size.</p>
58 <p class="note"><strong>Note:</strong> In the past, a popular memory cache implementation was a
59 {@link java.lang.ref.SoftReference} or {@link java.lang.ref.WeakReference} bitmap cache, however
75 larger cache to hold the same number of images in memory compared to a device like <a
[all …]
/frameworks/base/docs/html/training/efficient-downloads/
Dredundant_redundant.jd19 <li><a href="#ResponseCache">Use the HttpURLConnection response cache</a></li>
36cache static resources, including on-demand downloads such as full size images, for as long as rea…
55 <p>Using this approach, you can also effectively cache dynamic content while ensuring it doesn't re…
57 <p>You can cache non-sensitive data can in the unmanaged external cache directory:</p>
61 <p>Alternatively, you can use the managed / secure application cache. Note that this internal cache
65 <p>Files stored in either cache location will be erased when the application is uninstalled.</p>
69 <p>Android 4.0 added a response cache to {@code HttpURLConnection}. You can enable HTTP response ca…
79 Log.d(TAG, "HTTP response cache is unavailable.");
83 <p>This sample code will turn on the response cache on Android 4.0+ devices without affecting earli…
85 <p>With the cache installed, fully cached HTTP requests can be served directly from local storage, …
[all …]
/frameworks/native/opengl/specs/
DEGL_ANDROID_blob_cache.txt45 implementations may cache shader binaries after they are compiled. It may
47 program. The management of the cache is handled by the application (or
51 While the focus of this extension is on providing a persistent cache for
75 * cache.
83 * cache.
116 the cache and associates it with the given key. <get> points to a function
117 that retrieves from the cache the value associated with a given key. The
137 To insert a new binary value into the cache and associate it with a given
150 the cache after the set call. If a different value has been associated
153 guarantees, the cache implementation should attempt to cache the most
[all …]
/frameworks/base/services/core/java/com/android/server/hdmi/
DHdmiLogger.java109 private static String updateLog(HashMap<String, Pair<Long, Integer>> cache, String logMessage) { in updateLog() argument
111 Pair<Long, Integer> timing = cache.get(logMessage); in updateLog()
114 cache.put(logMessage, new Pair<>(curTime, 1)); in updateLog()
117 increaseLogCount(cache, logMessage); in updateLog()
128 private static void increaseLogCount(HashMap<String, Pair<Long, Integer>> cache, in increaseLogCount() argument
130 Pair<Long, Integer> timing = cache.get(message); in increaseLogCount()
132 cache.put(message, new Pair<>(timing.first, timing.second + 1)); in increaseLogCount()
/frameworks/base/libs/hwui/font/
DFontUtil.h46 #define GET_METRICS(cache, glyph) cache->getGlyphIDMetrics(glyph) argument
59 #define GET_METRICS(cache, glyph) cache->getUnicharMetrics(glyph) argument
/frameworks/av/media/libstagefright/codecs/aacenc/src/
Dbitbuffer.c42 hBitBuf->cache = 0; in CreateBitBuffer()
85 hBitBuf->cache = 0; in ResetBitBuf()
134 writeValue |= hBitBuf->cache; in WriteBits()
147 hBitBuf->cache = writeValue; in WriteBits()
/frameworks/volley/src/main/java/com/android/volley/
DRequestQueue.java108 public RequestQueue(Cache cache, Network network, int threadPoolSize, in RequestQueue() argument
110 mCache = cache; in RequestQueue()
123 public RequestQueue(Cache cache, Network network, int threadPoolSize) { in RequestQueue() argument
124 this(cache, network, threadPoolSize, in RequestQueue()
134 public RequestQueue(Cache cache, Network network) { in RequestQueue() argument
135 this(cache, network, DEFAULT_NETWORK_THREAD_POOL_SIZE); in RequestQueue()
/frameworks/base/core/java/android/content/res/
DThemedResourceCache.java160 LongSparseArray<WeakReference<T>> cache = mThemedEntries.get(key); in getThemedLocked() local
161 if (cache == null && create) { in getThemedLocked()
162 cache = new LongSparseArray<>(1); in getThemedLocked()
165 mThemedEntries.put(keyClone, cache); in getThemedLocked()
168 return cache; in getThemedLocked()
/frameworks/base/core/tests/coretests/src/android/view/
DBigCacheTest.java72 final Bitmap[] cache = new Bitmap[1]; in createCacheForView() local
78 cache[0] = view.getDrawingCache(); in createCacheForView()
82 return cache[0]; in createCacheForView()
DZeroSizedTest.java90 final Bitmap[] cache = new Bitmap[1]; in createCacheForView() local
96 cache[0] = view.getDrawingCache(); in createCacheForView()
100 return cache[0]; in createCacheForView()
/frameworks/compile/libbcc/
DREADME.rst31 cache file. Note that the compilation is triggered by a cache
33 * load from the cache file upon cache-hit.
100 just-in-time compilation or cache loading
135 A cache file (denoted as \*.oBCC) for libbcc consists of several sections:
141 * **Header** (MCO_Header) - The header of a cache file. It contains the
145 to be at the beginning of the cache file.
148 length strings. The strp_index in the other part of the cache file
/frameworks/opt/bitmap/src/com/android/bitmap/drawable/
DCircularBitmapDrawable.java49 BitmapCache cache, boolean limitDensity) { in CircularBitmapDrawable() argument
50 this(res, cache, limitDensity, null); in CircularBitmapDrawable()
54 BitmapCache cache, boolean limitDensity, ExtendedOptions opts) { in CircularBitmapDrawable() argument
55 super(res, cache, limitDensity, opts); in CircularBitmapDrawable()
/frameworks/base/docs/html/training/volley/
Drequestqueue.jd39 of the requests, and a cache to handle caching. There are standard implementations of these
41 cache with an in-memory index, and {@code BasicNetwork} provides a network transport based
79 // Instantiate the cache
80 Cache cache = new DiskBasedCache(getCacheDir(), 1024 * 1024); // 1MB cap
85 // Instantiate the RequestQueue with the cache and network.
86 mRequestQueue = new RequestQueue(cache, network);
155 cache = new LruCache&lt;String, Bitmap&gt;(20);
159 return cache.get(url);
164 cache.put(url, bitmap);
Drequest.jd59 {@code ImageLoader} provides an in-memory cache to sit in front of the normal Volley
60 cache, which is important to prevent flickering. This makes it possible to achieve a
61 cache hit without blocking or deferring off the main thread, which is impossible when
159 the main function of the in-memory cache is to allow for flickerless rotation. Using a
160 singleton pattern allows the bitmap cache to outlive the activity. If instead you create the
164 <h4 id="lru-cache">Example LRU cache</h4>
166 <p>The Volley toolbox provides a standard cache implementation via the
169 in-memory LRU bitmap cache that implements the {@code ImageLoader.ImageCache} interface.
170 You may want to set up your cache as a singleton; for more discussion of this topic, see
210 // Returns a cache size equal to approximately three screens worth of images.
[all …]
/frameworks/volley/src/main/java/com/android/volley/toolbox/
DClearCacheRequest.java40 public ClearCacheRequest(Cache cache, Runnable callback) { in ClearCacheRequest() argument
42 mCache = cache; in ClearCacheRequest()
/frameworks/base/core/java/com/android/internal/util/
DArrayUtils.java113 Object cache = sCache[bucket]; in emptyArray() local
115 if (cache == null || cache.getClass().getComponentType() != kind) { in emptyArray()
116 cache = Array.newInstance(kind, 0); in emptyArray()
117 sCache[bucket] = cache; in emptyArray()
122 return (T[]) cache; in emptyArray()
/frameworks/base/cmds/uiautomator/cmds/uiautomator/
Duiautomator19 # * Use an alternative dalvik cache when running as non-root. Jar file needs
22 # cache so we redirect to an alternative cache
37 # if not running as root, trick dalvik into using an alternative dex cache
39 tmp_cache=${run_base}/dalvik-cache
/frameworks/base/core/java/android/emoji/
DEmojiFactory.java102 WeakReference<Bitmap> cache = mCache.get(pua); in getBitmapFromAndroidPua() local
103 if (cache == null) { in getBitmapFromAndroidPua()
113 Bitmap tmp = cache.get(); in getBitmapFromAndroidPua()
/frameworks/base/core/java/android/database/sqlite/
DSQLiteDebug.java134 public String cache; field in SQLiteDebug.DbStats
142 this.cache = hits + "/" + misses + "/" + cachesize; in DbStats()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/wifi/
DWifiTracker.java410 private AccessPoint getCachedOrCreate(ScanResult result, List<AccessPoint> cache) { in getCachedOrCreate() argument
411 final int N = cache.size(); in getCachedOrCreate()
413 if (cache.get(i).matches(result)) { in getCachedOrCreate()
414 AccessPoint ret = cache.remove(i); in getCachedOrCreate()
422 private AccessPoint getCachedOrCreate(WifiConfiguration config, List<AccessPoint> cache) { in getCachedOrCreate() argument
423 final int N = cache.size(); in getCachedOrCreate()
425 if (cache.get(i).matches(config)) { in getCachedOrCreate()
426 AccessPoint ret = cache.remove(i); in getCachedOrCreate()

12345