• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. MozMobileConnection
  6. MozMobileConnection.setCardLock()

MozMobileConnection.setCardLock()

In This Article
  1. Summary
  2. Syntax
    1. Parameters
    2. Return
  3. Specification
  4. See also

This API is available on Firefox OS for internal applications only.

Summary

The setCardLock method is used to set or modify the state of a card lock.

Note: If the setCardLock call fails the icccardlockerror event is fired.

Syntax

var request = navigator.mozMobileConnection.setCardLock(info);

Parameters

info

An object containing information about the lock and how to modify its state. At a minimum, this object must have a lockType property which specifies the type of lock, e.g., "pin" for the PIN lock. Other properties are dependent on the lock type:

Object for enabling/disabling the PIN lock:

{
  lockType: "pin",
  pin     : "...", // The current pin number
  enabled : false  // false to unlock, true to lock
}

Object for enabling/disabling the FDN lock:

{
  lockType: "fdn",
  pin2    : "...", // The secondary pin number
  enabled : false  // false to unlock, true to lock
}

Object for changing the PIN:

{
  lockType: "pin",
  pin     : "...", // The current pin number
  newPin  : "..."  // The new pin number
}

Object for changing the PIN2:

{
  lockType: "pin2",
  pin     : "...", // The current secondary pin number
  newPin  : "..."  // The new secondary pin number
}

Return

A DOMRequest object to handle the success or error of the method call.

The request's result will be an object containing information about the operation:

The resulting object if enabling/disabling the card lock failed or change card lock failed:

{
  lockType  : "pin", // Can be "pin", "pin2" or "fdn"
  success   : false,
  retryCount: 2
}

The resulting object if enabling/disabling the card lock succeeded or change card lock succeeded:

{
  lockType: "pin", // Can be "pin", "pin2" or "fdn"
  success : true
}

Specification

Not part of any specification.

See also

  • MozMobileConnection
  • DOMRequest

Document Tags and Contributors

Tags: 
  • API
  • B2G
  • Firefox OS
  • Method
  • Non Standard
  • Reference
  • Référence
 Contributors to this page: chrisdavidmills, fscholz, kscarfone, Sheppy, Jeremie
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:07:54 AM
See also
  1. Mobile Connection API
  2. Archive
  3. Events
    1. icccardlockerror
    2. cardstatechange
  4. Related pages for Mobile Connection API
    1. CFStateChangeEvent
    2. DataErrorEvent
    3. IccCardLockError
    4. IccCardLockErrorEvent
    5. MozCellBroadcastEvent
    6. MozEmergencyCbModeEvent
    7. MozIccManager
    8. MozMobileCFInfo
    9. MozMobileCellInfo
    10. MozMobileConnection
    11. MozMobileConnectionInfo
    12. MozMobileICCInfo
    13. MozMobileNetworkInfo
    14. MozOtaStatusEvent
    15. MozStkCommandEvent
    16. USSDReceivedEvent