B2G/gaia/apps/system/js/operator_variant/operator_variant.js
// Check the mcc/mnc information on the SIM card.
Check the mcc/mnc information on the SIM card.
Check the mcc / mnc information on the SIM card .
function checkICCInfo() {
    if (!mobileConnection.iccInfo || mobileConnection.cardState !== 'ready')
      return;
    if ((iccSettings.mcc < 0) || (iccSettings.mnc < 0))
      return;
    var mcc = mobileConnection.iccInfo.mcc || '0';
    var mnc = mobileConnection.iccInfo.mnc || '0';
    if (mcc === '0')
      return;
    mobileConnection.removeEventListener('iccinfochange', checkICCInfo);
    if ((mcc == iccSettings.mcc) && (mnc == iccSettings.mnc)) {
      checkWAPUserAgentProfileEmpty();
      return;
    }
    iccSettings.mcc = mcc;
    iccSettings.mnc = mnc;
    retrieveOperatorVariantSettings(applyOperatorVariantSettings);
    retrieveWAPUserAgentProfileSettings(applyWAPUAProfileUrl);
  }
function checkICCInfo ( ) { if ( ! mobileConnection . iccInfo || mobileConnection . cardState !== 'ready' ) return ; if ( ( iccSettings . mcc < 0 ) || ( iccSettings . mnc < 0 ) ) return ; var mcc = mobileConnection . iccInfo . mcc || '0' ; var mnc = mobileConnection . iccInfo . mnc || '0' ; if ( mcc === '0' ) return ; mobileConnection . removeEventListener ( 'iccinfochange' , checkICCInfo ) ; if ( ( mcc == iccSettings . mcc ) && ( mnc == iccSettings . mnc ) ) { checkWAPUserAgentProfileEmpty ( ) ; return ; } iccSettings . mcc = mcc ; iccSettings . mnc = mnc ; retrieveOperatorVariantSettings ( applyOperatorVariantSettings ) ; retrieveWAPUserAgentProfileSettings ( applyWAPUAProfileUrl ) ; }
Check the mcc/mnc information on the SIM card.
Check the mcc / mnc information on the SIM card .
// ensure that the iccSettings have been retrieved // XXX sometimes we get 0/0 for mcc/mnc, even when cardState === 'ready'... // avoid setting APN (and operator variant) settings if mcc/mnc codes // changes. // same SIM card => do nothing // check and build user profile if it upgrades from v1.0.1. // new SIM card => cache iccInfo, load and apply new APN settings // use mcc, mnc to load and apply WAP user agent profile url