Bug 873380 - Part 1: Refined the error report policy for card lock functionality. r=smaug. sr=hsinyi

This commit is contained in:
Edgar Chen 2013-09-25 14:49:44 +08:00
parent 936f597344
commit a8154f3d20
13 changed files with 15 additions and 84 deletions

View File

@ -720,7 +720,6 @@ GK_ATOM(onheld, "onheld")
GK_ATOM(onhfpstatuschanged, "onhfpstatuschanged")
GK_ATOM(onholding, "onholding")
GK_ATOM(oniccinfochange, "oniccinfochange")
GK_ATOM(onicccardlockerror, "onicccardlockerror")
GK_ATOM(onincoming, "onincoming")
GK_ATOM(oninput, "oninput")
GK_ATOM(oninvalid, "oninvalid")

View File

@ -167,10 +167,6 @@ const kEventConstructors = {
return new HashChangeEvent(aName, aProps);
},
},
IccCardLockErrorEvent: { create: function (aName, aProps) {
return new IccCardLockErrorEvent(aName, aProps);
},
},
IDBVersionChangeEvent: { create: function (aName, aProps) {
return new IDBVersionChangeEvent(aName, aProps);
},

View File

@ -59,8 +59,6 @@ let iccListener = {
notifyStkSessionEnd: function() {},
notifyIccCardLockError: function() {},
notifyCardStateChanged: function() {},
notifyIccInfoChanged: function() {

View File

@ -6,7 +6,6 @@
XPIDL_SOURCES += [
'SimToolKit.idl',
'nsIDOMIccCardLockErrorEvent.idl',
'nsIDOMIccInfo.idl',
'nsIDOMIccManager.idl',
'nsIIccProvider.idl',

View File

@ -1,24 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMEvent.idl"
[scriptable, builtinclass, uuid(47d4db10-a258-11e2-9e96-0800200c9a66)]
interface nsIDOMIccCardLockErrorEvent : nsIDOMEvent
{
readonly attribute DOMString lockType;
readonly attribute long retryCount;
[noscript] void initIccCardLockErrorEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in DOMString aLockType,
in int32_t aRetryCount);
};
dictionary IccCardLockErrorEventInit : EventInit
{
DOMString lockType;
long retryCount;
};

View File

@ -10,7 +10,7 @@ interface nsIDOMDOMRequest;
interface nsIDOMEventListener;
interface nsIDOMMozIccInfo;
[scriptable, builtinclass, uuid(904b92cb-dad3-416f-88cf-0291012cf448)]
[scriptable, builtinclass, uuid(6b5875dc-de44-4681-84a1-9ea12d60fbe2)]
interface nsIDOMMozIccManager : nsIDOMEventTarget
{
/**
@ -458,16 +458,6 @@ interface nsIDOMMozIccManager : nsIDOMEventTarget
*/
nsIDOMDOMRequest setCardLock(in jsval info);
/**
* The 'icccardlockerror' event is notified whenever 'unlockCardLock' or
* 'setCardLock' fails.
*
* The result will be an object containing information
* about the specified lock's status,
* e.g. {lockType: "pin", retryCount: 2}.
*/
[implicit_jscontext] attribute jsval onicccardlockerror;
/**
* Retrieve the number of remaining tries for unlocking the card.
*

View File

@ -9,13 +9,11 @@ interface nsIDOMDOMRequest;
interface nsIDOMMozIccInfo;
interface nsIDOMWindow;
[scriptable, uuid(82d25440-c913-11e2-8b8b-0800200c9a66)]
[scriptable, uuid(87e9ad03-e8e2-40d1-bf28-a6d287c31b93)]
interface nsIIccListener : nsISupports
{
void notifyStkCommand(in DOMString aMessage);
void notifyStkSessionEnd();
void notifyIccCardLockError(in DOMString lockType,
in unsigned long retryCount);
void notifyCardStateChanged();
void notifyIccInfoChanged();
};

View File

@ -4,7 +4,6 @@
#include "mozilla/Services.h"
#include "nsIDOMClassInfo.h"
#include "nsIDOMIccCardLockErrorEvent.h"
#include "nsIDOMIccInfo.h"
#include "GeneratedEvents.h"
#include "IccManager.h"
@ -248,7 +247,6 @@ IccManager::UpdateContact(const nsAString& aContactType,
NS_IMPL_EVENT_HANDLER(IccManager, stkcommand)
NS_IMPL_EVENT_HANDLER(IccManager, stksessionend)
NS_IMPL_EVENT_HANDLER(IccManager, icccardlockerror)
NS_IMPL_EVENT_HANDLER(IccManager, cardstatechange)
NS_IMPL_EVENT_HANDLER(IccManager, iccinfochange)
@ -269,21 +267,6 @@ IccManager::NotifyStkSessionEnd()
return DispatchTrustedEvent(NS_LITERAL_STRING("stksessionend"));
}
NS_IMETHODIMP
IccManager::NotifyIccCardLockError(const nsAString& aLockType, uint32_t aRetryCount)
{
nsCOMPtr<nsIDOMEvent> event;
NS_NewDOMIccCardLockErrorEvent(getter_AddRefs(event), this, nullptr, nullptr);
nsCOMPtr<nsIDOMIccCardLockErrorEvent> ce = do_QueryInterface(event);
nsresult rv =
ce->InitIccCardLockErrorEvent(NS_LITERAL_STRING("icccardlockerror"),
false, false, aLockType, aRetryCount);
NS_ENSURE_SUCCESS(rv, rv);
return DispatchTrustedEvent(ce);
}
NS_IMETHODIMP
IccManager::NotifyCardStateChanged()
{

View File

@ -280,7 +280,6 @@ var interfaceNamesInGlobalScope =
"HTMLUListElement",
"HTMLUnknownElement",
"HTMLVideoElement",
{name: "IccCardLockErrorEvent", b2g: true},
"IDBCursor",
"IDBCursorWithValue",
"IDBDatabase",

View File

@ -0,0 +1,12 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[JSImplementation="@mozilla.org/dom/icccardlock-error;1",
Constructor(DOMString lockType, DOMString errorName, short retryCount)]
interface IccCardLockError : DOMError {
readonly attribute DOMString lockType;
readonly attribute short retryCount;
};

View File

@ -1,18 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Constructor(DOMString type, optional IccCardLockErrorEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
interface IccCardLockErrorEvent : Event
{
readonly attribute DOMString? lockType;
readonly attribute long retryCount;
};
dictionary IccCardLockErrorEventInit : EventInit
{
DOMString lockType = "";
long retryCount = 0;
};

View File

@ -504,7 +504,7 @@ if CONFIG['MOZ_B2G_RIL']:
WEBIDL_FILES += [
'CFStateChangeEvent.webidl',
'DataErrorEvent.webidl',
'IccCardLockErrorEvent.webidl',
'IccCardLockError.webidl',
'MozCellBroadcast.webidl',
'MozCellBroadcastEvent.webidl',
'MozEmergencyCbModeEvent.webidl',

View File

@ -31,7 +31,6 @@ simple_events = [
#ifdef MOZ_B2G_RIL
'CFStateChangeEvent',
'DataErrorEvent',
'IccCardLockErrorEvent',
'MozEmergencyCbModeEvent',
'MozOtaStatusEvent',
'MozWifiStatusChangeEvent',