Bug 874744 - Part 2: Move card state related attribute/event from mozMobileConnection to mozIccManager (DOM). r=bugs

This commit is contained in:
Edgar Chen 2013-05-22 16:58:44 +08:00
parent 2a90c4175d
commit 5da09096ef
2 changed files with 18 additions and 22 deletions

View File

@ -129,6 +129,17 @@ IccManager::SendStkEventDownload(const JS::Value& aEvent)
return NS_OK;
}
NS_IMETHODIMP
IccManager::GetCardState(nsAString& cardState)
{
cardState.SetIsVoid(true);
if (!mProvider) {
return NS_ERROR_FAILURE;
}
return mProvider->GetCardState(cardState);
}
NS_IMETHODIMP
IccManager::GetCardLock(const nsAString& aLockType, nsIDOMDOMRequest** aDomRequest)
{
@ -215,6 +226,7 @@ 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)
// nsIIccListener
@ -247,3 +259,9 @@ IccManager::NotifyIccCardLockError(const nsAString& aLockType, uint32_t aRetryCo
return DispatchTrustedEvent(ce);
}
NS_IMETHODIMP
IccManager::NotifyCardStateChanged()
{
return DispatchTrustedEvent(NS_LITERAL_STRING("cardstatechange"));
}

View File

@ -67,7 +67,6 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(MobileConnection, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(MobileConnection, nsDOMEventTargetHelper)
NS_IMPL_EVENT_HANDLER(MobileConnection, cardstatechange)
NS_IMPL_EVENT_HANDLER(MobileConnection, iccinfochange)
NS_IMPL_EVENT_HANDLER(MobileConnection, voicechange)
NS_IMPL_EVENT_HANDLER(MobileConnection, datachange)
@ -162,17 +161,6 @@ MobileConnection::CheckPermission(const char* type)
return permission == nsIPermissionManager::ALLOW_ACTION;
}
NS_IMETHODIMP
MobileConnection::GetCardState(nsAString& cardState)
{
cardState.SetIsVoid(true);
if (!mProvider || !CheckPermission("mobileconnection")) {
return NS_OK;
}
return mProvider->GetCardState(cardState);
}
NS_IMETHODIMP
MobileConnection::GetRetryCount(int32_t* retryCount)
{
@ -428,16 +416,6 @@ MobileConnection::NotifyDataChanged()
return DispatchTrustedEvent(NS_LITERAL_STRING("datachange"));
}
NS_IMETHODIMP
MobileConnection::NotifyCardStateChanged()
{
if (!CheckPermission("mobileconnection")) {
return NS_OK;
}
return DispatchTrustedEvent(NS_LITERAL_STRING("cardstatechange"));
}
NS_IMETHODIMP
MobileConnection::NotifyIccInfoChanged()
{