-
- All Implemented Interfaces:
-
io.opentelemetry.android.internal.services.Lifecycle,io.opentelemetry.android.internal.services.Service
public class CacheStorageService implements Service
Utility to get information about the host app.
This class is internal and not for public use. Its APIs are unstable and can change at any time.
-
-
Constructor Summary
Constructors Constructor Description CacheStorageService(Context appContext)
-
Method Summary
Modifier and Type Method Description FilegetCacheDir()longensureCacheSpaceAvailable(long maxSpaceNeeded)Checks for available cache space in the device and compares it to the max amount needed, ifthe available space is lower than the provided max value, the available space is returned,otherwise, the provided amount is returned. -
-
Constructor Detail
-
CacheStorageService
CacheStorageService(Context appContext)
-
-
Method Detail
-
getCacheDir
File getCacheDir()
-
ensureCacheSpaceAvailable
@WorkerThread() long ensureCacheSpaceAvailable(long maxSpaceNeeded)
Checks for available cache space in the device and compares it to the max amount needed, ifthe available space is lower than the provided max value, the available space is returned,otherwise, the provided amount is returned.
On Android OS with API level 26 and above, it will also ask the OS to clear stale cachefrom the device in order to make room for the provided max value if needed.
-
-
-
-