public static void storageStateChanged(boolean mounted) { synchronized (sCacheMap) { if (mounted) { // this is lazy initialization: we do NOT re-open all cache files until they are needed // again sNoStorage = false; } else { // clear cache map and disable cache access sNoStorage = true; for (BlobCache cache : sCacheMap.values()) { // close all entry's "value", which is a BlobCache Log.d(TAG, " => closing " + cache); cache.close(); Log.d(TAG, " <= closing " + cache); } sCacheMap.clear(); } } }