We need the disk cache enabled in Android to get EGL_ANDROID_blob_cache's
callbacks called, but we don't actually want to store anything on disk.
Fixes "Failed to create //.cache for shader cache (Read-only file
system)---disabling." spam on init.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6762>
disk_cache_destroy(cache);
+#ifdef ANDROID
+ /* Android doesn't try writing to disk (just calls the cache callbacks), so
+ * the directory tests below don't apply.
+ */
+ exit(error ? 1 : 0);
+#endif
+
/* Test with XDG_CACHE_HOME set */
setenv("XDG_CACHE_HOME", CACHE_TEST_TMP "/xdg-cache-home", 1);
cache = disk_cache_create("test", "make_check", 0);
/* Assume failure. */
cache->path_init_failed = true;
+#ifdef ANDROID
+ /* Android needs the "disk cache" to be enabled for
+ * EGL_ANDROID_blob_cache's callbacks to be called, but it doesn't actually
+ * want any storing to disk to happen inside of the driver.
+ */
+ goto path_fail;
+#endif
+
char *path = disk_cache_generate_cache_dir(local);
if (!path)
goto path_fail;