Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

MozMobileConnection.setCardLock Redirect 1

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

This API is available on Firefox OS for certified 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

Document Tags and Contributors

 Last updated by: Sheppy,