Bug 723295 - Prevent startup crashes on devices with API level >= 8 and no SD card. r=wesj

This commit is contained in:
Kartikaya Gupta 2012-02-25 23:22:40 -05:00
Родитель 22371719c3
Коммит 8c1a438588
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -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")) {