Package 

Class CacheStorageService

  • 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.

    • Method Summary

      Modifier and Type Method Description
      File getCacheDir()
      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.
      • Methods inherited from class io.opentelemetry.android.internal.services.Lifecycle

        start, stop
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CacheStorageService

        CacheStorageService(Context appContext)
    • Method Detail

      • 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.