mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-28 05:06:42 +00:00
Use getCacheDir if getExternalCacheDir returns null.
This commit is contained in:
parent
4e4705e983
commit
cff7a4bfd2
3 changed files with 15 additions and 2 deletions
|
@ -297,6 +297,8 @@ public final class NativeLibrary
|
|||
|
||||
public static native void SetCacheDirectory(String directory);
|
||||
|
||||
public static native String GetCacheDirectory();
|
||||
|
||||
public static native int DefaultCPUCore();
|
||||
|
||||
public static native String GetDefaultGraphicsBackendName();
|
||||
|
|
|
@ -122,7 +122,12 @@ public final class DirectoryInitialization
|
|||
|
||||
File cacheDir = context.getExternalCacheDir();
|
||||
if (cacheDir == null)
|
||||
return false;
|
||||
{
|
||||
// In some custom ROMs getExternalCacheDir might return null for some reasons. If that is the case, fallback to getCacheDir which seems to work just fine.
|
||||
cacheDir = context.getCacheDir();
|
||||
if (cacheDir == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.debug("[DirectoryInitialization] Cache Dir: " + cacheDir.getPath());
|
||||
NativeLibrary.SetCacheDirectory(cacheDir.getPath());
|
||||
|
@ -236,7 +241,7 @@ public final class DirectoryInitialization
|
|||
|
||||
public static File getGameListCache(Context context)
|
||||
{
|
||||
return new File(context.getExternalCacheDir(), "gamelist.cache");
|
||||
return new File(NativeLibrary.GetCacheDirectory(), "gamelist.cache");
|
||||
}
|
||||
|
||||
private static boolean copyAsset(String asset, File output, Context context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue