MozNetworkStatsManager.addAlarm()
#
DescriptionThe addAlarm method installs an alarm on a network. When total data usage reaches threshold bytes, a "networkstats-alarm" system message is sent to the application, where the optional parameter data must be a cloneable object.
#
Syntax#
Parameters#
networkThe origin of the data. It can specify wifi, mobile, or null. If null, data measurement from both origins are merged. To know in advance which kind of origin is available, the MozNetworkStatsManager.getAvailableNetworks method returns an Array of interfaces.
#
thresholdThe total data usage threshold in bytes.
#
optionsFiltering options.
NetworkStatsAlarmOptions is a dictionary object providing filtering options.
#
ReturnA DOMRequest object. If successful, the result field of the DOMRequest keeps the alarm Id.
#
ExceptionsInvalidNetwork
The network must be in the return of MozNetworkStatsManager.getAvailableNetworks
.