You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
api-impl/android/content/Context: make getObbDir consistent with apps' hardcoded assumptions about the obb dir location
This commit is contained in:
@@ -79,7 +79,6 @@ public class Context extends Object {
|
||||
r = new Resources(assets, dm, config);
|
||||
theme = r.newTheme();
|
||||
application_info = new ApplicationInfo();
|
||||
|
||||
InputStream inStream = ClassLoader.getSystemClassLoader().getResourceAsStream("AndroidManifest.xml");
|
||||
try {
|
||||
manifest = AndroidManifestBlock.load(inStream);
|
||||
@@ -260,7 +259,17 @@ public class Context extends Object {
|
||||
|
||||
public File getObbDir() {
|
||||
if (obb_dir == null) {
|
||||
obb_dir = new File(getDataDirFile(), "obb");
|
||||
obb_dir = new File(getDataDirFile(), "Android/obb/" + getPackageName());
|
||||
}
|
||||
if (!obb_dir.exists()) {
|
||||
if (!obb_dir.mkdirs()) {
|
||||
if (obb_dir.exists()) {
|
||||
// spurious failure; probably racing with another process for this app
|
||||
return obb_dir;
|
||||
}
|
||||
Slog.w(TAG, "Unable to create obb directory >" + obb_dir.getPath() + "<");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return obb_dir;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user