Bug 976450 - Clear cache and try again when librecovery fails, r=dhylands

This commit is contained in:
Michael Wu 2014-03-05 10:56:59 -05:00
Родитель 9f4ba75dba
Коммит e6d3acbb4b
1 изменённых файлов: 12 добавлений и 2 удалений

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

@ -66,7 +66,12 @@ RecoveryService.prototype = {
#ifdef MOZ_WIDGET_GONK
// If this succeeds, then the device reboots and this never returns
if (librecovery.factoryReset() != 0) {
log("Error: Factory reset failed");
log("Error: Factory reset failed. Trying again after clearing cache.");
}
var cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
cache.clear();
if (librecovery.factoryReset() != 0) {
log("Error: Factory reset failed again");
}
#endif
throw Cr.NS_ERROR_FAILURE;
@ -76,7 +81,12 @@ RecoveryService.prototype = {
#ifdef MOZ_WIDGET_GONK
// If this succeeds, then the device reboots and this never returns
if (librecovery.installFotaUpdate(updatePath, updatePath.length) != 0) {
log("Error: FOTA install failed");
log("Error: FOTA install failed. Trying again after clearing cache.");
}
var cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
cache.clear();
if (librecovery.installFotaUpdate(updatePath, updatePath.length) != 0) {
log("Error: FOTA install failed again");
}
#endif
throw Cr.NS_ERROR_FAILURE;