зеркало из https://github.com/mozilla/gecko-dev.git
Bug 723295 - Prevent startup crashes on devices with API level >= 8 and no SD card. r=wesj
This commit is contained in:
Родитель
22371719c3
Коммит
8c1a438588
|
@ -157,6 +157,11 @@ public final class GeckoProfile {
|
||||||
if (Build.VERSION.SDK_INT < 8) {
|
if (Build.VERSION.SDK_INT < 8) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
// if there is no external storage dir, then we're definitely on internal storage
|
||||||
|
File externalDir = mContext.getExternalFilesDir(null);
|
||||||
|
if (externalDir == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// otherwise, check app install location to see if it is on internal storage
|
// otherwise, check app install location to see if it is on internal storage
|
||||||
String resourcePath = mContext.getPackageResourcePath();
|
String resourcePath = mContext.getPackageResourcePath();
|
||||||
if (resourcePath.startsWith("/data") || resourcePath.startsWith("/system")) {
|
if (resourcePath.startsWith("/data") || resourcePath.startsWith("/system")) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче