Add upload and installation errors.

This commit is contained in:
Gunther Brunner
2014-09-04 16:10:42 +09:00
parent 7ea5dd2777
commit 2f172c2fda
14 changed files with 165 additions and 69 deletions

View File

@@ -0,0 +1,4 @@
module.exports = angular.module('stf.install-service', [
require('gettext').name
])
.filter('installError', require('./install-error-filter'))

View File

@@ -0,0 +1,12 @@
// From here: https://github.com/android/platform_frameworks_base/blob/
// master/core/java/android/content/pm/PackageManager.java#L371
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
}
}

View File

@@ -0,0 +1,13 @@
describe('install', function() {
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function($filter) {
var filter = $filter('install')
expect(filter('input')).toEqual('output')
}))
})