Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b369d0c8 authored by Han Wang's avatar Han Wang Committed by Danny Baumann
Browse files

CacheQuotaStrategy: Fix resource leak when reading cache quotas

The following stacktrace was seen on bootup:

W System  : A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
W System  : java.lang.Throwable: Explicit termination method 'close' not called
W System  : 	at dalvik.system.CloseGuard.open(CloseGuard.java:221)
W System  : 	at java.io.FileInputStream.<init>(FileInputStream.java:168)
W System  : 	at com.android.internal.os.AtomicFile.openRead(AtomicFile.java:147)
W System  : 	at com.android.server.storage.CacheQuotaStrategy.setupQuotasFromFile(CacheQuotaStrategy.java:301)
W System  : 	at com.android.server.usage.StorageStatsService$H.handleMessage(StorageStatsService.java:508)
W System  : 	at android.os.Handler.dispatchMessage(Handler.java:106)
W System  : 	at android.os.Looper.loop(Looper.java:193)
W System  : 	at android.os.HandlerThread.run(HandlerThread.java:65)
W System  : 	at com.android.server.ServiceThread.run(ServiceThread.java:44)

Close FileInputStream properly to handle this warning.

Change-Id: I56953ee49528190ad4210715c8f5ae3446896828
parent 95dbc930
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment