1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 02:29:26 +02:00

Move install response codes to the filter.

This commit is contained in:
Simo Kinnunen 2014-09-04 16:51:43 +09:00
parent 59f1aebc87
commit fdfcdf913d
3 changed files with 4 additions and 9 deletions

View file

@ -10,7 +10,6 @@ var logger = require('../../../util/logger')
var wire = require('../../../wire')
var wireutil = require('../../../wire/util')
var promiseutil = require('../../../util/promiseutil')
var responseCodes = require('./install/response-codes')
// The error codes are available at https://github.com/android/
// platform_frameworks_base/blob/master/core/java/android/content/
@ -180,9 +179,7 @@ module.exports = syrup.serial()
)
push.send([
channel
, reply.fail(err.code, {
description: responseCodes[err.code] || null
})
, reply.fail(err.code)
])
})
.catch(function(err) {

View file

@ -1,12 +1,10 @@
// From here: https://github.com/android/platform_frameworks_base/blob/
// master/core/java/android/content/pm/PackageManager.java#L371
var responses = require('./response-codes.json')
module.exports = function installErrorFilter(gettext) {
return function (text) {
return {
INSTALL_FAILED_OLDER_SDK: gettext('New package failed because the ' +
'current SDK version is older than that required by the package')
// TODO: do the rest
}[text] || text
return gettext(responses[text] || text)
}
}