This commit is contained in:
Ryan VanderMeulen 2014-10-06 17:29:50 -04:00
Родитель f3d650b7c0 c0ad8b6eb4
Коммит fab0916f80
45 изменённых файлов: 682 добавлений и 206 удалений

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0"> <project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

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

@ -17,7 +17,7 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/> <project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0"> <project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0"> <project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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

@ -17,7 +17,7 @@
</project> </project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/> <project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/>

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

@ -4,6 +4,6 @@
"remote": "", "remote": "",
"branch": "" "branch": ""
}, },
"revision": "842fd7448790cfaeaf0bf22164e599c74e9be0e9", "revision": "1e5360b21cca807b2ea63ea8fb878b451131c9bd",
"repo_path": "/integration/gaia-central" "repo_path": "/integration/gaia-central"
} }

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

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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

@ -17,7 +17,7 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/> <project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/>

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

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="470826d13ae130a5c3d572d1029e595105485fb0"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

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

@ -698,6 +698,11 @@ DOMInterfaces = {
'notflattened': True 'notflattened': True
}, },
'MozCdmaIccInfo': {
'headerFile': 'mozilla/dom/IccInfo.h',
'nativeType': 'mozilla::dom::CdmaIccInfo',
},
'MozCellBroadcast': { 'MozCellBroadcast': {
'nativeType': 'mozilla::dom::CellBroadcast', 'nativeType': 'mozilla::dom::CellBroadcast',
}, },
@ -711,10 +716,19 @@ DOMInterfaces = {
'nativeType': 'mozilla::dom::CellBroadcastMessage', 'nativeType': 'mozilla::dom::CellBroadcastMessage',
}, },
'MozGsmIccInfo': {
'headerFile': 'mozilla/dom/IccInfo.h',
'nativeType': 'mozilla::dom::GsmIccInfo',
},
'MozIcc': { 'MozIcc': {
'nativeType': 'mozilla::dom::Icc', 'nativeType': 'mozilla::dom::Icc',
}, },
'MozIccInfo': {
'nativeType': 'mozilla::dom::IccInfo',
},
'MozIccManager': { 'MozIccManager': {
'nativeType': 'mozilla::dom::IccManager', 'nativeType': 'mozilla::dom::IccManager',
}, },
@ -1794,7 +1808,6 @@ addExternalIface('MozControllers', nativeType='nsIControllers')
addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=True) addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=True)
addExternalIface('MozFrameRequestCallback', nativeType='nsIFrameRequestCallback', addExternalIface('MozFrameRequestCallback', nativeType='nsIFrameRequestCallback',
notflattened=True) notflattened=True)
addExternalIface('MozIccInfo', headerFile='nsIDOMIccInfo.h')
addExternalIface('MozMmsMessage') addExternalIface('MozMmsMessage')
addExternalIface('MozObserver', nativeType='nsIObserver', notflattened=True) addExternalIface('MozObserver', nativeType='nsIObserver', notflattened=True)
addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource', addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',

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

@ -16,7 +16,7 @@
#include "mozilla/StaticPtr.h" #include "mozilla/StaticPtr.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsIAudioManager.h" #include "nsIAudioManager.h"
#include "nsIDOMIccInfo.h" #include "nsIIccInfo.h"
#include "nsIIccProvider.h" #include "nsIIccProvider.h"
#include "nsIMobileConnectionInfo.h" #include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h" #include "nsIMobileConnectionService.h"
@ -673,11 +673,11 @@ BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
do_GetService(NS_RILCONTENTHELPER_CONTRACTID); do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(icc); NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIDOMMozIccInfo> iccInfo; nsCOMPtr<nsIIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo)); icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo); NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo); nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
NS_ENSURE_TRUE_VOID(gsmIccInfo); NS_ENSURE_TRUE_VOID(gsmIccInfo);
gsmIccInfo->GetMsisdn(mMsisdn); gsmIccInfo->GetMsisdn(mMsisdn);
} }

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

@ -27,7 +27,7 @@
#include "mozilla/dom/SettingChangeNotificationBinding.h" #include "mozilla/dom/SettingChangeNotificationBinding.h"
#ifdef MOZ_B2G_RIL #ifdef MOZ_B2G_RIL
#include "nsIDOMIccInfo.h" #include "nsIIccInfo.h"
#include "nsIIccProvider.h" #include "nsIIccProvider.h"
#include "nsIMobileConnectionInfo.h" #include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h" #include "nsIMobileConnectionService.h"
@ -674,11 +674,11 @@ BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
do_GetService(NS_RILCONTENTHELPER_CONTRACTID); do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(icc); NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIDOMMozIccInfo> iccInfo; nsCOMPtr<nsIIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo)); icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo); NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo); nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
NS_ENSURE_TRUE_VOID(gsmIccInfo); NS_ENSURE_TRUE_VOID(gsmIccInfo);
gsmIccInfo->GetMsisdn(mMsisdn); gsmIccInfo->GetMsisdn(mMsisdn);
} }

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

@ -16,7 +16,7 @@
#include "mozilla/StaticPtr.h" #include "mozilla/StaticPtr.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsIAudioManager.h" #include "nsIAudioManager.h"
#include "nsIDOMIccInfo.h" #include "nsIIccInfo.h"
#include "nsIIccProvider.h" #include "nsIIccProvider.h"
#include "nsIMobileConnectionInfo.h" #include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h" #include "nsIMobileConnectionService.h"
@ -678,11 +678,11 @@ BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
do_GetService(NS_RILCONTENTHELPER_CONTRACTID); do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(icc); NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIDOMMozIccInfo> iccInfo; nsCOMPtr<nsIIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo)); icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo); NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo); nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
NS_ENSURE_TRUE_VOID(gsmIccInfo); NS_ENSURE_TRUE_VOID(gsmIccInfo);
gsmIccInfo->GetMsisdn(mMsisdn); gsmIccInfo->GetMsisdn(mMsisdn);
} }

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

@ -27,7 +27,7 @@
#include "mozilla/dom/SettingChangeNotificationBinding.h" #include "mozilla/dom/SettingChangeNotificationBinding.h"
#ifdef MOZ_B2G_RIL #ifdef MOZ_B2G_RIL
#include "nsIDOMIccInfo.h" #include "nsIIccInfo.h"
#include "nsIIccProvider.h" #include "nsIIccProvider.h"
#include "nsIMobileConnectionInfo.h" #include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h" #include "nsIMobileConnectionService.h"
@ -674,11 +674,11 @@ BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
do_GetService(NS_RILCONTENTHELPER_CONTRACTID); do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(icc); NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIDOMMozIccInfo> iccInfo; nsCOMPtr<nsIIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo)); icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo); NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo); nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
NS_ENSURE_TRUE_VOID(gsmIccInfo); NS_ENSURE_TRUE_VOID(gsmIccInfo);
gsmIccInfo->GetMsisdn(mMsisdn); gsmIccInfo->GetMsisdn(mMsisdn);
} }

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

@ -2,29 +2,43 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * 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/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Icc.h" #include "mozilla/dom/Icc.h"
#include "mozilla/dom/DOMRequest.h"
#include "mozilla/dom/IccInfo.h"
#include "mozilla/dom/MozIccBinding.h" #include "mozilla/dom/MozIccBinding.h"
#include "mozilla/dom/MozStkCommandEvent.h" #include "mozilla/dom/MozStkCommandEvent.h"
#include "mozilla/dom/DOMRequest.h"
#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/ScriptSettings.h"
#include "nsIDOMIccInfo.h" #include "nsIIccInfo.h"
#include "nsIIccProvider.h"
#include "nsJSON.h" #include "nsJSON.h"
#include "nsRadioInterfaceLayer.h" #include "nsRadioInterfaceLayer.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
using namespace mozilla::dom; using namespace mozilla::dom;
Icc::Icc(nsPIDOMWindow* aWindow, long aClientId, const nsAString& aIccId) NS_IMPL_CYCLE_COLLECTION_INHERITED(Icc, DOMEventTargetHelper, mIccInfo)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(Icc)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(Icc, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(Icc, DOMEventTargetHelper)
Icc::Icc(nsPIDOMWindow* aWindow, long aClientId, nsIIccInfo* aIccInfo)
: mLive(true) : mLive(true)
, mClientId(aClientId) , mClientId(aClientId)
, mIccId(aIccId)
{ {
SetIsDOMBinding(); SetIsDOMBinding();
BindToOwner(aWindow); BindToOwner(aWindow);
mProvider = do_GetService(NS_RILCONTENTHELPER_CONTRACTID); mProvider = do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
if (aIccInfo) {
aIccInfo->GetIccid(mIccId);
UpdateIccInfo(aIccInfo);
}
// Not being able to acquire the provider isn't fatal since we check // Not being able to acquire the provider isn't fatal since we check
// for it explicitly below. // for it explicitly below.
if (!mProvider) { if (!mProvider) {
@ -35,6 +49,7 @@ Icc::Icc(nsPIDOMWindow* aWindow, long aClientId, const nsAString& aIccId)
void void
Icc::Shutdown() Icc::Shutdown()
{ {
mIccInfo.SetNull();
mProvider = nullptr; mProvider = nullptr;
mLive = false; mLive = false;
} }
@ -74,6 +89,38 @@ Icc::NotifyStkEvent(const nsAString& aName, const nsAString& aMessage)
return DispatchTrustedEvent(event); return DispatchTrustedEvent(event);
} }
void
Icc::UpdateIccInfo(nsIIccInfo* aIccInfo)
{
if (!aIccInfo) {
mIccInfo.SetNull();
return;
}
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo(do_QueryInterface(aIccInfo));
if (gsmIccInfo) {
if (mIccInfo.IsNull() || !mIccInfo.Value().IsMozGsmIccInfo()) {
mIccInfo.SetValue().SetAsMozGsmIccInfo() = new GsmIccInfo(GetOwner());
}
mIccInfo.Value().GetAsMozGsmIccInfo().get()->Update(gsmIccInfo);
return;
}
nsCOMPtr<nsICdmaIccInfo> cdmaIccInfo(do_QueryInterface(aIccInfo));
if (cdmaIccInfo) {
if (mIccInfo.IsNull() || !mIccInfo.Value().IsMozCdmaIccInfo()) {
mIccInfo.SetValue().SetAsMozCdmaIccInfo() = new CdmaIccInfo(GetOwner());
}
mIccInfo.Value().GetAsMozCdmaIccInfo().get()->Update(cdmaIccInfo);
return;
}
if (mIccInfo.IsNull() || !mIccInfo.Value().IsMozIccInfo()) {
mIccInfo.SetValue().SetAsMozIccInfo() = new IccInfo(GetOwner());
}
mIccInfo.Value().GetAsMozIccInfo().get()->Update(aIccInfo);
}
// WrapperCache // WrapperCache
JSObject* JSObject*
@ -84,20 +131,10 @@ Icc::WrapObject(JSContext* aCx)
// MozIcc WebIDL // MozIcc WebIDL
already_AddRefed<nsIDOMMozIccInfo> void
Icc::GetIccInfo() const Icc::GetIccInfo(Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo>& aIccInfo) const
{ {
if (!mProvider) { aIccInfo = mIccInfo;
return nullptr;
}
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
nsresult rv = mProvider->GetIccInfo(mClientId, getter_AddRefs(iccInfo));
if (NS_FAILED(rv)) {
return nullptr;
}
return iccInfo.forget();
} }
void void

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

@ -5,8 +5,11 @@
#ifndef mozilla_dom_Icc_h #ifndef mozilla_dom_Icc_h
#define mozilla_dom_Icc_h #define mozilla_dom_Icc_h
#include "mozilla/dom/UnionTypes.h"
#include "mozilla/DOMEventTargetHelper.h" #include "mozilla/DOMEventTargetHelper.h"
#include "nsIIccProvider.h"
class nsIIccInfo;
class nsIIccProvider;
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
@ -16,9 +19,11 @@ class DOMRequest;
class Icc MOZ_FINAL : public DOMEventTargetHelper class Icc MOZ_FINAL : public DOMEventTargetHelper
{ {
public: public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Icc, DOMEventTargetHelper)
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper) NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
Icc(nsPIDOMWindow* aWindow, long aClientId, const nsAString& aIccId); Icc(nsPIDOMWindow* aWindow, long aClientId, nsIIccInfo* aIccInfo);
void void
Shutdown(); Shutdown();
@ -35,6 +40,9 @@ public:
return mIccId; return mIccId;
} }
void
UpdateIccInfo(nsIIccInfo* aIccInfo);
nsPIDOMWindow* nsPIDOMWindow*
GetParentObject() const GetParentObject() const
{ {
@ -46,8 +54,8 @@ public:
WrapObject(JSContext* aCx) MOZ_OVERRIDE; WrapObject(JSContext* aCx) MOZ_OVERRIDE;
// MozIcc WebIDL // MozIcc WebIDL
already_AddRefed<nsIDOMMozIccInfo> void
GetIccInfo() const; GetIccInfo(Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo>& aIccInfo) const;
void void
GetCardState(nsString& aCardState) const; GetCardState(nsString& aCardState) const;
@ -116,6 +124,7 @@ private:
// mProvider is a xpcom service and will be released at shutdown, so it // mProvider is a xpcom service and will be released at shutdown, so it
// doesn't need to be cycle collected. // doesn't need to be cycle collected.
nsCOMPtr<nsIIccProvider> mProvider; nsCOMPtr<nsIIccProvider> mProvider;
Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo> mIccInfo;
}; };
} // namespace dom } // namespace dom

230
dom/icc/IccInfo.cpp Normal file
Просмотреть файл

@ -0,0 +1,230 @@
/* 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 "mozilla/dom/IccInfo.h"
#include "nsPIDOMWindow.h"
#define CONVERT_STRING_TO_NULLABLE_ENUM(_string, _enumType, _enum) \
{ \
uint32_t i = 0; \
for (const EnumEntry* entry = _enumType##Values::strings; \
entry->value; \
++entry, ++i) { \
if (_string.EqualsASCII(entry->value)) { \
_enum.SetValue(static_cast<_enumType>(i)); \
} \
} \
}
using namespace mozilla::dom;
// IccInfo
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(IccInfo, mWindow, mIccInfo)
NS_IMPL_CYCLE_COLLECTING_ADDREF(IccInfo)
NS_IMPL_CYCLE_COLLECTING_RELEASE(IccInfo)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IccInfo)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
IccInfo::IccInfo(nsPIDOMWindow* aWindow)
: mWindow(aWindow)
{
SetIsDOMBinding();
}
void
IccInfo::Update(nsIIccInfo* aInfo)
{
mIccInfo = aInfo;
}
JSObject*
IccInfo::WrapObject(JSContext* aCx)
{
return MozIccInfoBinding::Wrap(aCx, this);
}
Nullable<IccType>
IccInfo::GetIccType() const
{
if (!mIccInfo) {
return Nullable<IccType>();
}
nsAutoString type;
Nullable<IccType> iccType;
mIccInfo->GetIccType(type);
CONVERT_STRING_TO_NULLABLE_ENUM(type, IccType, iccType);
return iccType;
}
void
IccInfo::GetIccid(nsAString& aIccId) const
{
if (!mIccInfo) {
aIccId.SetIsVoid(true);
return;
}
mIccInfo->GetIccid(aIccId);
}
void
IccInfo::GetMcc(nsAString& aMcc) const
{
if (!mIccInfo) {
aMcc.SetIsVoid(true);
return;
}
mIccInfo->GetMcc(aMcc);
}
void
IccInfo::GetMnc(nsAString& aMnc) const
{
if (!mIccInfo) {
aMnc.SetIsVoid(true);
return;
}
mIccInfo->GetMnc(aMnc);
}
void
IccInfo::GetSpn(nsAString& aSpn) const
{
if (!mIccInfo) {
aSpn.SetIsVoid(true);
return;
}
mIccInfo->GetSpn(aSpn);
}
bool
IccInfo::IsDisplayNetworkNameRequired() const
{
if (!mIccInfo) {
return false;
}
bool isDisplayNetworkNameRequired;
mIccInfo->GetIsDisplayNetworkNameRequired(&isDisplayNetworkNameRequired);
return isDisplayNetworkNameRequired;
}
bool
IccInfo::IsDisplaySpnRequired() const
{
if (!mIccInfo) {
return false;
}
bool isDisplaySpnRequired;
mIccInfo->GetIsDisplaySpnRequired(&isDisplaySpnRequired);
return isDisplaySpnRequired;
}
// GsmIccInfo
NS_IMPL_CYCLE_COLLECTION_INHERITED(GsmIccInfo, IccInfo, mGsmIccInfo)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(GsmIccInfo)
NS_INTERFACE_MAP_END_INHERITING(IccInfo)
NS_IMPL_ADDREF_INHERITED(GsmIccInfo, IccInfo)
NS_IMPL_RELEASE_INHERITED(GsmIccInfo, IccInfo)
GsmIccInfo::GsmIccInfo(nsPIDOMWindow* aWindow)
: IccInfo(aWindow)
{
SetIsDOMBinding();
}
void
GsmIccInfo::Update(nsIGsmIccInfo* aInfo)
{
IccInfo::Update(aInfo);
mGsmIccInfo = aInfo;
}
JSObject*
GsmIccInfo::WrapObject(JSContext* aCx)
{
return MozGsmIccInfoBinding::Wrap(aCx, this);
}
void
GsmIccInfo::GetMsisdn(nsAString& aMsisdn) const
{
if (!mGsmIccInfo) {
aMsisdn.SetIsVoid(true);
return;
}
mGsmIccInfo->GetMsisdn(aMsisdn);
}
// CdmaIccInfo
NS_IMPL_CYCLE_COLLECTION_INHERITED(CdmaIccInfo, IccInfo, mCdmaIccInfo)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(CdmaIccInfo)
NS_INTERFACE_MAP_END_INHERITING(IccInfo)
NS_IMPL_ADDREF_INHERITED(CdmaIccInfo, IccInfo)
NS_IMPL_RELEASE_INHERITED(CdmaIccInfo, IccInfo)
CdmaIccInfo::CdmaIccInfo(nsPIDOMWindow* aWindow)
: IccInfo(aWindow)
{
SetIsDOMBinding();
}
void
CdmaIccInfo::Update(nsICdmaIccInfo* aInfo)
{
IccInfo::Update(aInfo);
mCdmaIccInfo = aInfo;
}
JSObject*
CdmaIccInfo::WrapObject(JSContext* aCx)
{
return MozCdmaIccInfoBinding::Wrap(aCx, this);
}
void
CdmaIccInfo::GetMdn(nsAString& aMdn) const
{
if (!mCdmaIccInfo) {
aMdn.SetIsVoid(true);
return;
}
mCdmaIccInfo->GetMdn(aMdn);
}
int32_t
CdmaIccInfo::PrlVersion() const
{
if (!mCdmaIccInfo) {
return 0;
}
int32_t prlVersion;
mCdmaIccInfo->GetPrlVersion(&prlVersion);
return prlVersion;
}

128
dom/icc/IccInfo.h Normal file
Просмотреть файл

@ -0,0 +1,128 @@
/* 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/. */
#ifndef mozilla_dom_IccInfo_h
#define mozilla_dom_IccInfo_h
#include "MozIccInfoBinding.h"
#include "nsIIccInfo.h"
#include "nsWrapperCache.h"
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
class IccInfo : public nsISupports
, public nsWrapperCache
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IccInfo)
explicit IccInfo(nsPIDOMWindow* aWindow);
void
Update(nsIIccInfo* aInfo);
nsPIDOMWindow*
GetParentObject() const
{
return mWindow;
}
// WrapperCache
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
// WebIDL interface
Nullable<IccType>
GetIccType() const;
void
GetIccid(nsAString& aIccId) const;
void
GetMcc(nsAString& aMcc) const;
void
GetMnc(nsAString& aMnc) const;
void
GetSpn(nsAString& aSpn) const;
bool
IsDisplayNetworkNameRequired() const;
bool
IsDisplaySpnRequired() const;
protected:
~IccInfo() {}
protected:
nsCOMPtr<nsPIDOMWindow> mWindow;
nsCOMPtr<nsIIccInfo> mIccInfo;
};
class GsmIccInfo MOZ_FINAL : public IccInfo
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(GsmIccInfo, IccInfo)
explicit GsmIccInfo(nsPIDOMWindow* aWindow);
void
Update(nsIGsmIccInfo* aInfo);
// WrapperCache
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
// MozCdmaIccInfo WebIDL
void
GetMsisdn(nsAString& aMsisdn) const;
private:
~GsmIccInfo() {}
private:
nsCOMPtr<nsIGsmIccInfo> mGsmIccInfo;
};
class CdmaIccInfo MOZ_FINAL : public IccInfo
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CdmaIccInfo, IccInfo)
explicit CdmaIccInfo(nsPIDOMWindow* aWindow);
void
Update(nsICdmaIccInfo* aInfo);
// WrapperCache
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
// MozCdmaIccInfo WebIDL
void
GetMdn(nsAString& aMdn) const;
int32_t
PrlVersion() const;
private:
~CdmaIccInfo() {}
private:
nsCOMPtr<nsICdmaIccInfo> mCdmaIccInfo;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_IccInfo_h

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

@ -7,7 +7,7 @@
#include "Icc.h" #include "Icc.h"
#include "IccManager.h" #include "IccManager.h"
#include "nsIDOMClassInfo.h" #include "nsIDOMClassInfo.h"
#include "nsIDOMIccInfo.h" #include "nsIIccInfo.h"
#include "nsRadioInterfaceLayer.h" #include "nsRadioInterfaceLayer.h"
using namespace mozilla::dom; using namespace mozilla::dom;
@ -27,13 +27,13 @@ IccListener::IccListener(IccManager* aIccManager, uint32_t aClientId)
return; return;
} }
nsCOMPtr<nsIDOMMozIccInfo> iccInfo; nsCOMPtr<nsIIccInfo> iccInfo;
mProvider->GetIccInfo(mClientId, getter_AddRefs(iccInfo)); mProvider->GetIccInfo(mClientId, getter_AddRefs(iccInfo));
if (iccInfo) { if (iccInfo) {
nsString iccId; nsString iccId;
iccInfo->GetIccid(iccId); iccInfo->GetIccid(iccId);
if (!iccId.IsEmpty()) { if (!iccId.IsEmpty()) {
mIcc = new Icc(mIccManager->GetOwner(), mClientId, iccId); mIcc = new Icc(mIccManager->GetOwner(), mClientId, iccInfo);
} }
} }
@ -98,7 +98,7 @@ IccListener::NotifyCardStateChanged()
NS_IMETHODIMP NS_IMETHODIMP
IccListener::NotifyIccInfoChanged() IccListener::NotifyIccInfoChanged()
{ {
nsCOMPtr<nsIDOMMozIccInfo> iccInfo; nsCOMPtr<nsIIccInfo> iccInfo;
mProvider->GetIccInfo(mClientId, getter_AddRefs(iccInfo)); mProvider->GetIccInfo(mClientId, getter_AddRefs(iccInfo));
// Create/delete icc object based on current iccInfo. // Create/delete icc object based on current iccInfo.
@ -111,12 +111,13 @@ IccListener::NotifyIccInfoChanged()
nsString iccId; nsString iccId;
iccInfo->GetIccid(iccId); iccInfo->GetIccid(iccId);
if (!iccId.IsEmpty()) { if (!iccId.IsEmpty()) {
mIcc = new Icc(mIccManager->GetOwner(), mClientId, iccId); mIcc = new Icc(mIccManager->GetOwner(), mClientId, iccInfo);
mIccManager->NotifyIccAdd(iccId); mIccManager->NotifyIccAdd(iccId);
mIcc->NotifyEvent(NS_LITERAL_STRING("iccinfochange")); mIcc->NotifyEvent(NS_LITERAL_STRING("iccinfochange"));
} }
} }
} else { } else {
mIcc->UpdateIccInfo(iccInfo);
mIcc->NotifyEvent(NS_LITERAL_STRING("iccinfochange")); mIcc->NotifyEvent(NS_LITERAL_STRING("iccinfochange"));
if (!iccInfo) { if (!iccInfo) {
nsString iccId = mIcc->GetIccId(); nsString iccId = mIcc->GetIccId();

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

@ -8,7 +8,7 @@
#include "IccListener.h" #include "IccListener.h"
#include "mozilla/dom/IccChangeEvent.h" #include "mozilla/dom/IccChangeEvent.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "nsIDOMIccInfo.h" #include "nsIIccInfo.h"
using namespace mozilla::dom; using namespace mozilla::dom;

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

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
XPIDL_SOURCES += [ XPIDL_SOURCES += [
'nsIDOMIccInfo.idl', 'nsIIccInfo.idl',
'nsIIccProvider.idl', 'nsIIccProvider.idl',
] ]

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

@ -4,8 +4,8 @@
#include "nsISupports.idl" #include "nsISupports.idl"
[scriptable, uuid(dd9f229c-e5a6-453a-8388-950af0ff9918)] [scriptable, uuid(3ba11a90-34e0-11e4-8c21-0800200c9a66)]
interface nsIDOMMozIccInfo : nsISupports interface nsIIccInfo : nsISupports
{ {
/** /**
* Integrated Circuit Card Type. * Integrated Circuit Card Type.
@ -45,8 +45,8 @@ interface nsIDOMMozIccInfo : nsISupports
readonly attribute boolean isDisplaySpnRequired; readonly attribute boolean isDisplaySpnRequired;
}; };
[scriptable, uuid(3c237e39-7af3-4748-baf4-4a3b6c3e0e66)] [scriptable, uuid(6c9c78b0-34e0-11e4-8c21-0800200c9a66)]
interface nsIDOMMozGsmIccInfo : nsIDOMMozIccInfo interface nsIGsmIccInfo : nsIIccInfo
{ {
/** /**
* Mobile Station ISDN Number (MSISDN) of the subscriber, aka * Mobile Station ISDN Number (MSISDN) of the subscriber, aka
@ -55,8 +55,8 @@ interface nsIDOMMozGsmIccInfo : nsIDOMMozIccInfo
readonly attribute DOMString msisdn; readonly attribute DOMString msisdn;
}; };
[scriptable, uuid(7e937d09-4d1d-43c5-96d8-c91396022809)] [scriptable, uuid(7452f570-34e0-11e4-8c21-0800200c9a66)]
interface nsIDOMMozCdmaIccInfo : nsIDOMMozIccInfo interface nsICdmaIccInfo : nsIIccInfo
{ {
/** /**
* Mobile Directory Number (MDN) of the subscriber, aka his phone number. * Mobile Directory Number (MDN) of the subscriber, aka his phone number.

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

@ -5,8 +5,8 @@
#include "nsISupports.idl" #include "nsISupports.idl"
interface nsIDOMDOMRequest; interface nsIDOMDOMRequest;
interface nsIDOMMozIccInfo;
interface nsIDOMWindow; interface nsIDOMWindow;
interface nsIIccInfo;
[scriptable, uuid(7c0ada3d-d8d4-493e-9243-fa3df39855e4)] [scriptable, uuid(7c0ada3d-d8d4-493e-9243-fa3df39855e4)]
interface nsIIccListener : nsISupports interface nsIIccListener : nsISupports
@ -20,7 +20,7 @@ interface nsIIccListener : nsISupports
/** /**
* XPCOM component (in the content process) that provides the ICC information. * XPCOM component (in the content process) that provides the ICC information.
*/ */
[scriptable, uuid(7c67ab92-52a3-4e11-995c-c0ad2f66c4cb)] [scriptable, uuid(1afa72d0-3d70-11e4-916c-0800200c9a66)]
interface nsIIccProvider : nsISupports interface nsIIccProvider : nsISupports
{ {
/** /**
@ -34,7 +34,7 @@ interface nsIIccProvider : nsISupports
/** /**
* UICC Information * UICC Information
*/ */
nsIDOMMozIccInfo getIccInfo(in unsigned long clientId); nsIIccInfo getIccInfo(in unsigned long clientId);
/** /**
* Card State * Card State

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

@ -8,11 +8,13 @@ DIRS += ['interfaces']
EXPORTS.mozilla.dom += [ EXPORTS.mozilla.dom += [
'Icc.h', 'Icc.h',
'IccInfo.h',
'IccManager.h', 'IccManager.h',
] ]
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'Icc.cpp', 'Icc.cpp',
"IccInfo.cpp",
'IccListener.cpp', 'IccListener.cpp',
'IccManager.cpp', 'IccManager.cpp',
] ]

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

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

@ -35,7 +35,7 @@ taskHelper.push(function basicTest() {
// See it here {B2G_HOME}/external/qemu/telephony/sim_card.c#L299. // See it here {B2G_HOME}/external/qemu/telephony/sim_card.c#L299.
is(iccInfo.iccid, 89014103211118510720); is(iccInfo.iccid, 89014103211118510720);
if (iccInfo instanceof Ci.nsIDOMMozGsmIccInfo) { if (iccInfo instanceof MozGsmIccInfo) {
log("Test Gsm IccInfo"); log("Test Gsm IccInfo");
is(iccInfo.iccType, "sim"); is(iccInfo.iccType, "sim");
is(iccInfo.spn, "Android"); is(iccInfo.spn, "Android");

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

@ -339,10 +339,10 @@ MmsConnection.prototype = {
* Get phone number from iccInfo. * Get phone number from iccInfo.
* *
* If the icc card is gsm card, the phone number is in msisdn. * If the icc card is gsm card, the phone number is in msisdn.
* @see nsIDOMMozGsmIccInfo * @see nsIGsmIccInfo
* *
* Otherwise, the phone number is in mdn. * Otherwise, the phone number is in mdn.
* @see nsIDOMMozCdmaIccInfo * @see nsICdmaIccInfo
*/ */
getPhoneNumber: function() { getPhoneNumber: function() {
let number; let number;
@ -351,10 +351,10 @@ MmsConnection.prototype = {
let iccInfo = null; let iccInfo = null;
let baseIccInfo = this.radioInterface.rilContext.iccInfo; let baseIccInfo = this.radioInterface.rilContext.iccInfo;
if (baseIccInfo.iccType === 'ruim' || baseIccInfo.iccType === 'csim') { if (baseIccInfo.iccType === 'ruim' || baseIccInfo.iccType === 'csim') {
iccInfo = baseIccInfo.QueryInterface(Ci.nsIDOMMozCdmaIccInfo); iccInfo = baseIccInfo.QueryInterface(Ci.nsICdmaIccInfo);
number = iccInfo.mdn; number = iccInfo.mdn;
} else { } else {
iccInfo = baseIccInfo.QueryInterface(Ci.nsIDOMMozGsmIccInfo); iccInfo = baseIccInfo.QueryInterface(Ci.nsIGsmIccInfo);
number = iccInfo.msisdn; number = iccInfo.msisdn;
} }
} catch (e) { } catch (e) {

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

@ -34,7 +34,7 @@
#include "prtime.h" #include "prtime.h"
#ifdef MOZ_B2G_RIL #ifdef MOZ_B2G_RIL
#include "nsIDOMIccInfo.h" #include "nsIIccInfo.h"
#include "nsIMobileConnectionInfo.h" #include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h" #include "nsIMobileConnectionService.h"
#include "nsIMobileCellInfo.h" #include "nsIMobileCellInfo.h"
@ -459,10 +459,10 @@ GonkGPSGeolocationProvider::RequestSetID(uint32_t flags)
} }
if (flags & AGPS_RIL_REQUEST_SETID_MSISDN) { if (flags & AGPS_RIL_REQUEST_SETID_MSISDN) {
nsCOMPtr<nsIDOMMozIccInfo> iccInfo; nsCOMPtr<nsIIccInfo> iccInfo;
rilCtx->GetIccInfo(getter_AddRefs(iccInfo)); rilCtx->GetIccInfo(getter_AddRefs(iccInfo));
if (iccInfo) { if (iccInfo) {
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo); nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
if (gsmIccInfo) { if (gsmIccInfo) {
type = AGPS_SETID_TYPE_MSISDN; type = AGPS_SETID_TYPE_MSISDN;
gsmIccInfo->GetMsisdn(id); gsmIccInfo->GetMsisdn(id);
@ -494,7 +494,7 @@ GonkGPSGeolocationProvider::SetReferenceLocation()
location.type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID; location.type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID;
if (rilCtx) { if (rilCtx) {
nsCOMPtr<nsIDOMMozIccInfo> iccInfo; nsCOMPtr<nsIIccInfo> iccInfo;
rilCtx->GetIccInfo(getter_AddRefs(iccInfo)); rilCtx->GetIccInfo(getter_AddRefs(iccInfo));
if (iccInfo) { if (iccInfo) {
nsresult result; nsresult result;

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

@ -41,12 +41,6 @@ function debug(s) {
const RILCONTENTHELPER_CID = const RILCONTENTHELPER_CID =
Components.ID("{472816e1-1fd6-4405-996c-806f9ea68174}"); Components.ID("{472816e1-1fd6-4405-996c-806f9ea68174}");
const ICCINFO_CID =
Components.ID("{39d64d90-26a6-11e4-8c21-0800200c9a66}");
const GSMICCINFO_CID =
Components.ID("{e0fa785b-ad3f-46ed-bc56-fcb0d6fe4fa8}");
const CDMAICCINFO_CID =
Components.ID("{3d1f844f-9ec5-48fb-8907-aed2e5421709}");
const ICCCARDLOCKERROR_CID = const ICCCARDLOCKERROR_CID =
Components.ID("{08a71987-408c-44ff-93fd-177c0a85c3dd}"); Components.ID("{08a71987-408c-44ff-93fd-177c0a85c3dd}");
@ -108,16 +102,9 @@ MobileIccCardLockRetryCount.prototype = {
function IccInfo() {} function IccInfo() {}
IccInfo.prototype = { IccInfo.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozIccInfo]), QueryInterface: XPCOMUtils.generateQI([Ci.nsIIccInfo]),
classID: ICCINFO_CID,
classInfo: XPCOMUtils.generateCI({
classID: ICCINFO_CID,
classDescription: "MozIccInfo",
flags: Ci.nsIClassInfo.DOM_OBJECT,
interfaces: [Ci.nsIDOMMozIccInfo]
}),
// nsIDOMMozIccInfo // nsIIccInfo
iccType: null, iccType: null,
iccid: null, iccid: null,
@ -130,34 +117,20 @@ IccInfo.prototype = {
function GsmIccInfo() {} function GsmIccInfo() {}
GsmIccInfo.prototype = { GsmIccInfo.prototype = {
__proto__: IccInfo.prototype, QueryInterface: XPCOMUtils.generateQI([Ci.nsIGsmIccInfo,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozGsmIccInfo]), Ci.nsIIccInfo]),
classID: GSMICCINFO_CID,
classInfo: XPCOMUtils.generateCI({
classID: GSMICCINFO_CID,
classDescription: "MozGsmIccInfo",
flags: Ci.nsIClassInfo.DOM_OBJECT,
interfaces: [Ci.nsIDOMMozGsmIccInfo]
}),
// nsIDOMMozGsmIccInfo // nsIGsmIccInfo
msisdn: null msisdn: null
}; };
function CdmaIccInfo() {} function CdmaIccInfo() {}
CdmaIccInfo.prototype = { CdmaIccInfo.prototype = {
__proto__: IccInfo.prototype, QueryInterface: XPCOMUtils.generateQI([Ci.nsICdmaIccInfo,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozCdmaIccInfo]), Ci.nsIIccInfo]),
classID: CDMAICCINFO_CID,
classInfo: XPCOMUtils.generateCI({
classID: CDMAICCINFO_CID,
classDescription: "MozCdmaIccInfo",
flags: Ci.nsIClassInfo.DOM_OBJECT,
interfaces: [Ci.nsIDOMMozCdmaIccInfo]
}),
// nsIDOMMozCdmaIccInfo // nsICdmaIccInfo
mdn: null, mdn: null,
prlVersion: 0 prlVersion: 0

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

@ -53,12 +53,6 @@ const RADIOINTERFACE_CID =
Components.ID("{6a7c91f0-a2b3-4193-8562-8969296c0b54}"); Components.ID("{6a7c91f0-a2b3-4193-8562-8969296c0b54}");
const RILNETWORKINTERFACE_CID = const RILNETWORKINTERFACE_CID =
Components.ID("{3bdd52a9-3965-4130-b569-0ac5afed045e}"); Components.ID("{3bdd52a9-3965-4130-b569-0ac5afed045e}");
const ICCINFO_CID =
Components.ID("{52eec7f0-26a4-11e4-8c21-0800200c9a66}");
const GSMICCINFO_CID =
Components.ID("{d90c4261-a99d-47bc-8b05-b057bb7e8f8a}");
const CDMAICCINFO_CID =
Components.ID("{39ba3c08-aacc-46d0-8c04-9b619c387061}");
const NEIGHBORINGCELLINFO_CID = const NEIGHBORINGCELLINFO_CID =
Components.ID("{f9dfe26a-851e-4a8b-a769-cbb1baae7ded}"); Components.ID("{f9dfe26a-851e-4a8b-a769-cbb1baae7ded}");
const GSMCELLINFO_CID = const GSMCELLINFO_CID =
@ -941,16 +935,9 @@ try {
function IccInfo() {} function IccInfo() {}
IccInfo.prototype = { IccInfo.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozIccInfo]), QueryInterface: XPCOMUtils.generateQI([Ci.nsIIccInfo]),
classID: ICCINFO_CID,
classInfo: XPCOMUtils.generateCI({
classID: ICCINFO_CID,
classDescription: "MozIccInfo",
flags: Ci.nsIClassInfo.DOM_OBJECT,
interfaces: [Ci.nsIDOMMozIccInfo]
}),
// nsIDOMMozIccInfo // nsIIccInfo
iccType: null, iccType: null,
iccid: null, iccid: null,
@ -964,16 +951,10 @@ IccInfo.prototype = {
function GsmIccInfo() {} function GsmIccInfo() {}
GsmIccInfo.prototype = { GsmIccInfo.prototype = {
__proto__: IccInfo.prototype, __proto__: IccInfo.prototype,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozGsmIccInfo]), QueryInterface: XPCOMUtils.generateQI([Ci.nsIGsmIccInfo,
classID: GSMICCINFO_CID, Ci.nsIIccInfo]),
classInfo: XPCOMUtils.generateCI({
classID: GSMICCINFO_CID,
classDescription: "MozGsmIccInfo",
flags: Ci.nsIClassInfo.DOM_OBJECT,
interfaces: [Ci.nsIDOMMozGsmIccInfo]
}),
// nsIDOMMozGsmIccInfo // nsIGsmIccInfo
msisdn: null msisdn: null
}; };
@ -981,16 +962,10 @@ GsmIccInfo.prototype = {
function CdmaIccInfo() {} function CdmaIccInfo() {}
CdmaIccInfo.prototype = { CdmaIccInfo.prototype = {
__proto__: IccInfo.prototype, __proto__: IccInfo.prototype,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozCdmaIccInfo]), QueryInterface: XPCOMUtils.generateQI([Ci.nsICdmaIccInfo,
classID: CDMAICCINFO_CID, Ci.nsIIccInfo]),
classInfo: XPCOMUtils.generateCI({
classID: CDMAICCINFO_CID,
classDescription: "MozCdmaIccInfo",
flags: Ci.nsIClassInfo.DOM_OBJECT,
interfaces: [Ci.nsIDOMMozCdmaIccInfo]
}),
// nsIDOMMozCdmaIccInfo // nsICdmaIccInfo
mdn: null, mdn: null,
prlVersion: 0 prlVersion: 0
@ -2141,10 +2116,10 @@ RadioInterface.prototype = {
* Get phone number from iccInfo. * Get phone number from iccInfo.
* *
* If the icc card is gsm card, the phone number is in msisdn. * If the icc card is gsm card, the phone number is in msisdn.
* @see nsIDOMMozGsmIccInfo * @see nsIGsmIccInfo
* *
* Otherwise, the phone number is in mdn. * Otherwise, the phone number is in mdn.
* @see nsIDOMMozCdmaIccInfo * @see nsICdmaIccInfo
*/ */
getPhoneNumber: function() { getPhoneNumber: function() {
let iccInfo = this.rilContext.iccInfo; let iccInfo = this.rilContext.iccInfo;
@ -2154,7 +2129,7 @@ RadioInterface.prototype = {
} }
// After moving SMS code out of RadioInterfaceLayer, we could use // After moving SMS code out of RadioInterfaceLayer, we could use
// |iccInfo instanceof Ci.nsIDOMMozGsmIccInfo| here. // |iccInfo instanceof Ci.nsIGsmIccInfo| here.
// TODO: Bug 873351 - B2G SMS: move SMS code out of RadioInterfaceLayer to // TODO: Bug 873351 - B2G SMS: move SMS code out of RadioInterfaceLayer to
// SmsService // SmsService
let number = (iccInfo instanceof GsmIccInfo) ? iccInfo.msisdn : iccInfo.mdn; let number = (iccInfo instanceof GsmIccInfo) ? iccInfo.msisdn : iccInfo.mdn;

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

@ -5,11 +5,11 @@
#include "nsISupports.idl" #include "nsISupports.idl"
#include "nsINetworkManager.idl" #include "nsINetworkManager.idl"
interface nsIDOMMozIccInfo; interface nsICellInfoListCallback;
interface nsIIccInfo;
interface nsIMobileConnectionInfo; interface nsIMobileConnectionInfo;
interface nsIMobileMessageCallback; interface nsIMobileMessageCallback;
interface nsINeighboringCellIdsCallback; interface nsINeighboringCellIdsCallback;
interface nsICellInfoListCallback;
[scriptable, uuid(6e0f45b8-410e-11e3-8c8e-b715b2cd0128)] [scriptable, uuid(6e0f45b8-410e-11e3-8c8e-b715b2cd0128)]
interface nsIRilNetworkInterface : nsINetworkInterface interface nsIRilNetworkInterface : nsINetworkInterface
@ -23,14 +23,14 @@ interface nsIRilNetworkInterface : nsINetworkInterface
readonly attribute long mmsPort; // -1 if not set. readonly attribute long mmsPort; // -1 if not set.
}; };
[scriptable, uuid(0226a2c1-a3b9-416a-92cb-c89e4dad4be0)] [scriptable, uuid(08a69c70-34b1-11e4-8c21-0800200c9a66)]
interface nsIRilContext : nsISupports interface nsIRilContext : nsISupports
{ {
readonly attribute DOMString cardState; readonly attribute DOMString cardState;
readonly attribute DOMString imsi; readonly attribute DOMString imsi;
readonly attribute nsIDOMMozIccInfo iccInfo; readonly attribute nsIIccInfo iccInfo;
}; };
[scriptable, function, uuid(3bc96351-53b0-47a1-a888-c74c64b60f25)] [scriptable, function, uuid(3bc96351-53b0-47a1-a888-c74c64b60f25)]

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

@ -2725,6 +2725,13 @@ RilObject.prototype = {
queryCallBarringStatus: function(options) { queryCallBarringStatus: function(options) {
options.facility = CALL_BARRING_PROGRAM_TO_FACILITY[options.program]; options.facility = CALL_BARRING_PROGRAM_TO_FACILITY[options.program];
options.password = ""; // For query no need to provide it. options.password = ""; // For query no need to provide it.
// For some operators, querying specific serviceClass doesn't work. We use
// serviceClass 0 instead, and then process the response to extract the
// answer for queryServiceClass.
options.queryServiceClass = options.serviceClass;
options.serviceClass = 0;
this.queryICCFacilityLock(options); this.queryICCFacilityLock(options);
}, },
@ -5930,20 +5937,23 @@ RilObject.prototype[REQUEST_QUERY_FACILITY_LOCK] = function REQUEST_QUERY_FACILI
return; return;
} }
let services; if (!length) {
if (length) {
// Buf.readInt32List()[0] for Call Barring is a bit vector of services.
services = this.context.Buf.readInt32List()[0];
} else {
options.success = false; options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE; options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options); this.sendChromeMessage(options);
return; return;
} }
options.enabled = services === 0 ? false : true; // Buf.readInt32List()[0] for Call Barring is a bit vector of services.
let services = this.context.Buf.readInt32List()[0];
if (options.success && (options.rilMessageType === "sendMMI")) { if (options.queryServiceClass) {
options.enabled = (services & options.queryServiceClass) ? true : false;
} else {
options.enabled = services ? true : false;
}
if (options.rilMessageType === "sendMMI") {
if (!options.enabled) { if (!options.enabled) {
options.statusMessage = MMI_SM_KS_SERVICE_DISABLED; options.statusMessage = MMI_SM_KS_SERVICE_DISABLED;
} else { } else {

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

@ -700,16 +700,22 @@ var interfaceNamesInGlobalScope =
"MozCSSKeyframeRule", "MozCSSKeyframeRule",
// IMPORTANT: Do not change this list without review from a DOM peer! // IMPORTANT: Do not change this list without review from a DOM peer!
"MozCSSKeyframesRule", "MozCSSKeyframesRule",
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozCdmaIccInfo", b2g: true, pref: "dom.icc.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer! // IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozEmergencyCbModeEvent", b2g: true, pref: "dom.mobileconnection.enabled"}, {name: "MozEmergencyCbModeEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer! // IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozIcc", b2g: true, pref: "dom.icc.enabled"}, {name: "MozIcc", b2g: true, pref: "dom.icc.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozIccInfo", b2g: true, pref: "dom.icc.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer! // IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozIccManager", b2g: true, pref: "dom.icc.enabled"}, {name: "MozIccManager", b2g: true, pref: "dom.icc.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer! // IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozInputContext", b2g: true}, {name: "MozInputContext", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer! // IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozInputMethodManager", b2g: true}, {name: "MozInputMethodManager", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozGsmIccInfo", b2g: true, pref: "dom.icc.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer! // IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozMessageDeletedEvent", b2g: true, pref: "dom.sms.enabled"}, {name: "MozMessageDeletedEvent", b2g: true, pref: "dom.sms.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer! // IMPORTANT: Do not change this list without review from a DOM peer!

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

@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * 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/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
interface MozIccInfo;
[Pref="dom.icc.enabled"] [Pref="dom.icc.enabled"]
interface MozIcc : EventTarget interface MozIcc : EventTarget
{ {
@ -16,7 +14,7 @@ interface MozIcc : EventTarget
* Also, the attribute is set to null and this MozIcc object becomes invalid. * Also, the attribute is set to null and this MozIcc object becomes invalid.
* Calling asynchronous functions raises exception then. * Calling asynchronous functions raises exception then.
*/ */
readonly attribute MozIccInfo? iccInfo; readonly attribute (MozIccInfo or MozGsmIccInfo or MozCdmaIccInfo)? iccInfo;
/** /**
* The 'iccinfochange' event is notified whenever the icc info object * The 'iccinfochange' event is notified whenever the icc info object

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

@ -0,0 +1,65 @@
/* 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/. */
enum IccType {"sim", "usim", "csim", "ruim"};
[Pref="dom.icc.enabled"]
interface MozIccInfo {
/**
* Integrated Circuit Card Type.
*/
readonly attribute IccType? iccType;
/**
* Integrated Circuit Card Identifier.
*/
readonly attribute DOMString? iccid;
/**
* Mobile Country Code (MCC) of the subscriber's home network.
*/
readonly attribute DOMString? mcc;
/**
* Mobile Network Code (MNC) of the subscriber's home network.
*/
readonly attribute DOMString? mnc;
/**
* Service Provider Name (SPN) of the subscriber's home network.
*/
readonly attribute DOMString? spn;
/**
* Network name must be a part of displayed carrier name.
*/
readonly attribute boolean isDisplayNetworkNameRequired;
/**
* Service provider name must be a part of displayed carrier name.
*/
readonly attribute boolean isDisplaySpnRequired;
};
[Pref="dom.icc.enabled"]
interface MozGsmIccInfo : MozIccInfo {
/**
* Mobile Station ISDN Number (MSISDN) of the subscriber, aka
* his phone number.
*/
readonly attribute DOMString? msisdn;
};
[Pref="dom.icc.enabled"]
interface MozCdmaIccInfo : MozIccInfo {
/**
* Mobile Directory Number (MDN) of the subscriber, aka his phone number.
*/
readonly attribute DOMString? mdn;
/**
* Preferred Roaming List (PRL) version of the subscriber.
*/
readonly attribute long prlVersion;
};

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

@ -616,6 +616,7 @@ if CONFIG['MOZ_B2G_RIL']:
WEBIDL_FILES += [ WEBIDL_FILES += [
'IccCardLockError.webidl', 'IccCardLockError.webidl',
'MozIcc.webidl', 'MozIcc.webidl',
'MozIccInfo.webidl',
'MozIccManager.webidl', 'MozIccManager.webidl',
] ]

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

@ -49,6 +49,7 @@ RTSPSource::RTSPSource(
mFinalResult(OK), mFinalResult(OK),
mDisconnectReplyID(0), mDisconnectReplyID(0),
mLatestPausedUnit(0), mLatestPausedUnit(0),
mPlayPending(false),
mSeekGeneration(0) mSeekGeneration(0)
{ {
@ -213,11 +214,19 @@ void RTSPSource::performPlay(int64_t playTimeUs) {
start(); start();
return; return;
} }
if (mState != CONNECTED && mState != PAUSING) { // If state is PAUSING, which means a previous PAUSE request is still being
// processed, put off the PLAY request until PausedDone.
if (mState == PAUSING) {
mPlayPending = true;
return; return;
} }
if (mState == PAUSING) { // Reject invalid state transition.
playTimeUs = mLatestPausedUnit; if (mState != CONNECTED && mState != PAUSED) {
return;
}
// Use the latest received frame time if we were paused.
if (mState == PAUSED) {
playTimeUs = mLatestPausedUnit;
} }
int64_t duration = 0; int64_t duration = 0;
@ -225,7 +234,7 @@ void RTSPSource::performPlay(int64_t playTimeUs) {
MOZ_ASSERT(playTimeUs < duration, MOZ_ASSERT(playTimeUs < duration,
"Should never receive an out of bounds play time!"); "Should never receive an out of bounds play time!");
if (playTimeUs >= duration) { if (playTimeUs >= duration) {
return; return;
} }
LOGI("performPlay : duration=%lld playTimeUs=%lld", duration, playTimeUs); LOGI("performPlay : duration=%lld playTimeUs=%lld", duration, playTimeUs);
@ -234,13 +243,14 @@ void RTSPSource::performPlay(int64_t playTimeUs) {
} }
void RTSPSource::performPause() { void RTSPSource::performPause() {
// Reject invalid state transition.
if (mState != PLAYING) { if (mState != PLAYING) {
return; return;
} }
LOGI("performPause :"); LOGI("performPause :");
for (size_t i = 0; i < mTracks.size(); ++i) { for (size_t i = 0; i < mTracks.size(); ++i) {
TrackInfo *info = &mTracks.editItemAt(i); TrackInfo *info = &mTracks.editItemAt(i);
info->mLatestPausedUnit = 0; info->mLatestPausedUnit = 0;
} }
mLatestPausedUnit = 0; mLatestPausedUnit = 0;
@ -257,16 +267,17 @@ void RTSPSource::performSuspend() {
} }
void RTSPSource::performPlaybackEnded() { void RTSPSource::performPlaybackEnded() {
// Transition from PLAYING to CONNECTED state so that we are ready to // Reject invalid state transition.
// perform an another play operation.
if (mState != PLAYING) { if (mState != PLAYING) {
return; return;
} }
// Transition from PLAYING to CONNECTED state so that we are ready to
// perform an another play operation.
mState = CONNECTED; mState = CONNECTED;
} }
void RTSPSource::performSeek(int64_t seekTimeUs) { void RTSPSource::performSeek(int64_t seekTimeUs) {
if (mState != CONNECTED && mState != PLAYING && mState != PAUSING) { if (mState != CONNECTED && mState != PLAYING && mState != PAUSED) {
return; return;
} }
@ -275,12 +286,12 @@ void RTSPSource::performSeek(int64_t seekTimeUs) {
MOZ_ASSERT(seekTimeUs < duration, MOZ_ASSERT(seekTimeUs < duration,
"Should never receive an out of bounds seek time!"); "Should never receive an out of bounds seek time!");
if (seekTimeUs >= duration) { if (seekTimeUs >= duration) {
return; return;
} }
for (size_t i = 0; i < mTracks.size(); ++i) { for (size_t i = 0; i < mTracks.size(); ++i) {
TrackInfo *info = &mTracks.editItemAt(i); TrackInfo *info = &mTracks.editItemAt(i);
info->mLatestPausedUnit = 0; info->mLatestPausedUnit = 0;
} }
mLatestPausedUnit = 0; mLatestPausedUnit = 0;
@ -366,6 +377,12 @@ void RTSPSource::onMessageReceived(const sp<AMessage> &msg) {
case RtspConnectionHandler::kWhatPausedDone: case RtspConnectionHandler::kWhatPausedDone:
{ {
// Reject invalid state transition.
if (mState != PAUSING) {
return;
}
mState = PAUSED;
for (size_t i = 0; i < mTracks.size(); ++i) { for (size_t i = 0; i < mTracks.size(); ++i) {
TrackInfo *info = &mTracks.editItemAt(i); TrackInfo *info = &mTracks.editItemAt(i);
info->mLatestPausedUnit = info->mLatestReceivedUnit; info->mLatestPausedUnit = info->mLatestReceivedUnit;
@ -381,6 +398,11 @@ void RTSPSource::onMessageReceived(const sp<AMessage> &msg) {
mLatestPausedUnit = info->mLatestReceivedUnit; mLatestPausedUnit = info->mLatestReceivedUnit;
} }
} }
if (mPlayPending) {
mPlayPending = false;
performPlay(mLatestPausedUnit);
}
break; break;
} }
@ -431,7 +453,7 @@ void RTSPSource::onMessageReceived(const sp<AMessage> &msg) {
info->mLatestReceivedUnit = nptUs; info->mLatestReceivedUnit = nptUs;
// Drop the frames that are older than the frames in the queue. // Drop the frames that are older than the frames in the queue.
if (info->mLatestPausedUnit && (int64_t)info->mLatestPausedUnit > nptUs) { if (info->mLatestPausedUnit && (int64_t)info->mLatestPausedUnit > nptUs) {
break; break;
} }
source->queueAccessUnit(accessUnit); source->queueAccessUnit(accessUnit);
} }
@ -576,17 +598,17 @@ void RTSPSource::onConnected(bool isSeekable)
meta->SetDuration(int64Value); meta->SetDuration(int64Value);
if (isAudio) { if (isAudio) {
CHECK(format->findInt32(kKeyChannelCount, &int32Value)); CHECK(format->findInt32(kKeyChannelCount, &int32Value));
meta->SetChannelCount(int32Value); meta->SetChannelCount(int32Value);
CHECK(format->findInt32(kKeySampleRate, &int32Value)); CHECK(format->findInt32(kKeySampleRate, &int32Value));
meta->SetSampleRate(int32Value); meta->SetSampleRate(int32Value);
} else { } else {
CHECK(format->findInt32(kKeyWidth, &int32Value)); CHECK(format->findInt32(kKeyWidth, &int32Value));
meta->SetWidth(int32Value); meta->SetWidth(int32Value);
CHECK(format->findInt32(kKeyHeight, &int32Value)); CHECK(format->findInt32(kKeyHeight, &int32Value));
meta->SetHeight(int32Value); meta->SetHeight(int32Value);
} }
// Optional meta data. // Optional meta data.
@ -595,15 +617,15 @@ void RTSPSource::onConnected(bool isSeekable)
size_t length = 0; size_t length = 0;
if (format->findData(kKeyESDS, &type, &data, &length)) { if (format->findData(kKeyESDS, &type, &data, &length)) {
nsCString esds; nsCString esds;
esds.Assign((const char *)data, length); esds.Assign((const char *)data, length);
meta->SetEsdsData(esds); meta->SetEsdsData(esds);
} }
if (format->findData(kKeyAVCC, &type, &data, &length)) { if (format->findData(kKeyAVCC, &type, &data, &length)) {
nsCString avcc; nsCString avcc;
avcc.Assign((const char *)data, length); avcc.Assign((const char *)data, length);
meta->SetAvccData(avcc); meta->SetAvccData(avcc);
} }
mListener->OnConnected(i, meta.get()); mListener->OnConnected(i, meta.get());

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

@ -89,6 +89,7 @@ private:
CONNECTED, CONNECTED,
SEEKING, SEEKING,
PAUSING, PAUSING,
PAUSED,
PLAYING, PLAYING,
}; };
@ -117,6 +118,7 @@ private:
status_t mFinalResult; status_t mFinalResult;
uint32_t mDisconnectReplyID; uint32_t mDisconnectReplyID;
uint64_t mLatestPausedUnit; uint64_t mLatestPausedUnit;
bool mPlayPending;
sp<ALooper> mLooper; sp<ALooper> mLooper;
sp<AHandlerReflector<RTSPSource> > mReflector; sp<AHandlerReflector<RTSPSource> > mReflector;

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

@ -280,8 +280,7 @@ this.MobileIdentityManager = {
.then( .then(
(creds) => { (creds) => {
if (creds) { if (creds) {
this.iccInfo[aServiceId].credentials = creds; return creds;
return;
} }
return this.credStore.getByMsisdn(this.iccInfo[aServiceId].msisdn); return this.credStore.getByMsisdn(this.iccInfo[aServiceId].msisdn);
} }
@ -306,10 +305,12 @@ this.MobileIdentityManager = {
) )
.then( .then(
(result) => { (result) => {
log.debug("Discover result ${}", result); // If we already have credentials for this ICC and no discover request
// is done, we just bail out.
if (!result || !result.verificationMethods) { if (!result || !result.verificationMethods) {
return; return;
} }
log.debug("Discover result ${}", result);
this.iccInfo[aServiceId].verificationMethods = result.verificationMethods; this.iccInfo[aServiceId].verificationMethods = result.verificationMethods;
this.iccInfo[aServiceId].verificationDetails = result.verificationDetails; this.iccInfo[aServiceId].verificationDetails = result.verificationDetails;
this.iccInfo[aServiceId].canDoSilentVerification = this.iccInfo[aServiceId].canDoSilentVerification =
@ -675,14 +676,16 @@ this.MobileIdentityManager = {
let mcc; let mcc;
// If the user selected one of the existing SIM cards we have to check // If the user selected one of the existing SIM cards we have to check
// that we either have the MSISDN for that SIM or we can do a silent // that we either have the MSISDN for that SIM, we have already existing
// verification that does not require us to have the MSISDN in advance. // credentials or we can do a silent verification that does not require
// us to have the MSISDN in advance.
// result.serviceId can be "0". // result.serviceId can be "0".
if (result.serviceId !== undefined && if (result.serviceId !== undefined &&
result.serviceId !== null) { result.serviceId !== null) {
let icc = this.iccInfo[result.serviceId]; let icc = this.iccInfo[result.serviceId];
log.debug("icc ${}", icc); log.debug("icc ${}", icc);
if (!icc || !icc.msisdn && !icc.canDoSilentVerification) { if (!icc || !icc.msisdn && !icc.canDoSilentVerification &&
!icc.credentials) {
return Promise.reject(ERROR_INTERNAL_CANNOT_VERIFY_SELECTION); return Promise.reject(ERROR_INTERNAL_CANNOT_VERIFY_SELECTION);
} }
msisdn = icc.msisdn; msisdn = icc.msisdn;
@ -972,7 +975,12 @@ this.MobileIdentityManager = {
// before generating and sharing the assertion. // before generating and sharing the assertion.
// If we've just prompted the user in the previous step, the permission // If we've just prompted the user in the previous step, the permission
// is already granted and stored so we just progress the credentials. // is already granted and stored so we just progress the credentials.
// But we have to refresh the cached permission before checking.
if (creds) { if (creds) {
permission = permissionManager.testPermissionFromPrincipal(
principal,
MOBILEID_PERM
);
if (permission == Ci.nsIPermissionManager.ALLOW_ACTION) { if (permission == Ci.nsIPermissionManager.ALLOW_ACTION) {
return creds; return creds;
} }

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

@ -457,7 +457,7 @@ add_test(function() {
credStore._("add").call(1).arg(2, PHONE_NUMBER); credStore._("add").call(1).arg(2, PHONE_NUMBER);
credStore._("add").call(1).arg(3, ORIGIN); credStore._("add").call(1).arg(3, ORIGIN);
credStore._("add").call(1).arg(4, SESSION_TOKEN); credStore._("add").call(1).arg(4, SESSION_TOKEN);
credStore._("add").call(1).arg(5, null); credStore._("add").call(1).arg(5, []);
// MockUI. // MockUI.
@ -960,10 +960,10 @@ add_test(function() {
credStore._("add").call(1).arg(2, PHONE_NUMBER); credStore._("add").call(1).arg(2, PHONE_NUMBER);
credStore._("add").call(1).arg(3, ORIGIN); credStore._("add").call(1).arg(3, ORIGIN);
credStore._("add").call(1).arg(4, SESSION_TOKEN); credStore._("add").call(1).arg(4, SESSION_TOKEN);
credStore._("add").call(1).arg(5, null); credStore._("add").call(1).arg(5, []);
credStore._("setDeviceIccIds").callsLength(1); credStore._("setDeviceIccIds").callsLength(1);
credStore._("setDeviceIccIds").call(1).arg(1, PHONE_NUMBER); credStore._("setDeviceIccIds").call(1).arg(1, PHONE_NUMBER);
credStore._("setDeviceIccIds").call(1).arg(2, null); credStore._("setDeviceIccIds").call(1).arg(2, []);
// MockUI. // MockUI.
ui._("startFlow").callsLength(1); ui._("startFlow").callsLength(1);
@ -1054,7 +1054,7 @@ add_test(function() {
credStore._("add").call(1).arg(2, ANOTHER_PHONE_NUMBER); credStore._("add").call(1).arg(2, ANOTHER_PHONE_NUMBER);
credStore._("add").call(1).arg(3, ORIGIN); credStore._("add").call(1).arg(3, ORIGIN);
credStore._("add").call(1).arg(4, _sessionToken); credStore._("add").call(1).arg(4, _sessionToken);
credStore._("add").call(1).arg(5, null); credStore._("add").call(1).arg(5, []);
credStore._("setDeviceIccIds").callsLength(0); credStore._("setDeviceIccIds").callsLength(0);
credStore._("removeOrigin").callsLength(1); credStore._("removeOrigin").callsLength(1);
credStore._("removeOrigin").call(1).arg(1, PHONE_NUMBER); credStore._("removeOrigin").call(1).arg(1, PHONE_NUMBER);
@ -1139,7 +1139,7 @@ add_test(function() {
credStore._("add").call(1).arg(2, PHONE_NUMBER); credStore._("add").call(1).arg(2, PHONE_NUMBER);
credStore._("add").call(1).arg(3, ORIGIN); credStore._("add").call(1).arg(3, ORIGIN);
credStore._("add").call(1).arg(4, _sessionToken); credStore._("add").call(1).arg(4, _sessionToken);
credStore._("add").call(1).arg(5, null); credStore._("add").call(1).arg(5, []);
credStore._("setDeviceIccIds").callsLength(1); credStore._("setDeviceIccIds").callsLength(1);
credStore._("removeOrigin").callsLength(0); credStore._("removeOrigin").callsLength(0);
@ -1229,7 +1229,7 @@ add_test(function() {
credStore._("add").call(1).arg(2, ANOTHER_PHONE_NUMBER); credStore._("add").call(1).arg(2, ANOTHER_PHONE_NUMBER);
credStore._("add").call(1).arg(3, ORIGIN); credStore._("add").call(1).arg(3, ORIGIN);
credStore._("add").call(1).arg(4, _sessionToken); credStore._("add").call(1).arg(4, _sessionToken);
credStore._("add").call(1).arg(5, null); credStore._("add").call(1).arg(5, []);
credStore._("setDeviceIccIds").callsLength(0); credStore._("setDeviceIccIds").callsLength(0);
credStore._("removeOrigin").callsLength(1); credStore._("removeOrigin").callsLength(1);
credStore._("removeOrigin").call(1).arg(1, PHONE_NUMBER); credStore._("removeOrigin").call(1).arg(1, PHONE_NUMBER);
@ -1278,7 +1278,7 @@ add_test(function() {
sessionToken: _sessionToken, sessionToken: _sessionToken,
msisdn: PHONE_NUMBER, msisdn: PHONE_NUMBER,
origin: ORIGIN, origin: ORIGIN,
deviceIccIds: null deviceIccIds: []
}; };
let ui = new MockUi({ let ui = new MockUi({
@ -1323,7 +1323,7 @@ add_test(function() {
credStore._("add").call(1).arg(2, PHONE_NUMBER); credStore._("add").call(1).arg(2, PHONE_NUMBER);
credStore._("add").call(1).arg(3, ORIGIN); credStore._("add").call(1).arg(3, ORIGIN);
credStore._("add").call(1).arg(4, SESSION_TOKEN); credStore._("add").call(1).arg(4, SESSION_TOKEN);
credStore._("add").call(1).arg(5, null); credStore._("add").call(1).arg(5, []);
credStore._("setDeviceIccIds").callsLength(0); credStore._("setDeviceIccIds").callsLength(0);
credStore._("delete").callsLength(1); credStore._("delete").callsLength(1);
credStore._("delete").call(1).arg(1, PHONE_NUMBER); credStore._("delete").call(1).arg(1, PHONE_NUMBER);
@ -1383,12 +1383,8 @@ add_test(function() {
MobileIdentityManager._mobileConnectionService = { MobileIdentityManager._mobileConnectionService = {
_interfaces: [RADIO_INTERFACE, ANOTHER_RADIO_INTERFACE], _interfaces: [RADIO_INTERFACE, ANOTHER_RADIO_INTERFACE],
getVoiceConnectionInfo: function(aIndex) { getItemByServiceId: function(aIndex) {
return this._interfaces[aIndex].voice; return this._interfaces[aIndex];
},
getDataConnectionInfo: function(aIndex) {
return this._interfaces[aIndex].data;
} }
}; };

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

@ -162,7 +162,7 @@ endif
ifeq ($(MOZ_PKG_FORMAT),ZIP) ifeq ($(MOZ_PKG_FORMAT),ZIP)
ifdef MOZ_EXTERNAL_SIGNING_FORMAT ifdef MOZ_EXTERNAL_SIGNING_FORMAT
# We can't use signcode on zip files # We can't use signcode on zip files
MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT)) MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out osslsigncode signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT))
endif endif
PKG_SUFFIX = .zip PKG_SUFFIX = .zip
INNER_MAKE_PACKAGE = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_DIR) \ INNER_MAKE_PACKAGE = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_DIR) \

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

@ -47,7 +47,7 @@ include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
ifdef MOZ_EXTERNAL_SIGNING_FORMAT ifdef MOZ_EXTERNAL_SIGNING_FORMAT
# We can't use signcode on mar files # We can't use signcode on mar files
MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT)) MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out osslsigncode signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT))
MOZ_EXTERNAL_SIGNING_FORMAT := mar $(MOZ_EXTERNAL_SIGNING_FORMAT) MOZ_EXTERNAL_SIGNING_FORMAT := mar $(MOZ_EXTERNAL_SIGNING_FORMAT)
endif endif