Skip to content
Browse files

Merge pull request #7414 from Rik/roaming-825121

Bug 825121 - [Lockscreen] service provider shown wrongly when roaming, r=timdream, a=blocking-basecamp
  • Loading branch information...
2 parents 2a3b7e8 + 6c1de81 commit 8869378ddac902b09fc6d4838b29f2af36381438 @timdream timdream committed Jan 9, 2013
Showing with 17 additions and 1 deletion.
  1. +15 −0 apps/system/test/unit/mobile_operator_test.js
  2. +2 −1 shared/js/mobile_operator.js
View
15 apps/system/test/unit/mobile_operator_test.js
@@ -52,6 +52,21 @@ suite('shared/MobileOperator', function() {
assert.isUndefined(infos.carrier);
assert.isUndefined(infos.region);
});
+ test('Connection with roaming', function() {
+ MockMobileConnection.voice.roaming = true;
+ var infos = MobileOperator.userFacingInfo(MockMobileConnection);
+ assert.equal(infos.operator, 'Fake short');
+ assert.isUndefined(infos.carrier);
+ assert.isUndefined(infos.region);
+ });
+ test('Connection with roaming and SPN display', function() {
+ MockMobileConnection.voice.roaming = true;
+ MockMobileConnection.iccInfo.isDisplaySpnRequired = true;
+ var infos = MobileOperator.userFacingInfo(MockMobileConnection);
+ assert.equal(infos.operator, 'Fake short');
+ assert.isUndefined(infos.carrier);
+ assert.isUndefined(infos.region);
+ });
});
suite('Brazilian connection', function() {
test('Connection ', function() {
View
3 shared/js/mobile_operator.js
@@ -9,7 +9,8 @@ var MobileOperator = {
var iccInfo = mobileConnection.iccInfo;
var operator = network.shortName || network.longName;
- if (iccInfo.isDisplaySpnRequired && iccInfo.spn) {
+ if (iccInfo.isDisplaySpnRequired && iccInfo.spn
+ && !mobileConnection.voice.roaming) {
if (iccInfo.isDisplayNetworkNameRequired) {
operator = operator + ' ' + iccInfo.spn;
} else {

0 comments on commit 8869378

Please sign in to comment.
Something went wrong with that request. Please try again.