Bug 1114935 - Part 6.3: Migration in Bluetooth. r=btian

--HG--
extra : histedit_source : b7f3f1d46e62b84ccae5d080193e549af6373b0c
This commit is contained in:
Bevis Tseng 2015-01-15 18:22:08 +08:00
Родитель 7e83037bda
Коммит b36101cd61
8 изменённых файлов: 54 добавлений и 36 удалений

Просмотреть файл

@ -7,12 +7,11 @@
#include "BluetoothRilListener.h"
#include "BluetoothHfpManager.h"
#include "nsIIccProvider.h"
#include "nsIIccService.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h"
#include "nsITelephonyCallInfo.h"
#include "nsITelephonyService.h"
#include "nsRadioInterfaceLayer.h" // For NS_RILCONTENTHELPER_CONTRACTID.
#include "nsServiceManagerUtils.h"
#include "nsString.h"
@ -60,15 +59,19 @@ IccListener::Listen(bool aStart)
{
NS_ENSURE_TRUE(mOwner, false);
nsCOMPtr<nsIIccProvider> provider =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
nsCOMPtr<nsIIccService> service =
do_GetService(ICC_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(service, false);
nsCOMPtr<nsIIcc> icc;
service->GetIccByServiceId(mOwner->mClientId, getter_AddRefs(icc));
NS_ENSURE_TRUE(icc, false);
nsresult rv;
if (aStart) {
rv = provider->RegisterIccMsg(mOwner->mClientId, this);
rv = icc->RegisterListener(this);
} else {
rv = provider->UnregisterIccMsg(mOwner->mClientId, this);
rv = icc->UnregisterListener(this);
}
return NS_SUCCEEDED(rv);

Просмотреть файл

@ -11,7 +11,7 @@
#include "nsAutoPtr.h"
#include "nsIIccProvider.h"
#include "nsIIccService.h"
#include "nsIMobileConnectionService.h"
#include "nsITelephonyCallInfo.h"
#include "nsITelephonyService.h"

Просмотреть файл

@ -17,14 +17,13 @@
#include "nsContentUtils.h"
#include "nsIAudioManager.h"
#include "nsIIccInfo.h"
#include "nsIIccProvider.h"
#include "nsIIccService.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h"
#include "nsIMobileNetworkInfo.h"
#include "nsIObserverService.h"
#include "nsISettingsService.h"
#include "nsITelephonyService.h"
#include "nsRadioInterfaceLayer.h"
#include "nsServiceManagerUtils.h"
#include "nsThreadUtils.h"
#include "mozilla/dom/BindingUtils.h"
@ -726,12 +725,16 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
void
BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
{
nsCOMPtr<nsIIccProvider> icc =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
nsCOMPtr<nsIIccService> service =
do_GetService(ICC_SERVICE_CONTRACTID);
NS_ENSURE_TRUE_VOID(service);
nsCOMPtr<nsIIcc> icc;
service->GetIccByServiceId(aClientId, getter_AddRefs(icc));
NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
icc->GetIccInfo(getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);

Просмотреть файл

@ -28,12 +28,11 @@
#ifdef MOZ_B2G_RIL
#include "nsIIccInfo.h"
#include "nsIIccProvider.h"
#include "nsIIccService.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h"
#include "nsIMobileNetworkInfo.h"
#include "nsITelephonyService.h"
#include "nsRadioInterfaceLayer.h"
#endif
/**
@ -664,12 +663,16 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
void
BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
{
nsCOMPtr<nsIIccProvider> icc =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
nsCOMPtr<nsIIccService> service =
do_GetService(ICC_SERVICE_CONTRACTID);
NS_ENSURE_TRUE_VOID(service);
nsCOMPtr<nsIIcc> icc;
service->GetIccByServiceId(aClientId, getter_AddRefs(icc));
NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
icc->GetIccInfo(getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);

Просмотреть файл

@ -7,11 +7,10 @@
#include "BluetoothRilListener.h"
#include "BluetoothHfpManager.h"
#include "nsIIccProvider.h"
#include "nsIIccService.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h"
#include "nsITelephonyService.h"
#include "nsRadioInterfaceLayer.h" // For NS_RILCONTENTHELPER_CONTRACTID.
#include "nsServiceManagerUtils.h"
#include "nsString.h"
@ -59,15 +58,19 @@ IccListener::Listen(bool aStart)
{
NS_ENSURE_TRUE(mOwner, false);
nsCOMPtr<nsIIccProvider> provider =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
nsCOMPtr<nsIIccService> service =
do_GetService(ICC_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(service, false);
nsCOMPtr<nsIIcc> icc;
service->GetIccByServiceId(mOwner->mClientId, getter_AddRefs(icc));
NS_ENSURE_TRUE(icc, false);
nsresult rv;
if (aStart) {
rv = provider->RegisterIccMsg(mOwner->mClientId, this);
rv = icc->RegisterListener(this);
} else {
rv = provider->UnregisterIccMsg(mOwner->mClientId, this);
rv = icc->UnregisterListener(this);
}
return NS_SUCCEEDED(rv);

Просмотреть файл

@ -11,7 +11,7 @@
#include "nsAutoPtr.h"
#include "nsIIccProvider.h"
#include "nsIIccService.h"
#include "nsIMobileConnectionService.h"
#include "nsITelephonyCallInfo.h"
#include "nsITelephonyService.h"

Просмотреть файл

@ -17,14 +17,13 @@
#include "nsContentUtils.h"
#include "nsIAudioManager.h"
#include "nsIIccInfo.h"
#include "nsIIccProvider.h"
#include "nsIIccService.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h"
#include "nsIMobileNetworkInfo.h"
#include "nsIObserverService.h"
#include "nsISettingsService.h"
#include "nsITelephonyService.h"
#include "nsRadioInterfaceLayer.h"
#include "nsServiceManagerUtils.h"
#include "nsThreadUtils.h"
#include "mozilla/dom/BindingUtils.h"
@ -710,12 +709,16 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
void
BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
{
nsCOMPtr<nsIIccProvider> icc =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
nsCOMPtr<nsIIccService> service =
do_GetService(ICC_SERVICE_CONTRACTID);
NS_ENSURE_TRUE_VOID(service);
nsCOMPtr<nsIIcc> icc;
service->GetIccByServiceId(aClientId, getter_AddRefs(icc));
NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
icc->GetIccInfo(getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);

Просмотреть файл

@ -28,12 +28,11 @@
#ifdef MOZ_B2G_RIL
#include "nsIIccInfo.h"
#include "nsIIccProvider.h"
#include "nsIIccService.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h"
#include "nsIMobileNetworkInfo.h"
#include "nsITelephonyService.h"
#include "nsRadioInterfaceLayer.h"
#endif
/**
@ -664,12 +663,16 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
void
BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
{
nsCOMPtr<nsIIccProvider> icc =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
nsCOMPtr<nsIIccService> service =
do_GetService(ICC_SERVICE_CONTRACTID);
NS_ENSURE_TRUE_VOID(service);
nsCOMPtr<nsIIcc> icc;
service->GetIccByServiceId(aClientId, getter_AddRefs(icc));
NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
icc->GetIccInfo(getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);