diff --git a/lib/units/device/plugins/install.js b/lib/units/device/plugins/install.js index 7f34b4ca..ad06cda8 100644 --- a/lib/units/device/plugins/install.js +++ b/lib/units/device/plugins/install.js @@ -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) { diff --git a/res/app/components/stf/install/install-error-filter.js b/res/app/components/stf/install/install-error-filter.js index cae854f5..a484c42c 100644 --- a/res/app/components/stf/install/install-error-filter.js +++ b/res/app/components/stf/install/install-error-filter.js @@ -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) } } diff --git a/lib/units/device/plugins/install/response-codes.json b/res/app/components/stf/install/response-codes.json similarity index 100% rename from lib/units/device/plugins/install/response-codes.json rename to res/app/components/stf/install/response-codes.json