summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Kukkonen <ext-juha.kukkonen@nokia.com>2012-04-03 09:35:23 +0300
committerJuha Kukkonen <ext-juha.kukkonen@nokia.com>2012-04-03 12:33:59 +0300
commit264e16c922f99d14bc55c967380ea94f8e78d131 (patch)
treef7d7f9f3eeac59b767ac62a277ecbf46f5198214
parentb66cc3549b4c2cc13fce059367ff0b99650ee9d1 (diff)
Revert SystemInfo singleton related changes on Symbian.
SystemInfo singleton change has TLS issues that cause application crashes, e.g. it's not possible to open .ppt files (ou1cimx1#992201). This commit reverts following 6 commits due to regression they caused: Revert "DeviceInfo Singleton#RMobilePhone implementation#alignedtimer testfailure" This reverts commit 869226220dc1caefb9b407138090ff8bb92d6abd. Revert "Symbian:Added multi-threading testcases" This reverts commit 5a4b62beae06e7f854c2eeeab568fcaa2db7c286. Revert "Testcode:Copyright and styling issues fixed" This reverts commit cc787230aefe8a3decc0b11888ca176f15998d5c. Revert "Handling errors for apps with no caps" This reverts commit 388a98b5de3021c75e8bd5a1fed573eb3d4becd2. Revert "Fix for Pixi SharePoint DocApp word crash" This reverts commit b8b175f4d51b2c4698885a41a5fe98ffab7e25f2. Revert "Styling issues:Removing white-spaces" This reverts commit 84eaa30a294b3bdd101c664a2426b160b68ff118. Reviewed-by: Pasi Pentikainen
-rw-r--r--src/systeminfo/qsystemalignedtimer_symbian.cpp3
-rw-r--r--src/systeminfo/qsystemdeviceinfo.cpp26
-rw-r--r--src/systeminfo/qsysteminfo_s60.cpp253
-rw-r--r--src/systeminfo/qsysteminfo_s60_p.h210
-rw-r--r--src/systeminfo/qsystemnetworkinfo.cpp21
-rw-r--r--src/systeminfo/qsystemstorageinfo.cpp12
-rw-r--r--src/systeminfo/symbian/storagedisknotifier_s60.cpp3
-rw-r--r--src/systeminfo/symbian/storagestatus_s60.cpp9
-rw-r--r--src/systeminfo/symbian/telephonyinfo_s60.cpp1139
-rw-r--r--src/systeminfo/symbian/telephonyinfo_s60.h207
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/threadtests.pro6
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_CreateDifferentInfosInDifferentThreads/tst_CreateDifferentInfosInDifferentThreads.cpp82
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_CreateDifferentInfosInDifferentThreads/tst_CreateDifferentInfosInDifferentThreads.pro14
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_CreateInfoOutsideMainThread/tst_CreateInfoOutsideMainThread.cpp172
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_CreateInfoOutsideMainThread/tst_CreateInfoOutsideMainThread.pro14
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_CreateSameInfosInDifferentThreads/tst_CreateSameInfosInDifferentThreads.cpp92
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_CreateSameInfosInDifferentThreads/tst_CreateSameInfosInDifferentThreads.pro14
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_MoveInfosToDifferentThreads/tst_MoveInfosToDifferentThreads.cpp121
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_MoveInfosToDifferentThreads/tst_MoveInfosToDifferentThreads.pro14
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_RecreateInfosInDifferentThreads/tst_RecreateInfosInDifferentThreads.cpp89
-rw-r--r--src/systeminfo/symbian/tsrc/threadtests/tst_RecreateInfosInDifferentThreads/tst_RecreateInfosInDifferentThreads.pro16
21 files changed, 328 insertions, 2189 deletions
diff --git a/src/systeminfo/qsystemalignedtimer_symbian.cpp b/src/systeminfo/qsystemalignedtimer_symbian.cpp
index f77161abce..12bbf57cdf 100644
--- a/src/systeminfo/qsystemalignedtimer_symbian.cpp
+++ b/src/systeminfo/qsystemalignedtimer_symbian.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -120,7 +120,6 @@ void QSystemAlignedTimerPrivate::singleShot(int minimumTime, int maximumTime, QO
TRACES(qDebug() << "QSystemAlignedTimerPrivate::singleShot--Issuing request,Wait for SingleShot() callback");
alignedTimer->m_singleShotReceiver = receiver;
alignedTimer->m_singleShotMember = member;
- alignedTimer->setSingleShot(true);
alignedTimer->start(minimumTime, maximumTime);
}
}
diff --git a/src/systeminfo/qsystemdeviceinfo.cpp b/src/systeminfo/qsystemdeviceinfo.cpp
index 801d10a258..4d5e389b92 100644
--- a/src/systeminfo/qsystemdeviceinfo.cpp
+++ b/src/systeminfo/qsystemdeviceinfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -44,9 +44,8 @@
#include <QMetaType>
QTM_BEGIN_NAMESPACE
-#ifndef Q_OS_SYMBIAN
+
Q_GLOBAL_STATIC(QSystemDeviceInfoPrivate, deviceInfoPrivateSingleton)
-#endif
#ifdef QT_SIMULATOR
QSystemDeviceInfoPrivate *getSystemDeviceInfoPrivate() { return deviceInfoPrivateSingleton(); }
@@ -671,14 +670,7 @@ QSystemDeviceInfo::ProfileDetails::~ProfileDetails()
*/
int QSystemDeviceInfo::ProfileDetails::messageRingtoneVolume() const
{
-#ifdef Q_OS_SYMBIAN
- QSystemDeviceInfoPrivate* deviceInfo = QSystemDeviceInfoPrivate::deviceinfoPrivateInstance();
- int messageRingtoneVolume = deviceInfo->messageRingtoneVolume();
- delete deviceInfo;
- return messageRingtoneVolume;
-#else
return deviceInfoPrivateSingleton()->messageRingtoneVolume();
-#endif
}
/*!
@@ -687,14 +679,7 @@ int QSystemDeviceInfo::ProfileDetails::messageRingtoneVolume() const
*/
int QSystemDeviceInfo::ProfileDetails::voiceRingtoneVolume() const
{
-#ifdef Q_OS_SYMBIAN
- QSystemDeviceInfoPrivate* deviceInfo = QSystemDeviceInfoPrivate::deviceinfoPrivateInstance();
- int voiceRingtoneVolume = deviceInfo->voiceRingtoneVolume();
- delete deviceInfo;
- return voiceRingtoneVolume;
-#else
return deviceInfoPrivateSingleton()->voiceRingtoneVolume();
-#endif
}
/*!
@@ -703,14 +688,7 @@ int QSystemDeviceInfo::ProfileDetails::voiceRingtoneVolume() const
*/
bool QSystemDeviceInfo::ProfileDetails::vibrationActive() const
{
-#ifdef Q_OS_SYMBIAN
- QSystemDeviceInfoPrivate* deviceInfo = QSystemDeviceInfoPrivate::deviceinfoPrivateInstance();
- int vibrationActive = deviceInfo->vibrationActive();
- delete deviceInfo;
- return vibrationActive;
-#else
return deviceInfoPrivateSingleton()->vibrationActive();
-#endif
}
#include "moc_qsystemdeviceinfo.cpp"
diff --git a/src/systeminfo/qsysteminfo_s60.cpp b/src/systeminfo/qsysteminfo_s60.cpp
index 464da8f9ac..b78e0c4bad 100644
--- a/src/systeminfo/qsysteminfo_s60.cpp
+++ b/src/systeminfo/qsysteminfo_s60.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -98,9 +98,19 @@ const float KMMPerTwip = 0.0177f; //Milimeter Per Twip
QTM_BEGIN_NAMESPACE
+QSystemInfoPrivateBase::QSystemInfoPrivateBase(QObject *parent)
+ : QObject(parent)
+{
+ m_deviceInfo = new DeviceInfo();
+}
+
+QSystemInfoPrivateBase::~QSystemInfoPrivateBase()
+{
+ delete m_deviceInfo;
+}
QSystemInfoPrivate::QSystemInfoPrivate(QObject *parent)
- : QObject(parent)
+ : QSystemInfoPrivateBase(parent)
{
}
@@ -428,33 +438,27 @@ bool QSystemInfoPrivate::hasFeatureSupported(QSystemInfo::Feature feature)
return isFeatureSupported;
}
-QSystemNetworkInfoPrivate* QSystemNetworkInfoPrivate::networkinfoPrivateInstance()
-{
- return new QSystemNetworkInfoPrivate();
-}
-
QSystemNetworkInfoPrivate::QSystemNetworkInfoPrivate(QObject *parent)
- : QObject(parent)
+ : QSystemInfoPrivateBase(parent)
{
TRACES(qDebug() << "QSystemNetworkInfoPrivate::QSystemNetworkInfoPrivate<---");
- DeviceInfo::instance()->cellSignalStrenghtInfo()->addObserver(this);
- DeviceInfo::instance()->cellNetworkInfo()->addObserver(this);
- DeviceInfo::instance()->cellNetworkRegistrationInfo()->addObserver(this);
+ m_deviceInfo->cellSignalStrenghtInfo()->addObserver(this);
+ m_deviceInfo->cellNetworkInfo()->addObserver(this);
+ m_deviceInfo->cellNetworkRegistrationInfo()->addObserver(this);
#ifdef ETELMM_SUPPORTED
- DeviceInfo::instance()->networkInfo()->addObserver(this);
+ m_deviceInfo->networkInfo()->addObserver(this);
#endif
- DeviceInfo::instance()->wlanInfo()->addObserver(this);
- /*connect(DeviceInfo::instance()->wlanInfo(), SIGNAL(wlanNetworkNameChanged()),
+ m_deviceInfo->wlanInfo()->addObserver(this);
+ /*connect(m_deviceInfo->wlanInfo(), SIGNAL(wlanNetworkNameChanged()),
this, SLOT(wlanNetworkNameChanged()));
- connect(DeviceInfo::instance()->wlanInfo(), SIGNAL(wlanNetworkSignalStrengthChanged()),
+ connect(m_deviceInfo->wlanInfo(), SIGNAL(wlanNetworkSignalStrengthChanged()),
this, SLOT(wlanNetworkSignalStrengthChanged()));
- connect(DeviceInfo::instance()->wlanInfo(), SIGNAL(wlanNetworkStatusChanged()),
+ connect(m_deviceInfo->wlanInfo(), SIGNAL(wlanNetworkStatusChanged()),
this, SLOT(wlanNetworkStatusChanged()));*/
- DeviceInfo::instance()->subscriberInfo();
+ m_deviceInfo->subscriberInfo();
#ifdef NETWORKHANDLER_SYMBIAN_SUPPORTED
- DeviceInfo::instance()->networkInfoListener()->addObserver(this);
+ m_deviceInfo->networkInfoListener()->addObserver(this);
#endif
- DeviceInfo::instance()->incrementRefCount();
TRACES(qDebug() << "QSystemNetworkInfoPrivate::QSystemNetworkInfoPrivate--->");
}
@@ -462,24 +466,16 @@ QSystemNetworkInfoPrivate::~QSystemNetworkInfoPrivate()
{
TRACES(qDebug() << "QSystemNetworkInfoPrivate::~QSystemNetworkInfoPrivate<--");
- DeviceInfo::instance()->cellSignalStrenghtInfo()->removeObserver(this);
- DeviceInfo::instance()->cellNetworkInfo()->removeObserver(this);
- DeviceInfo::instance()->cellNetworkRegistrationInfo()->removeObserver(this);
+ m_deviceInfo->cellSignalStrenghtInfo()->removeObserver(this);
+ m_deviceInfo->cellNetworkInfo()->removeObserver(this);
+ m_deviceInfo->cellNetworkRegistrationInfo()->removeObserver(this);
#ifdef ETELMM_SUPPORTED
- DeviceInfo::instance()->networkInfo()->removeObserver(this);
+ m_deviceInfo->networkInfo()->removeObserver(this);
#endif
- DeviceInfo::instance()->wlanInfo()->removeObserver(this);
+ m_deviceInfo->wlanInfo()->removeObserver(this);
#ifdef NETWORKHANDLER_SYMBIAN_SUPPORTED
- DeviceInfo::instance()->networkInfoListener()->removeObserver(this);
+ m_deviceInfo->networkInfoListener()->removeObserver(this);
#endif
- DeviceInfo::instance()->decrementRefCount();
- int refcount = DeviceInfo::instance()->getRefCount();
- if (refcount == 0)
- {
- DeviceInfo *deviceInfo = DeviceInfo::instance();
- delete deviceInfo;
- Dll::FreeTls();
- }
TRACES(qDebug() << "QSystemNetworkInfoPrivate::~QSystemNetworkInfoPrivate-->");
}
@@ -492,8 +488,8 @@ QSystemNetworkInfo::NetworkStatus QSystemNetworkInfoPrivate::networkStatus(QSyst
case QSystemNetworkInfo::LteMode:
{
#ifndef ETELMM_SUPPORTED
- CTelephony::TRegistrationStatus networkStatus = DeviceInfo::instance()->cellNetworkRegistrationInfo()->cellNetworkStatus();
- CTelephony::TNetworkMode networkMode = DeviceInfo::instance()->cellNetworkInfo()->networkMode();
+ CTelephony::TRegistrationStatus networkStatus = m_deviceInfo->cellNetworkRegistrationInfo()->cellNetworkStatus();
+ CTelephony::TNetworkMode networkMode = m_deviceInfo->cellNetworkInfo()->networkMode();
if (networkMode == CTelephony::ENetworkModeGsm && mode != QSystemNetworkInfo::GsmMode)
return QSystemNetworkInfo::NoNetworkAvailable;
@@ -522,7 +518,7 @@ QSystemNetworkInfo::NetworkStatus QSystemNetworkInfoPrivate::networkStatus(QSyst
QSystemNetworkInfo::NetworkMode currMode =currentMode();
if (currMode == mode)
{
- nStatus = DeviceInfo::instance()->networkInfo()->GetStatus();
+ nStatus = m_deviceInfo->networkInfo()->GetStatus();
}
switch (nStatus) {
case RMobilePhone::ERegistrationUnknown : return QSystemNetworkInfo::UndefinedStatus;
@@ -540,7 +536,7 @@ QSystemNetworkInfo::NetworkStatus QSystemNetworkInfoPrivate::networkStatus(QSyst
}
case QSystemNetworkInfo::WlanMode:
{
- if (DeviceInfo::instance()->wlanInfo()->wlanNetworkConnectionStatus())
+ if (m_deviceInfo->wlanInfo()->wlanNetworkConnectionStatus())
return QSystemNetworkInfo::Connected;
else
return QSystemNetworkInfo::NoNetworkAvailable;
@@ -561,7 +557,7 @@ int QSystemNetworkInfoPrivate::networkSignalStrength(QSystemNetworkInfo::Network
case QSystemNetworkInfo::CdmaMode:
case QSystemNetworkInfo::WcdmaMode:
{
- CTelephony::TNetworkMode networkMode = DeviceInfo::instance()->cellNetworkInfo()->networkMode();
+ CTelephony::TNetworkMode networkMode = m_deviceInfo->cellNetworkInfo()->networkMode();
if (networkMode == CTelephony::ENetworkModeGsm && mode != QSystemNetworkInfo::GsmMode)
return -1;
@@ -572,11 +568,11 @@ int QSystemNetworkInfoPrivate::networkSignalStrength(QSystemNetworkInfo::Network
if (networkMode == CTelephony::ENetworkModeWcdma && mode != QSystemNetworkInfo::WcdmaMode)
return -1;
- return DeviceInfo::instance()->cellSignalStrenghtInfo()->cellNetworkSignalStrength();
+ return m_deviceInfo->cellSignalStrenghtInfo()->cellNetworkSignalStrength();
}
case QSystemNetworkInfo::WlanMode:
- return DeviceInfo::instance()->wlanInfo()->wlanNetworkSignalStrength();
+ return m_deviceInfo->wlanInfo()->wlanNetworkSignalStrength();
case QSystemNetworkInfo::EthernetMode:
case QSystemNetworkInfo::BluetoothMode:
case QSystemNetworkInfo::WimaxMode:
@@ -588,27 +584,27 @@ int QSystemNetworkInfoPrivate::networkSignalStrength(QSystemNetworkInfo::Network
int QSystemNetworkInfoPrivate::cellId()
{
- return DeviceInfo::instance()->cellNetworkInfo()->cellId();
+ return m_deviceInfo->cellNetworkInfo()->cellId();
}
int QSystemNetworkInfoPrivate::locationAreaCode()
{
- return DeviceInfo::instance()->cellNetworkInfo()->locationAreaCode();
+ return m_deviceInfo->cellNetworkInfo()->locationAreaCode();
}
QString QSystemNetworkInfoPrivate::currentMobileCountryCode()
{
- return DeviceInfo::instance()->cellNetworkInfo()->countryCode();
+ return m_deviceInfo->cellNetworkInfo()->countryCode();
}
QString QSystemNetworkInfoPrivate::currentMobileNetworkCode()
{
- return DeviceInfo::instance()->cellNetworkInfo()->networkCode();
+ return m_deviceInfo->cellNetworkInfo()->networkCode();
}
QString QSystemNetworkInfoPrivate::homeMobileCountryCode()
{
- QString imsi = DeviceInfo::instance()->subscriberInfo()->imsi();
+ QString imsi = m_deviceInfo->subscriberInfo()->imsi();
if (imsi.length() >= 3) {
return imsi.left(3);
}
@@ -618,7 +614,7 @@ QString QSystemNetworkInfoPrivate::homeMobileCountryCode()
QString QSystemNetworkInfoPrivate::homeMobileNetworkCode()
{
- return DeviceInfo::instance()->cellNetworkInfo()->homeNetworkCode();
+ return m_deviceInfo->cellNetworkInfo()->homeNetworkCode();
}
@@ -630,7 +626,7 @@ QString QSystemNetworkInfoPrivate::networkName(QSystemNetworkInfo::NetworkMode m
case QSystemNetworkInfo::CdmaMode:
case QSystemNetworkInfo::WcdmaMode:
{
- CTelephony::TNetworkMode networkMode = DeviceInfo::instance()->cellNetworkInfo()->networkMode();
+ CTelephony::TNetworkMode networkMode = m_deviceInfo->cellNetworkInfo()->networkMode();
if (networkMode == CTelephony::ENetworkModeGsm && mode != QSystemNetworkInfo::GsmMode)
return QString();
@@ -642,13 +638,13 @@ QString QSystemNetworkInfoPrivate::networkName(QSystemNetworkInfo::NetworkMode m
return QString();
#ifndef NETWORKHANDLER_SYMBIAN_SUPPORTED
- return DeviceInfo::instance()->cellNetworkInfo()->networkName();
+ return m_deviceInfo->cellNetworkInfo()->networkName();
#else
- return DeviceInfo::instance()->networkInfoListener()->networkName();
+ return m_deviceInfo->networkInfoListener()->networkName();
#endif
}
case QSystemNetworkInfo::WlanMode:
- return DeviceInfo::instance()->wlanInfo()->wlanNetworkName();
+ return m_deviceInfo->wlanInfo()->wlanNetworkName();
case QSystemNetworkInfo::EthernetMode:
case QSystemNetworkInfo::BluetoothMode:
case QSystemNetworkInfo::WimaxMode:
@@ -707,20 +703,20 @@ QNetworkInterface QSystemNetworkInfoPrivate::interfaceForMode(QSystemNetworkInfo
void QSystemNetworkInfoPrivate::countryCodeChanged()
{
- emit currentMobileCountryCodeChanged(DeviceInfo::instance()->cellNetworkInfo()->countryCode());
+ emit currentMobileCountryCodeChanged(m_deviceInfo->cellNetworkInfo()->countryCode());
}
void QSystemNetworkInfoPrivate::networkCodeChanged()
{
- emit currentMobileNetworkCodeChanged(DeviceInfo::instance()->cellNetworkInfo()->networkCode());
+ emit currentMobileNetworkCodeChanged(m_deviceInfo->cellNetworkInfo()->networkCode());
}
void QSystemNetworkInfoPrivate::networkNameChanged()
{
#ifndef NETWORKHANDLER_SYMBIAN_SUPPORTED
- emit networkNameChanged(currentMode(), DeviceInfo::instance()->cellNetworkInfo()->networkName());
+ emit networkNameChanged(currentMode(), m_deviceInfo->cellNetworkInfo()->networkName());
#else
- emit networkNameChanged(currentMode(), DeviceInfo::instance()->networkInfoListener()->networkName());
+ emit networkNameChanged(currentMode(), m_deviceInfo->networkInfoListener()->networkName());
#endif
}
@@ -753,7 +749,7 @@ void QSystemNetworkInfoPrivate::changedCellId(int cellIdTel)
void QSystemNetworkInfoPrivate::cellNetworkSignalStrengthChanged()
{
emit networkSignalStrengthChanged(currentMode(),
- DeviceInfo::instance()->cellSignalStrenghtInfo()->cellNetworkSignalStrength());
+ m_deviceInfo->cellSignalStrenghtInfo()->cellNetworkSignalStrength());
}
void QSystemNetworkInfoPrivate::cellNetworkStatusChanged()
@@ -764,9 +760,9 @@ void QSystemNetworkInfoPrivate::cellNetworkStatusChanged()
void QSystemNetworkInfoPrivate::wlanNetworkNameChanged()
{
- bool status = DeviceInfo::instance()->wlanInfo()->wlanNetworkConnectionStatus();
+ bool status = m_deviceInfo->wlanInfo()->wlanNetworkConnectionStatus();
if (status)
- emit networkNameChanged(QSystemNetworkInfo::WlanMode,DeviceInfo::instance()->wlanInfo()->wlanNetworkName());
+ emit networkNameChanged(QSystemNetworkInfo::WlanMode,m_deviceInfo->wlanInfo()->wlanNetworkName());
else
networkNameChanged();//Restore default network name, as WLAN will leave name as blank
}
@@ -774,13 +770,13 @@ void QSystemNetworkInfoPrivate::wlanNetworkNameChanged()
void QSystemNetworkInfoPrivate::wlanNetworkSignalStrengthChanged()
{
emit networkSignalStrengthChanged(QSystemNetworkInfo::WlanMode,
- DeviceInfo::instance()->wlanInfo()->wlanNetworkSignalStrength());
+ m_deviceInfo->wlanInfo()->wlanNetworkSignalStrength());
}
//TODO: There are no WLAN specific modes (Not connected, Infrastructure, Adhoc, Secure Infrastructure and Searching)
void QSystemNetworkInfoPrivate::wlanNetworkStatusChanged()
{
- bool status = DeviceInfo::instance()->wlanInfo()->wlanNetworkConnectionStatus();
+ bool status = m_deviceInfo->wlanInfo()->wlanNetworkConnectionStatus();
if (status)
emit networkStatusChanged(QSystemNetworkInfo::WlanMode, QSystemNetworkInfo::Connected);
else
@@ -801,7 +797,7 @@ QSystemNetworkInfo::NetworkMode QSystemNetworkInfoPrivate::currentMode()
{
QSystemNetworkInfo::NetworkMode mode = QSystemNetworkInfo::UnknownMode;
#ifndef ETELMM_SUPPORTED
- CTelephony::TNetworkMode networkMode = DeviceInfo::instance()->cellNetworkInfo()->networkMode();
+ CTelephony::TNetworkMode networkMode = m_deviceInfo->cellNetworkInfo()->networkMode();
switch (networkMode) {
case CTelephony::ENetworkModeGsm: mode = QSystemNetworkInfo::GsmMode; break;
case CTelephony::ENetworkModeCdma95:
@@ -812,7 +808,7 @@ QSystemNetworkInfo::NetworkMode QSystemNetworkInfoPrivate::currentMode()
}
#else
RMobilePhone::TMobilePhoneNetworkMode nMode = RMobilePhone::ENetworkModeUnknown;
- nMode = DeviceInfo::instance()->networkInfo()->GetMode();
+ nMode = m_deviceInfo->networkInfo()->GetMode();
if (nMode != RMobilePhone::ENetworkModeUnknown) {
switch (nMode) {
case RMobilePhone::ENetworkModeGsm : mode = QSystemNetworkInfo::GsmMode;
@@ -836,7 +832,7 @@ QSystemNetworkInfo::NetworkMode QSystemNetworkInfoPrivate::currentMode()
QSystemNetworkInfo::CellDataTechnology QSystemNetworkInfoPrivate::cellDataTechnology()
{
#ifdef ETELPACKETSERVICE_SUPPORTED
- TUint celldatatechnology = DeviceInfo::instance()->networkInfo()->CellDataTechnology();
+ TUint celldatatechnology = m_deviceInfo->networkInfo()->CellDataTechnology();
switch (celldatatechnology )
{
case KHsdpaBearer:
@@ -1088,50 +1084,30 @@ QSystemDisplayInfo::BacklightState QSystemDisplayInfoPrivate::backlightStatus(i
return backlightState;
}
-QSystemStorageInfoPrivate* QSystemStorageInfoPrivate::storageinfoPrivateInstance()
-{
- return new QSystemStorageInfoPrivate();
-}
-
QSystemStorageInfoPrivate::QSystemStorageInfoPrivate(QObject *parent)
- : QObject(parent)
+ : QSystemInfoPrivateBase(parent)
{
- TRACES (qDebug() << "QSystemStorageInfoPrivate::QSystemStorageInfoPrivate++");
iFs.Connect();
- TInt errorcode = iFs.ShareProtected();
- TRACES ( qDebug() << "Shareproteted error code:" << errorcode );
- DeviceInfo::instance()->mmcStorageStatus()->addObserver(this);
+ m_deviceInfo->mmcStorageStatus()->addObserver(this);
#ifdef DISKNOTIFY_SUPPORTED
- CStorageDiskNotifier* storageNotifier = DeviceInfo::instance()->storagedisknotifier();
+ CStorageDiskNotifier* storageNotifier = m_deviceInfo->storagedisknotifier();
if (storageNotifier != NULL){
storageNotifier->AddObserver(this);
}
#endif
- DeviceInfo::instance()->incrementRefCount();
- TRACES (qDebug() << "QSystemStorageInfoPrivate::QSystemStorageInfoPrivate--");
}
QSystemStorageInfoPrivate::~QSystemStorageInfoPrivate()
{
- TRACES (qDebug() << "QSystemStorageInfoPrivate::~QSystemStorageInfoPrivate++");
iFs.Close();
- DeviceInfo::instance()->mmcStorageStatus()->removeObserver(this);
+ m_deviceInfo->mmcStorageStatus()->removeObserver(this);
#ifdef DISKNOTIFY_SUPPORTED
- CStorageDiskNotifier* storageNotifier = DeviceInfo::instance()->storagedisknotifier();
+ CStorageDiskNotifier* storageNotifier = m_deviceInfo->storagedisknotifier();
if (storageNotifier != NULL){
storageNotifier->RemoveObserver(this);
}
#endif
- DeviceInfo::instance()->decrementRefCount();
- int refcount = DeviceInfo::instance()->getRefCount();
- if (refcount == 0)
- {
- DeviceInfo *deviceInfo = DeviceInfo::instance();
- delete deviceInfo;
- Dll::FreeTls();
- }
- TRACES (qDebug() << "QSystemStorageInfoPrivate::~QSystemStorageInfoPrivate--");
}
qlonglong QSystemStorageInfoPrivate::totalDiskSpace(const QString &driveVolume)
@@ -1304,41 +1280,35 @@ QSystemStorageInfo::StorageState QSystemStorageInfoPrivate::CheckDiskSpaceThresh
return state;
}
-QSystemDeviceInfoPrivate* QSystemDeviceInfoPrivate::deviceinfoPrivateInstance()
-{
- return new QSystemDeviceInfoPrivate();
-}
-
QSystemDeviceInfoPrivate::QSystemDeviceInfoPrivate(QObject *parent)
- : QObject(parent), m_profileEngine(NULL), m_proEngNotifyHandler(NULL),
+ : QSystemInfoPrivateBase(parent), m_profileEngine(NULL), m_proEngNotifyHandler(NULL),
m_bluetoothRepository(NULL), m_bluetoothNotifyHandler(NULL)
{
- DeviceInfo::instance()->batteryInfo()->addObserver(this);
- DeviceInfo::instance()->chargingStatus()->addObserver(this);
+ m_deviceInfo->batteryInfo()->addObserver(this);
+ m_deviceInfo->chargingStatus()->addObserver(this);
m_previousBatteryStatus = QSystemDeviceInfo::NoBatteryLevel;
#ifdef LOCKANDFLIP_SUPPORTED
- DeviceInfo::instance()->keylockStatus()->addObserver(this);
- DeviceInfo::instance()->flipStatus()->addObserver(this);
+ m_deviceInfo->keylockStatus()->addObserver(this);
+ m_deviceInfo->flipStatus()->addObserver(this);
#endif
#ifdef THERMALSTATUS_SUPPORTED
- DeviceInfo::instance()->thermalStatus()->addObserver(this);
+ m_deviceInfo->thermalStatus()->addObserver(this);
#endif
- DeviceInfo::instance()->phoneInfo();
- DeviceInfo::instance()->subscriberInfo();
- DeviceInfo::instance()->incrementRefCount();
+ m_deviceInfo->phoneInfo();
+ m_deviceInfo->subscriberInfo();
}
QSystemDeviceInfoPrivate::~QSystemDeviceInfoPrivate()
{
- DeviceInfo::instance()->chargingStatus()->removeObserver(this);
- DeviceInfo::instance()->batteryInfo()->removeObserver(this);
+ m_deviceInfo->chargingStatus()->removeObserver(this);
+ m_deviceInfo->batteryInfo()->removeObserver(this);
#ifdef LOCKANDFLIP_SUPPORTED
- DeviceInfo::instance()->keylockStatus()->removeObserver(this);
- DeviceInfo::instance()->flipStatus()->removeObserver(this);
+ m_deviceInfo->keylockStatus()->removeObserver(this);
+ m_deviceInfo->flipStatus()->removeObserver(this);
#endif
#ifdef THERMALSTATUS_SUPPORTED
- DeviceInfo::instance()->thermalStatus()->removeObserver(this);
+ m_deviceInfo->thermalStatus()->removeObserver(this);
#endif
if (m_proEngNotifyHandler) {
m_proEngNotifyHandler->CancelProfileActivationNotifications();
@@ -1351,15 +1321,6 @@ QSystemDeviceInfoPrivate::~QSystemDeviceInfoPrivate()
delete m_bluetoothNotifyHandler;
delete m_bluetoothRepository;
-
- DeviceInfo::instance()->decrementRefCount();
- int refcount = DeviceInfo::instance()->getRefCount();
- if (refcount == 0)
- {
- DeviceInfo *deviceInfo = DeviceInfo::instance();
- delete deviceInfo;
- Dll::FreeTls();
- }
}
void QSystemDeviceInfoPrivate::connectNotify(const char *signal)
@@ -1477,7 +1438,7 @@ QSystemDeviceInfo::InputMethodFlags QSystemDeviceInfoPrivate::inputMethodType()
QSystemDeviceInfo::PowerState QSystemDeviceInfoPrivate::currentPowerState()
{
- switch (DeviceInfo::instance()->chargingStatus()->chargingStatus()) {
+ switch (m_deviceInfo->chargingStatus()->chargingStatus()) {
case EChargingStatusNotConnected:
case EChargingStatusNotCharging:
case EChargingStatusError:
@@ -1496,7 +1457,7 @@ QSystemDeviceInfo::PowerState QSystemDeviceInfoPrivate::currentPowerState()
QSystemDeviceInfo::ThermalState QSystemDeviceInfoPrivate::currentThermalState()
{
#ifdef THERMALSTATUS_SUPPORTED
- TUint8 thermalstate = DeviceInfo::instance()->thermalStatus()->getThermalStatus();
+ TUint8 thermalstate = m_deviceInfo->thermalStatus()->getThermalStatus();
switch ( thermalstate ) {
case ENormal:
return QSystemDeviceInfo::NormalThermal;
@@ -1542,7 +1503,7 @@ void QSystemDeviceInfoPrivate::NotiftythermalStateChanged(TUint8 thermalstate)
QString QSystemDeviceInfoPrivate::imei()
{
- return DeviceInfo::instance()->phoneInfo()->imei();
+ return m_deviceInfo->phoneInfo()->imei();
}
QString QSystemDeviceInfoPrivate::imsi()
@@ -1550,17 +1511,17 @@ QString QSystemDeviceInfoPrivate::imsi()
if (simStatus() == QSystemDeviceInfo::SimNotAvailable)
return QString();
else
- return DeviceInfo::instance()->subscriberInfo()->imsi();
+ return m_deviceInfo->subscriberInfo()->imsi();
}
QString QSystemDeviceInfoPrivate::manufacturer()
{
- return DeviceInfo::instance()->phoneInfo()->manufacturer();
+ return m_deviceInfo->phoneInfo()->manufacturer();
}
QString QSystemDeviceInfoPrivate::model()
{
- return DeviceInfo::instance()->phoneInfo()->model();
+ return m_deviceInfo->phoneInfo()->model();
}
QString QSystemDeviceInfoPrivate::productName()
@@ -1575,12 +1536,12 @@ QString QSystemDeviceInfoPrivate::productName()
int QSystemDeviceInfoPrivate::batteryLevel() const
{
- return DeviceInfo::instance()->batteryInfo()->batteryLevel();
+ return m_deviceInfo->batteryInfo()->batteryLevel();
}
QSystemDeviceInfo::BatteryStatus QSystemDeviceInfoPrivate::batteryStatus()
{
- int batteryLevel = DeviceInfo::instance()->batteryInfo()->batteryLevel();
+ int batteryLevel = m_deviceInfo->batteryInfo()->batteryLevel();
QSystemDeviceInfo::PowerState currentpwrstate = currentPowerState();
if (batteryLevel < 15 ) {
if ( (currentpwrstate == QSystemDeviceInfo::WallPowerChargingBattery) || (currentpwrstate == QSystemDeviceInfo::WallPower) ) {
@@ -1606,7 +1567,7 @@ QSystemDeviceInfo::BatteryStatus QSystemDeviceInfoPrivate::batteryStatus()
QSystemDeviceInfo::SimStatus QSystemDeviceInfoPrivate::simStatus()
{
#ifdef SYMBIAN_3_1
- if (!DeviceInfo::instance()->subscriberInfo()->imsi().isEmpty())
+ if (!m_deviceInfo->subscriberInfo()->imsi().isEmpty())
return QSystemDeviceInfo::SingleSimAvailable;
#else //SYMBIAN_3_1
TInt lockStatus = 0;
@@ -1692,7 +1653,7 @@ QSystemDeviceInfo::KeyboardTypeFlags QSystemDeviceInfoPrivate::keyboardTypes()
default:
break;
}
- bool filpKbStatus = DeviceInfo::instance()->flipStatus()->IsFlipSupported();
+ bool filpKbStatus = m_deviceInfo->flipStatus()->IsFlipSupported();
if ( filpKbStatus ) {
if ( keyboardFlags == QSystemDeviceInfo::UnknownKeyboard)
keyboardFlags = QSystemDeviceInfo::FlipKeyboard;
@@ -1733,8 +1694,8 @@ bool QSystemDeviceInfoPrivate::isKeyboardFlippedOpen()
{
#ifdef LOCKANDFLIP_SUPPORTED
// It is functional only for the Grip open devices
- // TBD Remove : (DeviceInfo::instance()->flipStatus()->IsFlipSupported())
- return ( DeviceInfo::instance()->flipStatus()->getFlipStatus() );
+ // TBD Remove : (m_deviceInfo->flipStatus()->IsFlipSupported())
+ return ( m_deviceInfo->flipStatus()->getFlipStatus() );
#else
return false;
#endif
@@ -1789,7 +1750,7 @@ QSystemDeviceInfo::LockTypeFlags QSystemDeviceInfoPrivate::lockStatus()
QSystemDeviceInfo::LockTypeFlags status = QSystemDeviceInfo::UnknownLock;
#ifdef LOCKANDFLIP_SUPPORTED
- int value = DeviceInfo::instance()->keylockStatus()->getLockStatus();
+ int value = m_deviceInfo->keylockStatus()->getLockStatus();
switch ( value ){
/*case EKeyguardNotActive:
status = QSystemDeviceInfo::DeviceUnlocked;
@@ -1903,11 +1864,11 @@ void QSystemScreenSaverPrivate::setScreenSaverInhibited(bool on)
}
QSystemBatteryInfoPrivate::QSystemBatteryInfoPrivate(QObject *parent)
-: QObject(parent) , m_batteryHWRM(NULL)
+: QSystemInfoPrivateBase(parent) , m_batteryHWRM(NULL)
{
m_batteryHWRM = CBatteryHWRM::New();
bool chargestate,usbstate;
- DeviceInfo::instance()->batteryCommonInfo()->ChargerType(chargestate,usbstate);
+ m_deviceInfo->batteryCommonInfo()->ChargerType(chargestate,usbstate);
if (chargestate) {
if (usbstate)
m_charger = QSystemBatteryInfo::USBCharger;
@@ -1916,34 +1877,24 @@ QSystemBatteryInfoPrivate::QSystemBatteryInfoPrivate(QObject *parent)
} else
m_charger = QSystemBatteryInfo::NoCharger;
m_previousChagrger = m_charger ;
- DeviceInfo::instance()->batteryCommonInfo()->AddObserver(this);
- DeviceInfo::instance()->incrementRefCount();
+ m_deviceInfo->batteryCommonInfo()->AddObserver(this);
}
QSystemBatteryInfoPrivate::~QSystemBatteryInfoPrivate()
{
- DeviceInfo::instance()->batteryCommonInfo()->RemoveObserver(this);
+ m_deviceInfo->batteryCommonInfo()->RemoveObserver(this);
if (m_batteryHWRM)
{
delete(m_batteryHWRM);
m_batteryHWRM = NULL;
}
-
- DeviceInfo::instance()->decrementRefCount();
- int refcount = DeviceInfo::instance()->getRefCount();
- if (refcount == 0)
- {
- DeviceInfo *deviceInfo = DeviceInfo::instance();
- delete deviceInfo;
- Dll::FreeTls();
- }
}
QSystemBatteryInfo::ChargerType QSystemBatteryInfoPrivate::chargerType() const
{
bool chargestate,usbstate;
- DeviceInfo::instance()->batteryCommonInfo()->ChargerType(chargestate,usbstate);
+ m_deviceInfo->batteryCommonInfo()->ChargerType(chargestate,usbstate);
QSystemBatteryInfo::ChargerType result = QSystemBatteryInfo::UnknownCharger;
if (chargestate) {
if (usbstate)
@@ -1957,7 +1908,7 @@ QSystemBatteryInfo::ChargerType QSystemBatteryInfoPrivate::chargerType() const
QSystemBatteryInfo::ChargingState QSystemBatteryInfoPrivate::chargingState() const
{
- bool batteryChargingState = DeviceInfo::instance()->batteryCommonInfo()->ChargingState();
+ bool batteryChargingState = m_deviceInfo->batteryCommonInfo()->ChargingState();
QSystemBatteryInfo::ChargingState result = QSystemBatteryInfo::ChargingError;
if (batteryChargingState)
result = QSystemBatteryInfo::Charging;
@@ -1969,23 +1920,23 @@ QSystemBatteryInfo::ChargingState QSystemBatteryInfoPrivate::chargingState() con
int QSystemBatteryInfoPrivate::nominalCapacity() const
{
- return DeviceInfo::instance()->batteryCommonInfo()->NominalCapacity();
+ return m_deviceInfo->batteryCommonInfo()->NominalCapacity();
}
int QSystemBatteryInfoPrivate::remainingCapacityPercent() const
{
- return DeviceInfo::instance()->batteryCommonInfo()->RemainingCapacityPercent();
+ return m_deviceInfo->batteryCommonInfo()->RemainingCapacityPercent();
}
int QSystemBatteryInfoPrivate::remainingCapacity() const
{
- return DeviceInfo::instance()->batteryCommonInfo()->RemainingCapacity();
+ return m_deviceInfo->batteryCommonInfo()->RemainingCapacity();
}
int QSystemBatteryInfoPrivate::voltage() const
{
- return DeviceInfo::instance()->batteryCommonInfo()->Voltage();
+ return m_deviceInfo->batteryCommonInfo()->Voltage();
}
int QSystemBatteryInfoPrivate::remainingChargingTime() const
@@ -2003,7 +1954,7 @@ int QSystemBatteryInfoPrivate::currentFlow() const
int QSystemBatteryInfoPrivate::remainingCapacityBars() const
{
- return DeviceInfo::instance()->batteryCommonInfo()->RemainingCapacityBars();
+ return m_deviceInfo->batteryCommonInfo()->RemainingCapacityBars();
}
int QSystemBatteryInfoPrivate::maxBars() const
@@ -2014,7 +1965,7 @@ int QSystemBatteryInfoPrivate::maxBars() const
QSystemBatteryInfo::BatteryStatus QSystemBatteryInfoPrivate::batteryStatus() const
{
QString logString;
- int batteryStatusVal = DeviceInfo::instance()->batteryCommonInfo()->BatteryStatus();
+ int batteryStatusVal = m_deviceInfo->batteryCommonInfo()->BatteryStatus();
QSystemBatteryInfo::BatteryStatus result = QSystemBatteryInfo::BatteryUnknown;
switch (batteryStatusVal) {
case EBatteryStatusOk : result = QSystemBatteryInfo:: BatteryOk ;
@@ -2104,7 +2055,7 @@ void QSystemBatteryInfoPrivate::changedChargingState() {
void QSystemBatteryInfoPrivate::changedChargerType() {
bool chargestate,usbstate;
- DeviceInfo::instance()->batteryCommonInfo()->ChargerType(chargestate,usbstate);
+ m_deviceInfo->batteryCommonInfo()->ChargerType(chargestate,usbstate);
if (chargestate) {
if (usbstate)
m_charger = QSystemBatteryInfo::USBCharger;
diff --git a/src/systeminfo/qsysteminfo_s60_p.h b/src/systeminfo/qsysteminfo_s60_p.h
index c5c194f4f1..8a774960ae 100644
--- a/src/systeminfo/qsysteminfo_s60_p.h
+++ b/src/systeminfo/qsysteminfo_s60_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -89,15 +89,30 @@
#include "networkoperatornamelistener_s60.h"
#endif
-#include <QThread>
QT_BEGIN_HEADER
QTM_BEGIN_NAMESPACE
const int KMaxBatteryBars = 7; //Max number of battery bars (7 is fixed for all symbian devices now)
+class DeviceInfo;
+
+//////// QSystemInfoPrivateBase
+class QSystemInfoPrivateBase : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ QSystemInfoPrivateBase(QObject *parent = 0);
+ virtual ~QSystemInfoPrivateBase();
+
+protected:
+ DeviceInfo* m_deviceInfo;
+};
+
//////// QSystemInfo
-class QSystemInfoPrivate : public QObject
+class QSystemInfoPrivate : public QSystemInfoPrivateBase
{
Q_OBJECT
@@ -122,7 +137,7 @@ private:
};
//////// QSystemNetworkInfo
-class QSystemNetworkInfoPrivate : public QObject, public MTelephonyInfoObserver, public MNetworkInfoObserver, public MWlanInfoObserver
+class QSystemNetworkInfoPrivate : public QSystemInfoPrivateBase, public MTelephonyInfoObserver, public MNetworkInfoObserver, public MWlanInfoObserver
#ifdef NETWORKHANDLER_SYMBIAN_SUPPORTED
, public MNetworkOperatorNameObserver
#endif
@@ -130,7 +145,7 @@ class QSystemNetworkInfoPrivate : public QObject, public MTelephonyInfoObserver,
Q_OBJECT
public:
- static QSystemNetworkInfoPrivate* networkinfoPrivateInstance();
+
QSystemNetworkInfoPrivate(QObject *parent = 0);
virtual ~QSystemNetworkInfoPrivate();
@@ -230,7 +245,7 @@ private:
};
//////// QSystemStorageInfo
-class QSystemStorageInfoPrivate : public QObject,
+class QSystemStorageInfoPrivate : public QSystemInfoPrivateBase,
public MStorageStatusObserver
#ifdef DISKNOTIFY_SUPPORTED
,public MStorageSpaceNotifyObserver
@@ -241,7 +256,6 @@ class QSystemStorageInfoPrivate : public QObject,
private:
QSystemStorageInfo::StorageState CheckDiskSpaceThresholdLimit(const QString &);
public:
- static QSystemStorageInfoPrivate* storageinfoPrivateInstance();
QSystemStorageInfoPrivate(QObject *parent = 0);
virtual ~QSystemStorageInfoPrivate();
qlonglong totalDiskSpace(const QString &driveVolume);
@@ -281,7 +295,7 @@ class MProEngNotifyHandler;
QTM_BEGIN_NAMESPACE
-class QSystemDeviceInfoPrivate : public QObject,
+class QSystemDeviceInfoPrivate : public QSystemInfoPrivateBase,
public MTelephonyInfoObserver,
public MProEngProfileActivationObserver,
public MCenRepNotifyHandlerCallback,
@@ -296,7 +310,7 @@ class QSystemDeviceInfoPrivate : public QObject,
Q_OBJECT
public:
- static QSystemDeviceInfoPrivate* deviceinfoPrivateInstance();
+
QSystemDeviceInfoPrivate(QObject *parent = 0);
virtual ~QSystemDeviceInfoPrivate();
@@ -421,141 +435,18 @@ private: //data
class DeviceInfo
{
public:
- static DeviceInfo *instance()
- {
- TRACES( qDebug() << "DeviceInfo::instance()"
- << ": QThread id = " << QThread::currentThread()
- << "Symbian thread id = " << RThread().Id().Id());
- if (!Dll::Tls())
- {
- Dll::SetTls(new DeviceInfo);
- TRACES( qDebug() << "DeviceInfo::instance() CREATED!"
- << ": QThread id = " << QThread::currentThread()
- << "Symbian thread id = " << RThread().Id().Id());
- }
- return static_cast<DeviceInfo *>(Dll::Tls());
- }
-
- void incrementRefCount()
- {
- m_refcount = m_refcount+1;
- TRACES( qDebug() << "DeviceInfo RefCount:" << m_refcount);
- }
-
- int getRefCount()
- {
- TRACES( qDebug() << "Get RefCount:" << m_refcount);
- return m_refcount;
- }
-
- void decrementRefCount()
- {
- m_refcount = m_refcount-1;
- TRACES( qDebug() << "Decrement RefCount:" << m_refcount);
- }
-
- void initMobilePhonehandleL()
- {
- #ifdef ETELMM_SUPPORTED
- if (m_rmobilePhoneInitialised)
- return;
-
- TInt err = KErrNone;
- err = m_etelServer.Connect();
- if ( err != KErrNone ) {
- TRACES (qDebug() << "DeviceInfo:: InitMobilePhonehandle err code RTelServer::Connect" << err);
- m_etelServer.Close();
- User::Leave(err);
- }
-
- //Eumerate legal phone
- // Get number of phones
- TInt phones(0);
- err = m_etelServer.EnumeratePhones(phones);
- if ( err != KErrNone) {
- m_etelServer.Close();
- TRACES (qDebug() << "DeviceInfo:: EnumeratePhones err code" << err);
- User::Leave(err);
- }
-
- // Get phone info of first legal phone.
- TInt legalPhoneIndex = KErrNotFound;
- for (TInt i=0; i<phones && legalPhoneIndex == KErrNotFound; i++)
- {
- if (m_etelServer.GetPhoneInfo(i, m_etelphoneInfo) == KErrNone)
- {
- if (m_etelphoneInfo.iNetworkType == RTelServer::ENetworkTypeMobileDigital)
- {
- legalPhoneIndex = i;
- }
- }
- }
- if ( legalPhoneIndex == KErrNotFound) {
- m_etelServer.Close();
- TRACES (qDebug() << "DeviceInfo:: legalPhoneIndex err code" << legalPhoneIndex);
- User::Leave(legalPhoneIndex);
- }
-
- err = m_rmobilePhone.Open(m_etelServer,m_etelphoneInfo.iName);
- if (err != KErrNone) {
- TRACES (qDebug() << "DeviceInfo:: InitMobilePhonehandle err code RMobilePhone::Open =" << err);
- m_rmobilePhone.Close();
- m_etelServer.Close();
- User::Leave(err);
- }
-
- err = m_rmobilePhone.Initialise();
- if (err != KErrNone) {
- TRACES (qDebug() << "DeviceInfo:: InitMobilePhonehandle err val for RMobilePhone::Initialise =" << err);
- m_rmobilePhone.Close();
- m_etelServer.Close();
- User::Leave(err);
- }
-
- TRACES (qDebug() << "InitMobilePhonehandleL- successful");
- m_rmobilePhoneInitialised = true;
- #endif
- }
-
- void initRmobilePhone()
- {
- #ifdef ETELMM_SUPPORTED
- TRAPD ( err,initMobilePhonehandleL());
- if ( err != KErrNone) m_rmobilePhoneInitialised = false;
- #endif
- }
-
- bool etelmmSupported()
- {
- #ifdef ETELMM_SUPPORTED
- return true;
- #else
- return false;
- #endif
- }
-
CPhoneInfo *phoneInfo()
{
- if (etelmmSupported() && !m_rmobilePhoneInitialised) initRmobilePhone();
if (!m_phoneInfo) {
-#ifdef ETELMM_SUPPORTED
- m_phoneInfo = new CPhoneInfo(m_rmobilePhone);
-#else
- m_phoneInfo = new CPhoneInfo(*m_telephony);
-#endif
+ m_phoneInfo = new CPhoneInfo(*m_telephony);
}
return m_phoneInfo;
}
CSubscriberInfo *subscriberInfo()
{
- if (etelmmSupported() && !m_rmobilePhoneInitialised) initRmobilePhone();
if (!m_subscriberInfo) {
-#ifdef ETELMM_SUPPORTED
- m_subscriberInfo = new CSubscriberInfo(m_rmobilePhone);
-#else
- m_subscriberInfo = new CSubscriberInfo(*m_telephony);
-#endif
+ m_subscriberInfo = new CSubscriberInfo(*m_telephony);
}
return m_subscriberInfo;
}
@@ -570,52 +461,32 @@ public:
CBatteryInfo *batteryInfo()
{
- if (etelmmSupported() && !m_rmobilePhoneInitialised) initRmobilePhone();
if (!m_batteryInfo) {
-#ifdef ETELMM_SUPPORTED
- m_batteryInfo = new CBatteryInfo(m_rmobilePhone);
-#else
- m_batteryInfo = new CBatteryInfo(*m_telephony);
-#endif
+ m_batteryInfo = new CBatteryInfo(*m_telephony);
}
return m_batteryInfo;
}
CCellNetworkInfo *cellNetworkInfo()
{
- if (etelmmSupported() && !m_rmobilePhoneInitialised) initRmobilePhone();
if (!m_cellNetworkInfo) {
-#ifdef ETELMM_SUPPORTED
- m_cellNetworkInfo = new CCellNetworkInfo(m_rmobilePhone);
-#else
- m_cellNetworkInfo = new CCellNetworkInfo(*m_telephony);
-#endif
+ m_cellNetworkInfo = new CCellNetworkInfo(*m_telephony);
}
return m_cellNetworkInfo;
}
CCellNetworkRegistrationInfo *cellNetworkRegistrationInfo()
{
- if (etelmmSupported() && !m_rmobilePhoneInitialised) initRmobilePhone();
if (!m_cellNetworkRegistrationInfo) {
-#ifdef ETELMM_SUPPORTED
- m_cellNetworkRegistrationInfo = new CCellNetworkRegistrationInfo(m_rmobilePhone);
-#else
- m_cellNetworkRegistrationInfo = new CCellNetworkRegistrationInfo(*m_telephony);
-#endif
+ m_cellNetworkRegistrationInfo = new CCellNetworkRegistrationInfo(*m_telephony);
}
return m_cellNetworkRegistrationInfo;
}
CCellSignalStrengthInfo *cellSignalStrenghtInfo()
{
- if (etelmmSupported() && !m_rmobilePhoneInitialised) initRmobilePhone();
if (!m_cellSignalStrengthInfo) {
-#ifdef ETELMM_SUPPORTED
- m_cellSignalStrengthInfo = new CCellSignalStrengthInfo(m_rmobilePhone);
-#else
- m_cellSignalStrengthInfo = new CCellSignalStrengthInfo(*m_telephony);
-#endif
+ m_cellSignalStrengthInfo = new CCellSignalStrengthInfo(*m_telephony);
}
return m_cellSignalStrengthInfo;
}
@@ -718,8 +589,6 @@ public:
#ifdef NETWORKHANDLER_SYMBIAN_SUPPORTED
,m_networkinfolistener(NULL)
#endif
- ,m_rmobilePhoneInitialised(false)
- ,m_refcount(0)
{
TRACES(qDebug() << "DeviceInfo():Constructor");
m_telephony = CTelephony::NewL();
@@ -727,7 +596,7 @@ public:
~DeviceInfo()
{
- TRACES(qDebug() << "DeviceInfo():Destructor++");
+ TRACES(qDebug() << "DeviceInfo():Destructor");
delete m_cellSignalStrengthInfo;
delete m_cellNetworkRegistrationInfo;
delete m_cellNetworkInfo;
@@ -755,16 +624,6 @@ public:
#ifdef NETWORKHANDLER_SYMBIAN_SUPPORTED
delete m_networkinfolistener;
#endif
-
-#ifdef ETELMM_SUPPORTED
- if ( m_rmobilePhoneInitialised) {
- TRACES ( qDebug() << "Closing RMobilePhone handles++");
- m_rmobilePhone.Close();
- m_etelServer.Close();
- TRACES ( qDebug() << "Closing RMobilePhone handles--");
- }
-#endif
- TRACES(qDebug() << "DeviceInfo():Destructor--");
}
private:
@@ -798,16 +657,9 @@ private:
CNetworkOperatorNameListener* m_networkinfolistener;
#endif
-#ifdef ETELMM_SUPPORTED
- RTelServer m_etelServer;
- RMobilePhone m_rmobilePhone;
- RTelServer::TPhoneInfo m_etelphoneInfo;
-#endif
- bool m_rmobilePhoneInitialised;
- int m_refcount;
};
-class QSystemBatteryInfoPrivate : public QObject, public MBatteryInfoObserver, public MBatteryHWRMObserver
+class QSystemBatteryInfoPrivate : public QSystemInfoPrivateBase, public MBatteryInfoObserver, public MBatteryHWRMObserver
{
Q_OBJECT
public:
diff --git a/src/systeminfo/qsystemnetworkinfo.cpp b/src/systeminfo/qsystemnetworkinfo.cpp
index 14f2ed61c1..7c3448cce0 100644
--- a/src/systeminfo/qsystemnetworkinfo.cpp
+++ b/src/systeminfo/qsystemnetworkinfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -44,9 +44,7 @@
#include <QMetaType>
QTM_BEGIN_NAMESPACE
-#ifndef Q_OS_SYMBIAN
Q_GLOBAL_STATIC(QSystemNetworkInfoPrivate, netInfoPrivateSingleton)
-#endif
#ifdef QT_SIMULATOR
QSystemNetworkInfoPrivate *getSystemNetworkInfoPrivate() { return netInfoPrivateSingleton(); }
@@ -207,21 +205,11 @@ QSystemNetworkInfo::NetworkStatus QSystemNetworkInfo::networkStatus(QSystemNetwo
*/
int QSystemNetworkInfo::networkSignalStrength(QSystemNetworkInfo::NetworkMode mode)
{
-#ifdef Q_OS_SYMBIAN
- QSystemNetworkInfoPrivate* networkInfo = QSystemNetworkInfoPrivate::networkinfoPrivateInstance();
- QSystemNetworkInfo::NetworkStatus info = networkInfo->networkStatus(mode);
- if (info == QSystemNetworkInfo::UndefinedStatus || info == QSystemNetworkInfo::NoNetworkAvailable)
- return -1;
- int signalStrength = networkInfo->networkSignalStrength(mode);
- delete networkInfo;
- return signalStrength;
-#else
QSystemNetworkInfo::NetworkStatus info = netInfoPrivateSingleton()->networkStatus(mode);
if (info == QSystemNetworkInfo::UndefinedStatus || info == QSystemNetworkInfo::NoNetworkAvailable)
return -1;
return netInfoPrivateSingleton()->networkSignalStrength(mode);
-#endif
}
/*!
@@ -308,14 +296,7 @@ QString QSystemNetworkInfo::homeMobileNetworkCode()
*/
QString QSystemNetworkInfo::networkName(QSystemNetworkInfo::NetworkMode mode)
{
-#ifdef Q_OS_SYMBIAN
- QSystemNetworkInfoPrivate* networkInfo = QSystemNetworkInfoPrivate::networkinfoPrivateInstance();
- QString networkName = networkInfo->networkName(mode);
- delete networkInfo;
- return networkName;
-#else
return netInfoPrivateSingleton()->networkName(mode);
-#endif
}
/*!
diff --git a/src/systeminfo/qsystemstorageinfo.cpp b/src/systeminfo/qsystemstorageinfo.cpp
index 5eb67fc3fb..143629df63 100644
--- a/src/systeminfo/qsystemstorageinfo.cpp
+++ b/src/systeminfo/qsystemstorageinfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -44,9 +44,8 @@
#include <QMetaType>
QTM_BEGIN_NAMESPACE
-#ifndef Q_OS_SYMBIAN
+
Q_GLOBAL_STATIC(QSystemStorageInfoPrivate, storageInfoPrivateSingleton)
-#endif
#ifdef QT_SIMULATOR
QSystemStorageInfoPrivate *getSystemStorageInfoPrivate() { return storageInfoPrivateSingleton(); }
@@ -234,14 +233,7 @@ qlonglong QSystemStorageInfo::availableDiskSpace(const QString &drive)
*/
QStringList QSystemStorageInfo::logicalDrives()
{
-#ifdef Q_OS_SYMBIAN
- QSystemStorageInfoPrivate* storageInfo = QSystemStorageInfoPrivate::storageinfoPrivateInstance();
- QStringList drivelist = storageInfo->logicalDrives();
- delete storageInfo;
- return drivelist;
-#else
return storageInfoPrivateSingleton()->logicalDrives();
-#endif
}
/*!
diff --git a/src/systeminfo/symbian/storagedisknotifier_s60.cpp b/src/systeminfo/symbian/storagedisknotifier_s60.cpp
index 06ca04e213..24e9a623d0 100644
--- a/src/systeminfo/symbian/storagedisknotifier_s60.cpp
+++ b/src/systeminfo/symbian/storagedisknotifier_s60.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -56,7 +56,6 @@ CStorageDiskNotifier* CStorageDiskNotifier::NewL()
void CStorageDiskNotifier::ConstructL()
{
User::LeaveIfError(iFs.Connect());
- User::LeaveIfError(iFs.ShareProtected());
iStorageDiskNotifyHandler = CDiskNotifyHandler::NewL( *this, iFs );
SubscribeStorageDiskNotificationL();
}
diff --git a/src/systeminfo/symbian/storagestatus_s60.cpp b/src/systeminfo/symbian/storagestatus_s60.cpp
index 1ada686c31..96526fc4e5 100644
--- a/src/systeminfo/symbian/storagestatus_s60.cpp
+++ b/src/systeminfo/symbian/storagestatus_s60.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -46,29 +46,24 @@
#include <driveinfo.h>
#endif //SYMBIAN_3_1
#include <f32file.h>
-#include "trace.h"
CMMCStorageStatus::CMMCStorageStatus() : CActive(EPriorityStandard),
m_previousDriveList(TDriveList())
{
-TRACES ( qDebug() << "CMMCStorageStatus::CMMCStorageStatus++");
CActiveScheduler::Add(this);
- if (iFs.Connect() == KErrNone && iFs.ShareProtected() == KErrNone) {
+ if (iFs.Connect() == KErrNone) {
#ifndef SYMBIAN_3_1
m_previousDriveList.Copy(PopulateDriveList());
#endif //SYMBIAN_3_1
startMonitoring();
}
-TRACES ( qDebug() << "CMMCStorageStatus::CMMCStorageStatus--");
}
CMMCStorageStatus::~CMMCStorageStatus()
{
-TRACES ( qDebug() << "CMMCStorageStatus::~CMMCStorageStatus++");
Cancel();
iFs.Close();
-TRACES ( qDebug() << "CMMCStorageStatus::~CMMCStorageStatus--");
}
void CMMCStorageStatus::addObserver(MStorageStatusObserver *observer)
diff --git a/src/systeminfo/symbian/telephonyinfo_s60.cpp b/src/systeminfo/symbian/telephonyinfo_s60.cpp
index 8607bac65a..d381f04434 100644
--- a/src/systeminfo/symbian/telephonyinfo_s60.cpp
+++ b/src/systeminfo/symbian/telephonyinfo_s60.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -45,21 +45,16 @@
#include <mmtsy_names.h>
#endif
-#ifndef ETELMM_SUPPORTED
-// number of nested event loops allowed to avoid stackoverflow
-const int KMaxLoops = 25;
-
CTelephonyInfo::CTelephonyInfo(CTelephony &telephony) : CActive(EPriorityStandard),
- m_telephony(telephony), m_loops()
+ m_telephony(telephony)
{
CActiveScheduler::Add(this);
}
CTelephonyInfo::~CTelephonyInfo()
{
- //Cancel();
- exitWait();
+ delete iEventLoop;
}
void CTelephonyInfo::addObserver(MTelephonyInfoObserver *observer)
@@ -72,65 +67,36 @@ void CTelephonyInfo::removeObserver(MTelephonyInfoObserver *observer)
m_observers.removeOne(observer);
}
-void CTelephonyInfo::waitForRequest() const
+void CTelephonyInfo::RunL()
{
- TRACES (qDebug() << "CTelephonyInfo::waitForRequest<---");
-
- //Restricing number of blocking loops
- //Each call to api's e.g. IMSI must be blocked until they are initialized
- //But we cannot maintain infinite number of blocked calls as stack is limited
- //So restrict the number of loops after which we return uninitialized values
- if (m_loops.size() <= KMaxLoops) {
- QEventLoop* loop = NULL;
- loop = new QEventLoop();
- if ( loop != NULL ) {
- m_loops.push(loop);
- loop->exec();
- delete loop;
- }
- } else {
- qDebug() << "Blocked calls loop count exceeded";
- }
+ TRACES (qDebug() << "CTelephonyInfo::RunL<---");
- TRACES (qDebug() << "CTelephonyInfo::waitForRequest--->");
+ if ( iEventLoop ){
+ TRACES (qDebug() << "eventloop::exiting");
+ if (iEventLoop->isRunning()) iEventLoop->exit();
+ }
}
-void CTelephonyInfo::exitWait() const
+void CTelephonyInfo::makeRequest()
{
- TRACES (qDebug() << "CTelephonyInfo::ExitWait<---");
-
- while (!m_loops.isEmpty())
- {
- QEventLoop* loop = m_loops.pop();
- loop->quit();
- }
+ if (!IsActive())
+ SetActive();
- TRACES (qDebug() << "CTelephonyInfo::ExitWait--->");
+ if ( !iEventLoop ){
+ iEventLoop = new QEventLoop();
+ TRACES ( qDebug() << "started event loop...");
+ }
+ iEventLoop->exec(); //start the loop
}
-CPhoneInfo::CPhoneInfo(CTelephony &telephony) : CTelephonyInfo(telephony),m_initializing(true)
- ,m_phoneIdV1Pckg(m_phoneIdV1)
+CPhoneInfo::CPhoneInfo(CTelephony &telephony) : CTelephonyInfo(telephony),
+ m_phoneIdV1Pckg(m_phoneIdV1)
{
TRACES (qDebug() << "CPhoneInfo::CPhoneInfo<---");
- makeRequest();
- TRACES (qDebug() << "CPhoneInfo::CPhoneInfo--->");
-}
-
-void CPhoneInfo::makeRequest()
-{
- TRACES (qDebug() << "CPhoneInfo::makeRequest<--");
- if (!IsActive()){
m_telephony.GetPhoneId(iStatus, m_phoneIdV1Pckg);
- SetActive();
- }
- TRACES (qDebug() << "CPhoneInfo::makeRequest-->");
-}
-void CPhoneInfo::RunL()
-{
- TRACES (qDebug() << "CPhoneInfo::RunL<---");
+ makeRequest();
- if (iStatus == KErrNone) {
TBuf<CTelephony::KPhoneSerialNumberSize> imei = m_phoneIdV1.iSerialNumber;
m_imei = QString::fromUtf16(imei.Ptr(), imei.Length());
@@ -139,14 +105,7 @@ void CPhoneInfo::RunL()
TBuf<CTelephony::KPhoneModelIdSize> model = m_phoneIdV1.iModel;
m_model = QString::fromUtf16(model.Ptr(), model.Length());
-
- m_initializing = false;
- }
-
- if (iStatus == KErrPermissionDenied) m_initializing =false;
- exitWait();
-
- TRACES (qDebug() << "CPhoneInfo::RunL--->");
+ TRACES (qDebug() << "CPhoneInfo::CPhoneInfo--->");
}
CPhoneInfo::~CPhoneInfo()
@@ -156,81 +115,34 @@ CPhoneInfo::~CPhoneInfo()
void CPhoneInfo::DoCancel()
{
- TRACES (qDebug() << "CPhoneInfo::DoCancel<---");
- if (m_initializing) {
- m_telephony.CancelAsync(CTelephony::EGetPhoneIdCancel);
- }
- TRACES (qDebug() << "CPhoneInfo::DoCancel--->");
+ m_telephony.CancelAsync(CTelephony::EGetPhoneIdCancel);
}
-QString CPhoneInfo::imei()
+QString CPhoneInfo::imei() const
{
- TRACES (qDebug() << "CPhoneInfo::imei:" << m_imei);
-
- if (m_initializing) {
- makeRequest();
- waitForRequest();
- }
-
- return m_imei;
+ return m_imei;
}
-QString CPhoneInfo::manufacturer()
+QString CPhoneInfo::manufacturer() const
{
- TRACES (qDebug() << "CPhoneInfo::manufacturer:" << m_manufacturer);
-
- if (m_initializing) {
- makeRequest();
- waitForRequest();
- }
-
- return m_manufacturer;
+ return m_manufacturer;
}
-QString CPhoneInfo::model()
+QString CPhoneInfo::model() const
{
- TRACES (qDebug() << "CPhoneInfo::model:" << m_model);
-
- if (m_initializing) {
- makeRequest();
- waitForRequest();
- }
-
- return m_model;
+ return m_model;
}
-CSubscriberInfo::CSubscriberInfo(CTelephony &telephony) : CTelephonyInfo(telephony),m_initializing(true)
- ,m_subscriberIdV1Pckg(m_subscriberIdV1)
+CSubscriberInfo::CSubscriberInfo(CTelephony &telephony) : CTelephonyInfo(telephony),
+ m_subscriberIdV1Pckg(m_subscriberIdV1)
{
TRACES (qDebug() << "CSubscriberInfo::CSubscriberInfo<---");
- makeRequest();
- TRACES (qDebug() << "CSubscriberInfo::CSubscriberInfo--->");
-}
-
-void CSubscriberInfo::makeRequest()
-{
- TRACES (qDebug() << "CSubscriberInfo::MakeRequest<---");
- if (!IsActive()) {
m_telephony.GetSubscriberId(iStatus, m_subscriberIdV1Pckg);
- SetActive();
- }
- TRACES (qDebug() << "CSubscriberInfo::MakeRequest--->");
-}
+ makeRequest();
-void CSubscriberInfo::RunL()
-{
- TRACES (qDebug() << "CSubscriberInfo::RunL<---");
-
- if (iStatus == KErrNone) {
TBuf<CTelephony::KIMSISize> imsi = m_subscriberIdV1.iSubscriberId;
m_imsi = QString::fromUtf16(imsi.Ptr(), imsi.Length());
- m_initializing = false;
- }
-
- if (iStatus == KErrPermissionDenied ) m_initializing = false;
- exitWait();
-
- TRACES (qDebug() << "CSubscriberInfo::RunL--->");
+ TRACES (qDebug() << "CSubscriberInfo::CSubscriberInfo--->");
}
CSubscriberInfo::~CSubscriberInfo()
@@ -240,31 +152,26 @@ CSubscriberInfo::~CSubscriberInfo()
void CSubscriberInfo::DoCancel()
{
- TRACES (qDebug() << "CSubscriberInfo::DoCancel<---");
- if (m_initializing) {
- m_telephony.CancelAsync(CTelephony::EGetSubscriberIdCancel);
- }
- TRACES (qDebug() << "CSubscriberInfo::DoCancel--->");
+ m_telephony.CancelAsync(CTelephony::EGetSubscriberIdCancel);
}
-QString CSubscriberInfo::imsi()
+QString CSubscriberInfo::imsi() const
{
- TRACES (qDebug() << "CSubscriberInfo::imsi:" << m_imsi);
- if (m_initializing) {
- makeRequest();
- waitForRequest();
- }
- return m_imsi;
+ return m_imsi;
}
CBatteryInfo::CBatteryInfo(CTelephony &telephony) : CTelephonyInfo(telephony),
m_initializing(true), m_batteryInfoV1Pckg(m_batteryInfoV1)
{
TRACES (qDebug() << "CBatteryInfo::CBatteryInfo<---");
+ m_telephony.GetBatteryInfo(iStatus, m_batteryInfoV1Pckg);
+
+ makeRequest();
- m_telephony.GetBatteryInfo(iStatus, m_batteryInfoV1Pckg);
- SetActive();
+ m_batteryLevel = m_batteryInfoV1.iChargeLevel;
+ m_previousBatteryLevel = m_batteryLevel;
+ startMonitoring();
TRACES (qDebug() << "CBatteryInfo::CBatteryInfo--->");
}
@@ -276,64 +183,46 @@ CBatteryInfo::~CBatteryInfo()
void CBatteryInfo::RunL()
{
TRACES (qDebug() << "CBatteryInfo::RunL<---");
-
- if (iStatus == KErrNone) {
- m_batteryLevel = m_batteryInfoV1.iChargeLevel;
-
- if (!m_initializing) {
- foreach (MTelephonyInfoObserver *observer, m_observers) {
- if (m_batteryLevel != m_previousBatteryLevel)
- observer->batteryLevelChanged();
- }
- }
- m_previousBatteryLevel = m_batteryLevel;
- }
-
if (m_initializing) {
- m_initializing = false;
- exitWait();
- if (iStatus == KErrPermissionDenied) {
- return; //No monitoring required
- }
+ CTelephonyInfo::RunL();
+ m_initializing = false;
+ } else {
+ m_batteryLevel = m_batteryInfoV1.iChargeLevel;
+ foreach (MTelephonyInfoObserver *observer, m_observers) {
+ if (m_batteryLevel != m_previousBatteryLevel) {
+ observer->batteryLevelChanged();
+ }
+ }
}
-
+ m_previousBatteryLevel = m_batteryLevel;
startMonitoring();
-
TRACES (qDebug() << "CBatteryInfo::RunL--->");
}
void CBatteryInfo::DoCancel()
{
TRACES (qDebug() << "CBatteryInfo::DoCancel<---");
- if (m_initializing) {
- m_telephony.CancelAsync(CTelephony::EGetBatteryInfoCancel);
- }
- else
- {
- m_telephony.CancelAsync(CTelephony::EBatteryInfoChangeCancel);
+ if (m_initializing) {
+ m_telephony.CancelAsync(CTelephony::EGetBatteryInfoCancel);
+ } else {
+ m_telephony.CancelAsync(CTelephony::EBatteryInfoChangeCancel);
}
TRACES (qDebug() << "CBatteryInfo::DoCancel--->");
}
+
int CBatteryInfo::batteryLevel() const
{
- TRACES (qDebug() << "CBatteryInfo::batteryLevel:" << m_batteryLevel);
-
- if (m_initializing)
- waitForRequest();
-
- return m_batteryLevel;
+ return m_batteryLevel;
}
void CBatteryInfo::startMonitoring()
{
TRACES (qDebug() << "CBatteryInfo::startMonitoring<---");
-
if (!IsActive()) {
m_telephony.NotifyChange(iStatus, CTelephony::EBatteryInfoChange, m_batteryInfoV1Pckg);
SetActive();
}
-
TRACES (qDebug() << "CBatteryInfo::startMonitoring--->");
}
@@ -341,10 +230,33 @@ CCellNetworkInfo::CCellNetworkInfo(CTelephony &telephony) : CTelephonyInfo(telep
m_initializing(true), m_networkInfoV1Pckg(m_networkInfoV1)
{
TRACES (qDebug() << "CCellNetworkInfo::CCellNetworkInfo<---");
-
m_telephony.GetCurrentNetworkInfo(iStatus, m_networkInfoV1Pckg);
- SetActive();
+ makeRequest();
+
+ m_cellId = m_networkInfoV1.iCellId;
+ m_previouscellId = m_cellId;
+ m_locationAreaCode = m_networkInfoV1.iLocationAreaCode;
+
+ TBuf<CTelephony::KNetworkIdentitySize> networkId = m_networkInfoV1.iNetworkId;
+ m_networkId = QString::fromUtf16(networkId.Ptr(), networkId.Length());
+ m_previousNetworkId = m_networkId;
+
+ TBuf<CTelephony::KNetworkCountryCodeSize> countryCode = m_networkInfoV1.iCountryCode;
+ m_countryCode = QString::fromUtf16(countryCode.Ptr(), countryCode.Length());
+ m_previousCountryCode = m_countryCode;
+ TBuf<CTelephony::KNetworkLongNameSize> longName = m_networkInfoV1.iLongName;
+ if (longName.Length() > 0) {
+ m_networkName = QString::fromUtf16(longName.Ptr(), longName.Length());
+ } else {
+ TBuf<CTelephony::KNetworkDisplayTagSize> displayTag = m_networkInfoV1.iDisplayTag;
+ m_networkName = QString::fromUtf16(displayTag.Ptr(), displayTag.Length());
+ }
+ m_previousNetworkName = m_networkName;
+ m_networkMode = m_networkInfoV1.iMode;
+ m_previousNetworkMode = m_networkMode;
+
+ startMonitoring();
TRACES (qDebug() << "CCellNetworkInfo::CCellNetworkInfo--->");
}
@@ -356,130 +268,95 @@ CCellNetworkInfo::~CCellNetworkInfo()
void CCellNetworkInfo::RunL()
{
TRACES (qDebug() << "CCellNetworkInfo::RunL<---");
+ if (m_initializing) {
+ CTelephonyInfo::RunL();
+ m_initializing = false;
+ } else {
+ if (iStatus != KErrNone) return; //To avoid looping if app doesn't have ReadDeviceData caps
+ m_cellId = m_networkInfoV1.iCellId;
+ m_locationAreaCode = m_networkInfoV1.iLocationAreaCode;
- if (iStatus == KErrNone) {
- m_cellId = m_networkInfoV1.iCellId;
- m_locationAreaCode = m_networkInfoV1.iLocationAreaCode;
-
- TBuf<CTelephony::KNetworkIdentitySize> networkId = m_networkInfoV1.iNetworkId;
- m_networkId = QString::fromUtf16(networkId.Ptr(), networkId.Length());
-
- TBuf<CTelephony::KNetworkCountryCodeSize> countryCode = m_networkInfoV1.iCountryCode;
- m_countryCode = QString::fromUtf16(countryCode.Ptr(), countryCode.Length());
+ TBuf<CTelephony::KNetworkIdentitySize> networkId = m_networkInfoV1.iNetworkId;
+ m_networkId = QString::fromUtf16(networkId.Ptr(), networkId.Length());
- TBuf<CTelephony::KNetworkLongNameSize> longName = m_networkInfoV1.iLongName;
- if (longName.Length() > 0) {
- m_networkName = QString::fromUtf16(longName.Ptr(), longName.Length());
- } else {
- TBuf<CTelephony::KNetworkDisplayTagSize> displayTag = m_networkInfoV1.iDisplayTag;
- m_networkName = QString::fromUtf16(displayTag.Ptr(), displayTag.Length());
- }
+ TBuf<CTelephony::KNetworkCountryCodeSize> countryCode = m_networkInfoV1.iCountryCode;
+ m_countryCode = QString::fromUtf16(countryCode.Ptr(), countryCode.Length());
- m_networkMode = m_networkInfoV1.iMode;
+ TBuf<CTelephony::KNetworkLongNameSize> longName = m_networkInfoV1.iLongName;
+ if (longName.Length() > 0) {
+ m_networkName = QString::fromUtf16(longName.Ptr(), longName.Length());
+ } else {
+ TBuf<CTelephony::KNetworkDisplayTagSize> displayTag = m_networkInfoV1.iDisplayTag;
+ m_networkName = QString::fromUtf16(displayTag.Ptr(), displayTag.Length());
+ }
- if (!m_initializing) {
- foreach (MTelephonyInfoObserver *observer, m_observers) {
- if (m_networkId != m_previousNetworkId) {
- observer->networkCodeChanged();
- }
- if (m_countryCode != m_previousCountryCode) {
- observer->countryCodeChanged();
- }
- if (m_networkName != m_previousNetworkName) {
- observer->networkNameChanged();
- }
- if (m_networkMode != m_previousNetworkMode) {
- observer->networkModeChanged();
- }
- if (m_cellId != m_previouscellId) {
- observer->changedCellId(m_cellId);
- }
- }
- }
-
- m_previouscellId = m_cellId;
- m_previousNetworkId = m_networkId;
- m_previousCountryCode = m_countryCode;
- m_previousNetworkName = m_networkName;
- m_previousNetworkMode = m_networkMode;
- }
+ m_networkMode = m_networkInfoV1.iMode;
- if (m_initializing) {
- m_initializing = false;
- exitWait();
- if (iStatus == KErrPermissionDenied) {
- return; //No monitoring required
- }
+ foreach (MTelephonyInfoObserver *observer, m_observers) {
+ if (m_networkId != m_previousNetworkId) {
+ observer->networkCodeChanged();
+ }
+ if (m_countryCode != m_previousCountryCode) {
+ observer->countryCodeChanged();
+ }
+ if (m_networkName != m_previousNetworkName) {
+ observer->networkNameChanged();
+ }
+ if (m_networkMode != m_previousNetworkMode) {
+ observer->networkModeChanged();
+ }
+ if (m_cellId != m_previouscellId) {
+ observer->changedCellId(m_cellId);
+ }
+ }
+ m_previousNetworkId = m_networkId;
+ m_previousCountryCode = m_countryCode;
+ m_previousNetworkName = m_networkName;
+ m_previousNetworkMode = m_networkMode;
+ m_previouscellId = m_cellId;
+ startMonitoring();
}
-
- startMonitoring();
TRACES (qDebug() << "CCellNetworkInfo::RunL--->");
}
void CCellNetworkInfo::DoCancel()
{
- TRACES (qDebug() << "CCellNetworkInfo::DoCancel<---");
+ TRACES (qDebug() << "CCellNetworkInfo::DoCancel--->");
if (m_initializing) {
m_telephony.CancelAsync(CTelephony::EGetCurrentNetworkInfoCancel);
} else {
m_telephony.CancelAsync(CTelephony::ECurrentNetworkInfoChangeCancel);
}
- TRACES (qDebug() << "CCellNetworkInfo::DoCancel--->");
+ TRACES (qDebug() << "CCellNetworkInfo::DoCancel<---");
}
int CCellNetworkInfo::cellId() const
{
- TRACES (qDebug() << "CCellNetworkInfo::cellId:" << m_cellId);
-
- if (m_initializing)
- waitForRequest();
-
- return m_cellId;
+ return m_cellId;
}
int CCellNetworkInfo::locationAreaCode() const
{
- TRACES (qDebug() << "CCellNetworkInfo::locationAreaCode:" << m_locationAreaCode);
-
- if (m_initializing)
- waitForRequest();
-
- return m_locationAreaCode;
+ return m_locationAreaCode;
}
QString CCellNetworkInfo::countryCode() const
{
- TRACES (qDebug() << "CCellNetworkInfo::countryCode:" << m_countryCode);
-
- if (m_initializing)
- waitForRequest();
-
- return m_countryCode;
+ return m_countryCode;
}
QString CCellNetworkInfo::networkCode() const
{
- TRACES (qDebug() << "CCellNetworkInfo::networkCode:" << m_networkId);
-
- if (m_initializing)
- waitForRequest();
-
- return m_networkId;
+ return m_networkId;
}
QString CCellNetworkInfo::networkName() const
{
- TRACES (qDebug() << "CCellNetworkInfo::networkName<---");
-
- if (m_initializing)
- waitForRequest();
-
- return m_networkName;
+ return m_networkName;
}
QString CCellNetworkInfo::homeNetworkCode()
{
- TRACES (qDebug() << "CCellNetworkInfo::homeNetworkCode<---");
#ifdef ETELMM_SUPPORTED
RTelServer telServer;
RMobilePhone mobilePhone;
@@ -529,23 +406,16 @@ QString CCellNetworkInfo::homeNetworkCode()
CTelephony::TNetworkMode CCellNetworkInfo::networkMode() const
{
- TRACES (qDebug() << "CCellNetworkInfo::networkMode:" << m_networkMode);
-
- if (m_initializing)
- waitForRequest();
-
- return m_networkMode;
+ return m_networkMode;
}
void CCellNetworkInfo::startMonitoring()
{
TRACES (qDebug() << "CCellNetworkInfo::startMonitoring<---");
-
if (!IsActive()) {
m_telephony.NotifyChange(iStatus, CTelephony::ECurrentNetworkInfoChange, m_networkInfoV1Pckg);
SetActive();
}
-
TRACES (qDebug() << "CCellNetworkInfo::startMonitoring--->");
}
@@ -553,10 +423,13 @@ CCellNetworkRegistrationInfo::CCellNetworkRegistrationInfo(CTelephony &telephony
m_initializing(true), m_networkRegistrationV1Pckg(m_networkRegistrationV1)
{
TRACES (qDebug() << "CCellNetworkRegistrationInfo::CCellNetworkRegistrationInfo--->");
-
m_telephony.GetNetworkRegistrationStatus(iStatus, m_networkRegistrationV1Pckg);
- SetActive();
+ makeRequest();
+
+ m_networkStatus = m_networkRegistrationV1.iRegStatus;
+ m_previousNetworkStatus = m_networkStatus;
+ startMonitoring();
TRACES (qDebug() << "CCellNetworkRegistrationInfo::CCellNetworkRegistrationInfo<---");
}
@@ -568,27 +441,21 @@ CCellNetworkRegistrationInfo::~CCellNetworkRegistrationInfo()
void CCellNetworkRegistrationInfo::RunL()
{
TRACES (qDebug() << "CCellNetworkRegistrationInfo::RunL<---");
- if (iStatus == KErrNone) {
- m_networkStatus = m_networkRegistrationV1.iRegStatus;
- if (!m_initializing) {
+ if (m_initializing) {
+ CTelephonyInfo::RunL();
+ m_initializing = false;
+ } else {
+ if (iStatus != KErrNone) return; //To avoid looping if app doesn't have ReadDeviceData caps
+ m_networkStatus = m_networkRegistrationV1.iRegStatus;
+
foreach (MTelephonyInfoObserver *observer, m_observers) {
if (m_networkStatus != m_previousNetworkStatus) {
observer->cellNetworkStatusChanged();
}
}
- }
- m_previousNetworkStatus = m_networkStatus;
- }
-
- if (m_initializing) {
- m_initializing = false;
- exitWait();
- if (iStatus == KErrPermissionDenied) {
- return; //No monitoring required
- }
+ m_previousNetworkStatus = m_networkStatus;
+ startMonitoring();
}
-
- startMonitoring();
TRACES (qDebug() << "CCellNetworkRegistrationInfo::RunL--->");
}
@@ -605,23 +472,16 @@ void CCellNetworkRegistrationInfo::DoCancel()
CTelephony::TRegistrationStatus CCellNetworkRegistrationInfo::cellNetworkStatus() const
{
- TRACES (qDebug() << "CCellNetworkRegistrationInfo::cellNetworkStatus:" << m_networkStatus);
-
- if (m_initializing)
- waitForRequest();
-
- return m_networkStatus;
+ return m_networkStatus;
}
void CCellNetworkRegistrationInfo::startMonitoring()
{
TRACES (qDebug() << "CCellNetworkRegistrationInfo::startMonitoring<---");
-
if (!IsActive()) {
m_telephony.NotifyChange(iStatus, CTelephony::ENetworkRegistrationStatusChange, m_networkRegistrationV1Pckg);
SetActive();
}
-
TRACES (qDebug() << "CCellNetworkRegistrationInfo::startMonitoring--->");
}
@@ -629,10 +489,16 @@ CCellSignalStrengthInfo::CCellSignalStrengthInfo(CTelephony &telephony) : CTelep
m_initializing(true), m_signalStrengthV1Pckg(m_signalStrengthV1)
{
TRACES (qDebug() << "CCellSignalStrengthInfo::CCellSignalStrengthInfo<---");
-
m_telephony.GetSignalStrength(iStatus, m_signalStrengthV1Pckg);
- SetActive();
+ makeRequest();
+ m_cellNetworkSignalStrength = m_signalStrengthV1.iSignalStrength;
+ m_previousCellNetworkSignalStrength = m_cellNetworkSignalStrength;
+
+ m_signalBar = m_signalStrengthV1.iBar;
+ m_previousSignalBar = m_signalBar;
+
+ startMonitoring();
TRACES (qDebug() << "CCellSignalStrengthInfo::CCellSignalStrengthInfo--->");
}
@@ -644,33 +510,22 @@ CCellSignalStrengthInfo::~CCellSignalStrengthInfo()
void CCellSignalStrengthInfo::RunL()
{
TRACES (qDebug() << "CCellSignalStrengthInfo::RunL<---");
-
- if (iStatus == KErrNone) {
- m_cellNetworkSignalStrength = m_signalStrengthV1.iSignalStrength;
- m_signalBar = m_signalStrengthV1.iBar;
-
- if (!m_initializing) {
- if (m_signalBar != m_previousSignalBar) {
- foreach (MTelephonyInfoObserver *observer, m_observers) {
- observer->cellNetworkSignalStrengthChanged();
- }
- }
- }
-
- m_previousCellNetworkSignalStrength = m_cellNetworkSignalStrength;
- m_previousSignalBar = m_signalBar;
- }
-
if (m_initializing) {
- m_initializing = false;
- exitWait();
- if (iStatus == KErrPermissionDenied) {
- return; //No monitoring required
- }
- }
-
- startMonitoring();
+ CTelephonyInfo::RunL();
+ m_initializing = false;
+ } else {
+ if (iStatus != KErrNone) return; //To avoid looping if app doesn't have ReadDeviceData caps
+ m_cellNetworkSignalStrength = m_signalStrengthV1.iSignalStrength;
+ m_signalBar = m_signalStrengthV1.iBar;
+ if (m_signalBar != m_previousSignalBar) {
+ foreach (MTelephonyInfoObserver *observer, m_observers) {
+ observer->cellNetworkSignalStrengthChanged();
+ }
+ }
+ m_previousSignalBar = m_signalBar;
+ startMonitoring();
+ }
TRACES (qDebug() << "CCellSignalStrengthInfo::RunL--->");
}
@@ -687,9 +542,6 @@ void CCellSignalStrengthInfo::DoCancel()
int CCellSignalStrengthInfo::cellNetworkSignalStrength() const
{
- TRACES (qDebug() << "CCellSignalStrengthInfo::cellNetworkSignalStrength<---");
- if (m_initializing)
- waitForRequest();
//Workaround solution based on the number of signal bars (max. 7)
return int((TReal(m_signalBar) * 100.0 + 0.5) / 7.0);
}
@@ -703,656 +555,3 @@ void CCellSignalStrengthInfo::startMonitoring()
}
TRACES (qDebug() << "CCellSignalStrengthInfo::startMonitoring--->");
}
-#else //ETELMM_SUPPORTED
-CPhoneInfo::CPhoneInfo(RMobilePhone &aMobilePhone):
- m_rmobilePhone(aMobilePhone),m_phoneInfoinitialised(false)
-{
- TRACES (qDebug() << "CPhoneInfov2::Constructor<--");
- TRACES (qDebug() << "CPhoneInfov2::Constructor-->");
-}
-
-CPhoneInfo::~CPhoneInfo()
-{
- TRACES (qDebug() << "CPhoneInfov2::Destructor<--");
- TRACES (qDebug() << "CPhoneInfov2::Destructor-->");
-}
-
-void CPhoneInfo::initialise()
-{
- TRACES (qDebug() << "CPhoneInfov2::Initialise<--");
-
- if (m_phoneInfoinitialised)
- {
- TRACES(qDebug() << "CPhoneInfov2 already initialised, return");
- return;
- }
-
- //RMobilePhone implementation
- //check for identity capabilities
- TUint32 identityCaps;
- TInt capabilityErr = m_rmobilePhone.GetIdentityCaps(identityCaps);
- if (capabilityErr != KErrNone)
- {
- TRACES ( qDebug() << "CPhoneInfo::initialise-capability error:" << capabilityErr);
- return;
- }
-
- //Initialize imei,imsi, manufacturer
- TRequestStatus phoneInforeqstatus;
- RMobilePhone::TMobilePhoneIdentityV1 mobilePhoneIdentity;
- m_rmobilePhone.GetPhoneId(phoneInforeqstatus, mobilePhoneIdentity);
- User::WaitForRequest(phoneInforeqstatus);
- if ( phoneInforeqstatus == KErrNone ) {
- m_model = QString::fromUtf16(mobilePhoneIdentity.iModel.Ptr(), mobilePhoneIdentity.iModel.Length());
- m_manufacturer = QString::fromUtf16(mobilePhoneIdentity.iManufacturer.Ptr(), mobilePhoneIdentity.iManufacturer.Length());
- m_imei = QString::fromUtf16(mobilePhoneIdentity.iSerialNumber.Ptr(), mobilePhoneIdentity.iSerialNumber.Length());
- TRACES ( qDebug() << "CPhoneInfov2::Model:" << m_model);
- TRACES ( qDebug() << "CPhoneInfov2::Manufacturer:" << m_manufacturer);
- TRACES ( qDebug() << "CPhoneInfov2::Imei:" << m_imei);
- m_phoneInfoinitialised = true;
- }
-
- TRACES (qDebug() << "CPhoneInfov2::Initialise-->");
-}
-
-QString CPhoneInfo::imei()
-{
- TRACES (qDebug() << "query CPhoneInfov2::IMEI" << m_imei);
- initialise();
- return m_imei;
-}
-
-QString CPhoneInfo::manufacturer()
-{
- TRACES (qDebug() << "query CPhoneInfov2::manufacturer" << m_manufacturer);
- initialise();
- return m_manufacturer;
-}
-
-QString CPhoneInfo::model()
-{
- TRACES (qDebug() << "query CPhoneInfov2::model" << m_model);
- initialise();
- return m_model;
-}
-
-CSubscriberInfo::CSubscriberInfo(RMobilePhone &aMobilePhone):
- m_rmobilePhone(aMobilePhone),m_subscriberInfoinitialised(false)
-{
- TRACES (qDebug() << "CSubscriberInfov2::Constructor<--");
- TRACES (qDebug() << "CSubscriberInfov2::Constructor-->");
-}
-
-CSubscriberInfo::~CSubscriberInfo()
-{
- TRACES (qDebug() << "CSubscriberInfov2::Destructor<--");
- TRACES (qDebug() << "CSubscriberInfo2::Destructor-->");
-}
-
-void CSubscriberInfo::initialise()
-{
- TRACES (qDebug() << "CSubscriberInfov2::Initialise<--");
-
- if (m_subscriberInfoinitialised)
- {
- TRACES(qDebug() << "CSubscriberInfov2 already initialised, return");
- return;
- }
-
- //RMobilePhone implementation
- //check for identity capabilities
- TUint32 identityCaps;
- TInt capabilityErr = m_rmobilePhone.GetIdentityCaps(identityCaps);
- if (capabilityErr != KErrNone)
- {
- TRACES ( qDebug() << "CSubscriberInfo::initialise-capability error:" << capabilityErr);
- return;
- }
-
- //Initialize imei,imsi, manufacturer
- TRequestStatus subscriberInforeqstatus;
- RMobilePhone::TMobilePhoneSubscriberId subscriberId;
- m_rmobilePhone.GetSubscriberId(subscriberInforeqstatus, subscriberId);
- User::WaitForRequest(subscriberInforeqstatus);
- if ( subscriberInforeqstatus == KErrNone ) {
- m_imsi = QString::fromUtf16(subscriberId.Ptr(), subscriberId.Length());
- TRACES ( qDebug() << "CSubscriberInfov2::Initialise.Imsi:" << m_imsi);
- m_subscriberInfoinitialised = true;
- }
-
- TRACES (qDebug() << "CSubscriberInfov2::Initialise-->");
-}
-
-QString CSubscriberInfo::imsi()
-{
- TRACES (qDebug() << "query CSubscriberInfov2::IMSI" << m_imsi);
- initialise();
- return m_imsi;
-}
-
-CEtelInfo::CEtelInfo(RMobilePhone &aMobilePhone):CActive(EPriorityStandard),
- m_rmobilePhone(aMobilePhone),m_initialised(false)
-{
- CActiveScheduler::Add(this);
-}
-
-CEtelInfo::~CEtelInfo()
-{
-}
-
-void CEtelInfo::addObserver(MTelephonyInfoObserver *observer)
-{
- m_observers.append(observer);
-}
-
-void CEtelInfo::removeObserver(MTelephonyInfoObserver *observer)
-{
- m_observers.removeOne(observer);
-}
-
-CBatteryInfo::CBatteryInfo(RMobilePhone &aMobilePhone)
- : CEtelInfo(aMobilePhone),m_batteryLevel(0)
-{
- TRACES ( qDebug() << "CBatteryInfov2::constructor<--" );
- initialise();
- TRACES ( qDebug() << "CBatteryInfov2::constructor-->" );
-}
-
-void CBatteryInfo::initialise()
-{
- TRACES (qDebug() << "CBatteryInfov2::initialise<--");
- if (m_initialised)
- {
- TRACES (qDebug() << "CBatteryInfov2 already initialised,return");
- return;
- }
- //Check BatteryCaps
- TUint32 batteryCaps;
- TInt batteryCapserror = m_rmobilePhone.GetBatteryCaps(batteryCaps);
- if ( batteryCapserror != KErrNone) TRACES ( qDebug() << "CBatteryInfo::initialise-capability error:" << batteryCapserror);
-
- if ( batteryCapserror == KErrNone && (batteryCaps & RMobilePhone::KCapsGetBatteryInfo) ) {
- TRequestStatus batterystatus;
- m_rmobilePhone.GetBatteryInfo(batterystatus, m_batteryinfo);
- User::WaitForRequest(batterystatus);
- if (batterystatus == KErrNone){
- m_batteryLevel = m_batteryinfo.iChargeLevel;
- TRACES(qDebug() << "CBatteryInfov2:Initial chargelevel:" << m_batteryLevel);
- m_initialised = true;
- }
- }
-
- if ( batteryCapserror == KErrPermissionDenied)
- {
- m_initialised = true;
- return;
- }
-
- if (batteryCaps & RMobilePhone::KCapsNotifyBatteryInfoChange) startMonitoring();
-
- TRACES (qDebug() << "CBatteryInfov2::initialise-->");
-}
-
-CBatteryInfo::~CBatteryInfo()
-{
- Cancel();
-}
-
-void CBatteryInfo::DoCancel()
-{
- TRACES ( qDebug() << "CBatteryInfov2::DoCancel<--" );
- if (IsActive())
- m_rmobilePhone.CancelAsyncRequest(EMobilePhoneNotifyBatteryInfoChange);
- TRACES ( qDebug() << "CBatteryInfov2::DoCancel-->" );
-}
-
-void CBatteryInfo::RunL()
-{
- TRACES(qDebug() << "CBatteryInfov2::RunL()<---");
- if (iStatus == KErrNone)
- {
- if ( m_batteryLevel != m_batteryinfo.iChargeLevel ) {
- foreach (MTelephonyInfoObserver *observer, m_observers) {
- TRACES (qDebug() << "Notifying batteryLevelChanged");
- observer->batteryLevelChanged();
- }
- }
- m_batteryLevel = m_batteryinfo.iChargeLevel;
- }
-
- if (iStatus == KErrPermissionDenied) {
- return; //No monitoring required
- }
- startMonitoring();
- TRACES(qDebug() << "CBatteryInfov2::RunL()--->");
-}
-
-void CBatteryInfo::startMonitoring()
-{
- TRACES(qDebug() << "CBatteryInfov2::StartMonitoring--start");
- if (!IsActive()) {
- m_rmobilePhone.NotifyBatteryInfoChange(iStatus, m_batteryinfo);
- SetActive();
- }
- TRACES(qDebug() << "CBatteryInfov2::StartMonitoring--End");
-}
-
-int CBatteryInfo::batteryLevel() const
-{
- TRACES (qDebug() << "CBatteryInfov2::batteryLevel:" << m_batteryLevel);
- return m_batteryLevel;
-}
-
-//Signal Strength
-CCellSignalStrengthInfo::CCellSignalStrengthInfo(RMobilePhone &aMobilePhone)
- :CEtelInfo(aMobilePhone)
-{
- TRACES(qDebug() << "CCellSignalStrengthInfov2::CCellSignalStrengthInfov2<---");
- initialise();
- TRACES(qDebug() << "CCellSignalStrengthInfov2::CCellSignalStrengthInfov2--->");
-}
-
-void CCellSignalStrengthInfo::initialise()
-{
- TRACES (qDebug() << "CCellSignalStrengthInfov2::initialise<--");
- if (m_initialised)
- {
- TRACES (qDebug() << "CCellSignalStrengthInfov2 already initialised,return");
- return;
- }
- //Check Signal related Caps
- TUint32 signalCaps;
- TInt signalCapserror = m_rmobilePhone.GetSignalCaps(signalCaps);
- if ( signalCapserror != KErrNone) TRACES ( qDebug() << "CCellSignalStrengthInfo::initialise-capability error:" << signalCapserror);
-
- if (signalCapserror == KErrNone)
- {
- TRequestStatus signalstatus;
- if (signalCaps & RMobilePhone::KCapsGetSignalStrength)
- {
- m_rmobilePhone.GetSignalStrength(signalstatus, m_cellNetworkSignalStrength, m_signalBar);
- User::WaitForRequest(signalstatus);
- if ( signalstatus == KErrNone ) {
- //m_prevcellNetworkSignalStrength = m_cellNetworkSignalStrength;
- m_prevsignalBar = m_signalBar;
- m_initialised = true;
- }
- }
- }
-
- if ( signalCapserror == KErrPermissionDenied)
- {
- m_initialised = true;
- return;
- }
-
- if (signalCaps & RMobilePhone::KCapsNotifySignalStrengthChange) startMonitoring();
- TRACES (qDebug() << "CCellSignalStrengthInfov2::initialise-->");
-}
-
-CCellSignalStrengthInfo::~CCellSignalStrengthInfo()
-{
- Cancel();
-}
-
-void CCellSignalStrengthInfo::DoCancel()
-{
- TRACES ( qDebug() << "CCellSignalStrengthInfov2::DoCancel<--" );
- if (IsActive())
- m_rmobilePhone.CancelAsyncRequest(EMobilePhoneNotifySignalStrengthChange);
- TRACES ( qDebug() << "CCellSignalStrengthInfov2::DoCancel-->" );
-}
-
-void CCellSignalStrengthInfo::RunL()
-{
- TRACES(qDebug() << "CCellSignalStrengthInfov2::RunL()<---");
- if (iStatus == KErrNone)
- {
- if ( m_signalBar != m_prevsignalBar ) {
- foreach (MTelephonyInfoObserver *observer, m_observers) {
- TRACES (qDebug() << "Notifying cellNetworkSignalStrengthChanged");
- observer->cellNetworkSignalStrengthChanged();
- }
- }
- m_prevsignalBar = m_signalBar;
- }
-
- if (iStatus == KErrPermissionDenied) {
- return; //No monitoring required
- }
- startMonitoring();
- TRACES(qDebug() << "CCellSignalStrengthInfov2::RunL()--->");
-}
-
-void CCellSignalStrengthInfo::startMonitoring()
-{
- TRACES(qDebug() << "CCellSignalStrengthInfov2::StartMonitoring--start");
- if (!IsActive()) {
- m_rmobilePhone.NotifySignalStrengthChange(iStatus, m_cellNetworkSignalStrength, m_signalBar);
- SetActive();
- }
- TRACES(qDebug() << "CCellSignalStrengthInfov2::StartMonitoring--End");
-}
-
-int CCellSignalStrengthInfo::cellNetworkSignalStrength() const
-{
- TRACES(qDebug() << "CCellsignalstrengthv2::cellNetworkSignalStrength");
- return int((TReal(m_signalBar) * 100.0 + 0.5) / 7.0);
-}
-
-CCellNetworkRegistrationInfo::CCellNetworkRegistrationInfo(RMobilePhone &aMobilePhone):CEtelInfo(aMobilePhone)
-{
- TRACES(qDebug() << "CCellNetworkRegistrationInfov2::CCellNetworkRegistrationInfov2<---");
- initialise();
- TRACES(qDebug() << "CCellNetworkRegistrationInfov2::CCellNetworkRegistrationInfov2--->");
-}
-
-CCellNetworkRegistrationInfo::~CCellNetworkRegistrationInfo()
-{
- Cancel();
-}
-
-void CCellNetworkRegistrationInfo::initialise()
-{
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2::initialise<--");
- if (m_initialised)
- {
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2 already initialised,return");
- return;
- }
-
- TUint32 capsPhone;
- TInt capserror = m_rmobilePhone.GetMultimodeCaps(capsPhone);
- if ( capserror != KErrNone) TRACES ( qDebug() << "CCellNetworkRegistrationInfo::initialise-capability error:" << capserror);
- if (!capserror) {
- TRequestStatus reqStatus;
- m_rmobilePhone.GetNetworkRegistrationStatus(reqStatus, m_networkStatus);
- User::WaitForRequest(reqStatus);
- m_previousNetworkStatus = m_networkStatus;
- m_initialised = true;
- }
-
- if ( capserror == KErrPermissionDenied)
- {
- m_initialised = true;
- return;
- }
-
- startMonitoring();
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2::initialise-->");
-}
-
-void CCellNetworkRegistrationInfo::RunL()
-{
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2::RunL()<---");
- if (iStatus == KErrNone)
- {
- if ( m_networkStatus != m_previousNetworkStatus) {
- foreach (MTelephonyInfoObserver *observer, m_observers) {
- TRACES (qDebug() << "Notifying cellnetworkstatusChanged");
- observer->cellNetworkStatusChanged();
- }
- }
- m_previousNetworkStatus = m_networkStatus;
- }
-
- if (iStatus == KErrPermissionDenied) {
- return; //No monitoring required
- }
- startMonitoring();
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2::RunL()--->");
-}
-
-void CCellNetworkRegistrationInfo::startMonitoring()
-{
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2::StartMonitoring<---");
- if (!IsActive()) {
- m_rmobilePhone.NotifyNetworkRegistrationStatusChange(iStatus,m_networkStatus);
- SetActive();
- }
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2::StartMonitoring--->");
-}
-
-void CCellNetworkRegistrationInfo::DoCancel()
-{
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2::DoCancel");
- m_rmobilePhone.CancelAsyncRequest(EMobilePhoneNotifyNetworkRegistrationStatusChange);
-}
-
-RMobilePhone::TMobilePhoneRegistrationStatus CCellNetworkRegistrationInfo::cellNetworkStatus() const
-{
- TRACES (qDebug() << "CCellNetworkRegistrationInfov2::cellNetworkStatus:" << m_networkStatus);
- return m_networkStatus;
-}
-
-CCellNetworkInfo::CCellNetworkInfo(RMobilePhone &aMobilePhone)
- :CEtelInfo(aMobilePhone),iNetworkInfoPckg(iNetworkInfo)
-{
- TRACES(qDebug() << "CCellNetworkInfov2::CCellNetworkInfov2<---");
- initialise();
- TRACES(qDebug() << "CCellNetworkInfov2::CCellNetworkInfov2--->");
-}
-
-void CCellNetworkInfo::initialise()
-{
- TRACES (qDebug() << "CCellNetworkInfov2::initialise<--");
-
- if (m_initialised)
- {
- TRACES (qDebug() << "CCellNetworkInfov2 already initialised,return");
- return;
- }
-
- // Check Signal related Caps
- TUint32 networkCaps;
- TInt capserror = m_rmobilePhone.GetNetworkCaps(networkCaps);
- if ( capserror != KErrNone) TRACES ( qDebug() << "CCellNetworkInfo::initialise-capability error:" << capserror);
- if ( capserror == KErrNone && (networkCaps & RMobilePhone::KCapsGetCurrentNetwork))
- {
- //For cellid & location area code, networkid, countrycode
- TRequestStatus locationstatus;
- m_rmobilePhone.GetCurrentNetwork(locationstatus, iNetworkInfoPckg, iLocation);
- User::WaitForRequest(locationstatus);
- if ( locationstatus == KErrNone )
- {
- //cellid
- m_cellId = iLocation.iCellId;
- m_previouscellId = m_cellId;
-
- //location area code
- m_locationAreaCode = iLocation.iLocationAreaCode;
-
- //network id
- m_networkId = QString::fromUtf16(iNetworkInfo.iNetworkId.Ptr(), iNetworkInfo.iNetworkId.Length());
- m_previousNetworkId = m_networkId;
-
- //country code
- m_countryCode = QString::fromUtf16(iNetworkInfo.iCountryCode.Ptr(), iNetworkInfo.iCountryCode.Length());
- m_previousCountryCode = m_countryCode;
-
- //networkname
- RMobilePhone::TMobilePhoneNetworkLongName longName = iNetworkInfo.iLongName;
- if (longName.Length() > 0 ) {
- m_networkName = QString::fromUtf16(longName.Ptr(), longName.Length());
- } else {
- RMobilePhone::TMobilePhoneNetworkDisplayTag displayTag = iNetworkInfo.iDisplayTag;
- m_networkName = QString::fromUtf16(displayTag.Ptr(), displayTag.Length());
- }
- m_previousNetworkName = m_networkName;
- //network mode
- m_networkMode = iNetworkInfo.iMode;
- m_previousNetworkMode = m_networkMode;
- m_initialised = true;
- }
- }
-
- if (capserror == KErrPermissionDenied) {
- m_initialised = true;
- return;
- }
-
- if (networkCaps & RMobilePhone::KCapsNotifyCurrentNetwork) startMonitoring();
-
- TRACES (qDebug() << "CCellNetworkInfov2::initialise-->");
-}
-
-CCellNetworkInfo::~CCellNetworkInfo()
-{
- Cancel();
-}
-
-int CCellNetworkInfo::cellId() const
-{
- TRACES (qDebug() << "CCellNetworkInfov2::cellId():" << m_cellId);
- return m_cellId;
-}
-
-int CCellNetworkInfo::locationAreaCode() const
-{
- TRACES (qDebug() << "CCellNetworkInfov2::cellId():" << m_locationAreaCode);
- return m_locationAreaCode;
-}
-
-QString CCellNetworkInfo::countryCode() const
-{
- TRACES (qDebug() << "CCellNetworkInfov2::countryCode():" << m_countryCode);
- return m_countryCode;
-}
-
-QString CCellNetworkInfo::networkCode() const
-{
- TRACES (qDebug() << "CCellNetworkInfov2::networkCode():" << m_networkId);
- return m_networkId;
-}
-
-QString CCellNetworkInfo::networkName() const
-{
- TRACES (qDebug() << "CCellNetworkInfov2::networkName():" << m_networkName);
- return m_networkName;
-}
-
-QString CCellNetworkInfo::homeNetworkCode()
-{
- TRequestStatus homenetworkstatus;
- RMobilePhone::TMobilePhoneNetworkInfoV1 infov1;
- RMobilePhone::TMobilePhoneNetworkInfoV1Pckg statusPkg(infov1);
- m_rmobilePhone.GetHomeNetwork(homenetworkstatus, statusPkg);
- User::WaitForRequest(homenetworkstatus);
- if (homenetworkstatus.Int() == KErrNone)
- {
- QString homeNetworkCode= QString::fromUtf16(infov1.iNetworkId.Ptr(), infov1.iNetworkId.Length());
- return homeNetworkCode;
- }
- else
- return QString();
-}
-
-CTelephony::TNetworkMode CCellNetworkInfo::networkMode() const
-{
- TRACES (qDebug() << "CCellNetworkInfov2::networkMode():" << m_networkMode);
- switch (m_networkMode){
- case RMobilePhone::ENetworkModeUnregistered:
- return CTelephony::ENetworkModeUnregistered;
- case RMobilePhone::ENetworkModeGsm:
- return CTelephony::ENetworkModeGsm;
- case RMobilePhone::ENetworkModeAmps:
- return CTelephony::ENetworkModeAmps;
- case RMobilePhone::ENetworkModeCdma95:
- return CTelephony::ENetworkModeCdma95;
- case RMobilePhone::ENetworkModeCdma2000:
- return CTelephony::ENetworkModeCdma2000;
- case RMobilePhone::ENetworkModeWcdma:
- return CTelephony::ENetworkModeWcdma;
- /*case RMobilePhone::ENetworkModeTdcdma:
- return CTelephony::ENetworkModeTdcdma;*/
- default:
- return CTelephony::ENetworkModeUnknown;
- }
-}
-
-void CCellNetworkInfo::DoCancel()
-{
- TRACES ( qDebug() << "CCellNetworkInfov2::DoCancel<--" );
- if (IsActive())
- m_rmobilePhone.CancelAsyncRequest(EMobilePhoneNotifyCurrentNetworkChange);
- TRACES ( qDebug() << "CCellNetworkInfov2::DoCancel-->" );
-}
-
-void CCellNetworkInfo::RunL()
-{
- TRACES(qDebug() << "CCellNetworkInfov2::RunL()<---");
- if (iStatus == KErrNone)
- {
- //cellid
- m_cellId = iLocation.iCellId;
-
- //location area code
- m_locationAreaCode = iLocation.iLocationAreaCode;
-
- //network id
- m_networkId = QString::fromUtf16(iNetworkInfo.iNetworkId.Ptr(), iNetworkInfo.iNetworkId.Length());
-
- //country code
- m_countryCode = QString::fromUtf16(iNetworkInfo.iCountryCode.Ptr(), iNetworkInfo.iCountryCode.Length());
-
- //networkname
- RMobilePhone::TMobilePhoneNetworkLongName longName = iNetworkInfo.iLongName;
- if (longName.Length() > 0 ) {
- m_networkName = QString::fromUtf16(longName.Ptr(), longName.Length());
- } else {
- RMobilePhone::TMobilePhoneNetworkDisplayTag displayTag = iNetworkInfo.iDisplayTag;
- m_networkName = QString::fromUtf16(displayTag.Ptr(), displayTag.Length());
- }
-
- //network mode
- m_networkMode = iNetworkInfo.iMode;
-
- foreach (MTelephonyInfoObserver *observer, m_observers)
- {
- if (m_networkId != m_previousNetworkId) {
- TRACES (qDebug() << "Notifying networkcodechanged");
- observer->networkCodeChanged();
- }
- if (m_countryCode != m_previousCountryCode) {
- TRACES (qDebug() << "Notifying countryCodeChanged");
- observer->countryCodeChanged();
- }
- if (m_networkName != m_previousNetworkName) {
- TRACES (qDebug() << "Notifying networkNameChanged");
- observer->networkNameChanged();
- }
- if (m_networkMode != m_previousNetworkMode) {
- TRACES (qDebug() << "Notifying networkModeChanged");
- observer->networkModeChanged();
- }
- if (m_cellId != m_previouscellId) {
- TRACES (qDebug() << "Notifying cellId changes");
- observer->changedCellId(m_cellId);
- }
- }
- m_previouscellId = m_cellId;
- m_previousNetworkId = m_networkId;
- m_previousCountryCode = m_countryCode;
- m_previousNetworkName = m_networkName;
- m_previousNetworkMode = m_networkMode;
- }
-
- if (iStatus != KErrPermissionDenied) {
- // NotifyCurrentNetworkChange requires ReadDeviceData so don't retry if app does not
- // have required capabilities
- startMonitoring();
- }
- TRACES(qDebug() << "CCellNetworkInfov2::RunL()--->");
-}
-
-void CCellNetworkInfo::startMonitoring()
-{
- TRACES(qDebug() << "CCellNetworkInfov2::StartMonitoring--start");
- if (!IsActive()) {
- m_rmobilePhone.NotifyCurrentNetworkChange(iStatus, iNetworkInfoPckg, iLocation);
- SetActive();
- }
- TRACES(qDebug() << "CCellNetworkInfov2::StartMonitoring--End");
-}
-
-#endif
diff --git a/src/systeminfo/symbian/telephonyinfo_s60.h b/src/systeminfo/symbian/telephonyinfo_s60.h
index 4059addb48..6c40a7b403 100644
--- a/src/systeminfo/symbian/telephonyinfo_s60.h
+++ b/src/systeminfo/symbian/telephonyinfo_s60.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010-2012 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,20 +39,15 @@
**
****************************************************************************/
-#ifndef TELEPHONY_S60_H
-#define TELEPHONY_S60_H
+#ifndef DEVICEINFO_H
+#define DEVICEINFO_H
#include <e32base.h>
#include <etel3rdparty.h>
#include <QString>
#include <QList>
-#include <QStack>
#include <QEventLoop>
-#include <qDebug>
#include "trace.h"
-#ifdef ETELMM_SUPPORTED
-#include <etelmm.h>
-#endif
class CActiveSchedulerWait;
@@ -71,7 +66,6 @@ public:
virtual void changedCellId(int) = 0;
};
-#ifndef ETELMM_SUPPORTED
class CTelephonyInfo : public CActive
{
public:
@@ -81,14 +75,16 @@ public:
void addObserver(MTelephonyInfoObserver *observer);
void removeObserver(MTelephonyInfoObserver *observer);
+protected: //from CActive
+ void RunL();
+
protected:
- void waitForRequest() const;
- void exitWait() const;
+ void makeRequest();
protected:
CTelephony &m_telephony;
QList<MTelephonyInfoObserver *> m_observers;
- mutable QStack<QEventLoop*> m_loops;
+ QEventLoop* iEventLoop;
};
class CPhoneInfo : public CTelephonyInfo
@@ -98,19 +94,16 @@ public:
~CPhoneInfo();
protected:
- void RunL();
void DoCancel();
public:
- QString imei();
- QString manufacturer();
- QString model();
+ QString imei() const;
+ QString manufacturer() const;
+ QString model() const;
private:
- void makeRequest();
- bool m_initializing;
- mutable CTelephony::TPhoneIdV1 m_phoneIdV1;
- mutable CTelephony::TPhoneIdV1Pckg m_phoneIdV1Pckg;
+ CTelephony::TPhoneIdV1 m_phoneIdV1;
+ CTelephony::TPhoneIdV1Pckg m_phoneIdV1Pckg;
QString m_imei;
QString m_manufacturer;
@@ -124,17 +117,14 @@ public:
~CSubscriberInfo();
protected:
- void RunL();
void DoCancel();
public:
- QString imsi();
+ QString imsi() const;
private:
- void makeRequest();
- bool m_initializing;
- mutable CTelephony::TSubscriberIdV1 m_subscriberIdV1;
- mutable CTelephony::TSubscriberIdV1Pckg m_subscriberIdV1Pckg;
+ CTelephony::TSubscriberIdV1 m_subscriberIdV1;
+ CTelephony::TSubscriberIdV1Pckg m_subscriberIdV1Pckg;
QString m_imsi;
};
@@ -258,168 +248,5 @@ private:
int m_signalBar;
int m_previousSignalBar;
};
-#else //ETELMM_SUPPORTED
-class CPhoneInfo : public CBase
-{
-public:
- CPhoneInfo(RMobilePhone &aMobilePhone);
- ~CPhoneInfo();
- void initialise();
-
-public:
- QString imei();
- QString manufacturer();
- QString model();
-
-private:
- RMobilePhone &m_rmobilePhone;
- bool m_phoneInfoinitialised;
- QString m_imei;
- QString m_manufacturer;
- QString m_model;
-};
-
-class CSubscriberInfo : public CBase
-{
-public:
- CSubscriberInfo(RMobilePhone &aMobilePhone);
- ~CSubscriberInfo();
- void initialise();
-
-public:
- QString imsi();
-
-private:
- RMobilePhone &m_rmobilePhone;
- bool m_subscriberInfoinitialised;
- QString m_imsi;
-};
-
-
-class CEtelInfo : public CActive
-{
-public:
- CEtelInfo(RMobilePhone &aMobilePhone);
- ~CEtelInfo();
- void addObserver(MTelephonyInfoObserver *observer);
- void removeObserver(MTelephonyInfoObserver *observer);
-
-protected:
- RMobilePhone &m_rmobilePhone;
- QList<MTelephonyInfoObserver *> m_observers;
- bool m_initialised;
-};
-
-
-class CBatteryInfo : public CEtelInfo
-{
-public:
- CBatteryInfo(RMobilePhone &aMobilePhone);
- ~CBatteryInfo();
- void initialise();
- void startMonitoring();
-
-protected:
- void RunL();
- void DoCancel();
-
-public:
- int batteryLevel() const;
-
-private:
- int m_batteryLevel;
- RMobilePhone::TMobilePhoneBatteryInfoV1 m_batteryinfo;
-};
-
-
-class CCellSignalStrengthInfo : public CEtelInfo
-{
-public:
- CCellSignalStrengthInfo(RMobilePhone &aMobilePhone);
- ~CCellSignalStrengthInfo();
- void initialise();
- void startMonitoring();
-
-protected:
- void RunL();
- void DoCancel();
-
-public:
- int cellNetworkSignalStrength() const;
-
-private:
- TInt32 m_cellNetworkSignalStrength;
- TInt8 m_signalBar;
- TInt32 m_prevcellNetworkSignalStrength;
- TInt8 m_prevsignalBar;
-};
-
-class CCellNetworkRegistrationInfo : public CEtelInfo
-{
-public:
- CCellNetworkRegistrationInfo(RMobilePhone &aMobilePhone);
- ~CCellNetworkRegistrationInfo();
- void initialise();
- void startMonitoring();
-
-protected:
- void RunL();
- void DoCancel();
-
-public:
- RMobilePhone::TMobilePhoneRegistrationStatus cellNetworkStatus() const;
-
-private:
- RMobilePhone::TMobilePhoneRegistrationStatus m_networkStatus;
- RMobilePhone::TMobilePhoneRegistrationStatus m_previousNetworkStatus;
-};
-
-class CCellNetworkInfo : public CEtelInfo
-{
-public:
- CCellNetworkInfo(RMobilePhone &aMobilePhone);
- ~CCellNetworkInfo();
- void initialise();
- void startMonitoring();
-
-protected:
- void RunL();
- void DoCancel();
-
-public:
- int cellId() const;
- int locationAreaCode() const;
-
- QString countryCode() const;
- QString networkCode() const;
- QString networkName() const;
- QString homeNetworkCode();
- CTelephony::TNetworkMode networkMode() const;/*RMobilePhone::TMobilePhoneNetworkMode <=> CTelePhony::TNetworkMode*/
-
-private:
- /** Network info of mobile phone. */
- RMobilePhone::TMobilePhoneNetworkInfoV1 iNetworkInfo;
- /** Location of mobile phone. */
- RMobilePhone::TMobilePhoneLocationAreaV1 iLocation;
- /** Packaged network info object. */
- RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iNetworkInfoPckg;
-
- int m_cellId;
- int m_previouscellId;
- int m_locationAreaCode;
-
- QString m_networkId;
- QString m_previousNetworkId;
-
- QString m_countryCode;
- QString m_previousCountryCode;
-
- QString m_networkName;
- QString m_previousNetworkName;
-
- RMobilePhone::TMobilePhoneNetworkMode m_networkMode;
- RMobilePhone::TMobilePhoneNetworkMode m_previousNetworkMode;
-};
-#endif //End ETELMM_SUPPORTED
-#endif //TELEPHONY_S60_H
+#endif //DEVICEINFO_H
diff --git a/src/systeminfo/symbian/tsrc/threadtests/threadtests.pro b/src/systeminfo/symbian/tsrc/threadtests/threadtests.pro
deleted file mode 100644
index 77db750722..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/threadtests.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += tst_CreateDifferentInfosInDifferentThreads \
- tst_CreateSameInfosInDifferentThreads \
- tst_CreateInfoOutsideMainThread \
- tst_MoveInfosToDifferentThreads \
- tst_RecreateInfosInDifferentThreads
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateDifferentInfosInDifferentThreads/tst_CreateDifferentInfosInDifferentThreads.cpp b/src/systeminfo/symbian/tsrc/threadtests/tst_CreateDifferentInfosInDifferentThreads/tst_CreateDifferentInfosInDifferentThreads.cpp
deleted file mode 100644
index 21a0f836c8..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateDifferentInfosInDifferentThreads/tst_CreateDifferentInfosInDifferentThreads.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <qsysteminfo.h>
-
-QTM_USE_NAMESPACE
-
-//#define SHOWDEBUGS
-
-QSemaphore MainThreadRunningSemaphore;
-
-class Thread : public QThread
-{
- Q_OBJECT
-public:
- void run() {
-#ifdef SHOWDEBUGS
- qDebug()<<"Thread::run - create QSystemNetworkInfo - running in thread: "<<thread()->currentThreadId();
-#endif//SHOWDEBUGS
- QSystemNetworkInfo networkInfo;
- MainThreadRunningSemaphore.release();
- }
-};
-
-class tst_QSystemInfo_CreateDifferentInfosInDifferentThreads : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
- void testCase() {
-#ifdef SHOWDEBUGS
- qDebug()<<"CreateInfosInDifferentThreads::testCase - create QSystemDeviceInfo - running in thread: "<<thread()->currentThreadId();
-#endif//SHOWDEBUGS
- QSystemDeviceInfo deviceInfo;
- Thread testThread;
- testThread.start();
- MainThreadRunningSemaphore.acquire();
- testThread.wait();
- }
-};
-
-QTEST_MAIN(tst_QSystemInfo_CreateDifferentInfosInDifferentThreads);
-
-#include "tst_CreateDifferentInfosInDifferentThreads.moc"
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateDifferentInfosInDifferentThreads/tst_CreateDifferentInfosInDifferentThreads.pro b/src/systeminfo/symbian/tsrc/threadtests/tst_CreateDifferentInfosInDifferentThreads/tst_CreateDifferentInfosInDifferentThreads.pro
deleted file mode 100644
index 4792323ecd..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateDifferentInfosInDifferentThreads/tst_CreateDifferentInfosInDifferentThreads.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = tst_CreateDifferentInfosInDifferentThreads
-CONFIG+=testcase
-
-SOURCES += tst_CreateDifferentInfosInDifferentThreads.cpp
-QT = core network
-INCLUDEPATH += ../../../../../src/systeminfo
-
-include(../../../../../../common.pri)
-CONFIG += mobility
-MOBILITY = systeminfo
-
-symbian {
- TARGET.CAPABILITY = All -TCB -DRM
-} \ No newline at end of file
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateInfoOutsideMainThread/tst_CreateInfoOutsideMainThread.cpp b/src/systeminfo/symbian/tsrc/threadtests/tst_CreateInfoOutsideMainThread/tst_CreateInfoOutsideMainThread.cpp
deleted file mode 100644
index 297bacf04a..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateInfoOutsideMainThread/tst_CreateInfoOutsideMainThread.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <qsysteminfo.h>
-
-QTM_USE_NAMESPACE
-
-#define SHOWDEBUGS
-
-QSemaphore MainThreadRunningSemaphore;
-QSemaphore OtherThreadRunningSemaphore;
-
-class ThreadBase : public QThread
-{
- Q_OBJECT
-public:
-
- void run() {
-#ifdef SHOWDEBUGS
- qDebug()<<"Thread::run - create object in thread: "<<thread()->currentThreadId();
-#endif//SHOWDEBUGS
- construct();
-#if 0
- qDebug()<<"Thread::run - read something directly from object in this thread: "
- <<networkInfo.currentMode();
-#endif//SHOWDEBUGS
- MainThreadRunningSemaphore.release();
- }
-
- virtual void construct() = 0;
-};
-
-class QSystemBatteryInfoThread : public ThreadBase
-{
- void construct() {
- QSystemBatteryInfo info;
- }
-};
-
-class QSystemDeviceInfoThread : public ThreadBase
-{
- void construct() {
- QSystemDeviceInfo info;
- }
-};
-
-class QSystemInfoThread : public ThreadBase
-{
- void construct() {
- QSystemInfo info;
- }
-};
-
-class QSystemNetworkInfoThread : public ThreadBase
-{
- void construct() {
- QSystemNetworkInfo info;
- }
-};
-
-class QSystemScreenSaverThread : public ThreadBase
-{
- void construct() {
- QSystemScreenSaver info;
- }
-};
-
-class QSystemStorageInfoThread : public ThreadBase
-{
- void construct() {
- QSystemStorageInfo info;
- }
-};
-
-class tst_QSystemInfo_CreateInfoOutsideMainThread : public QObject
-{
- Q_OBJECT
-
-private:
- void runThread(ThreadBase& testThread) {
- testThread.start();
- MainThreadRunningSemaphore.acquire();
- OtherThreadRunningSemaphore.release();
- testThread.wait();
- }
-
- void logThread(const QString message) {
-#ifdef SHOWDEBUGS
- qDebug() << message << thread()->currentThreadId();
-#endif//SHOWDEBUGS
- }
-
-private Q_SLOTS:
- void testBatteryInfo() {
- logThread("running in thread:");
- QSystemBatteryInfoThread testThread;
- runThread(testThread);
- }
-
- void testDeviceInfo() {
- logThread("running in thread:");
- QSystemDeviceInfoThread testThread;
- runThread(testThread);
- }
-
- void testInfo() {
- logThread("running in thread:");
- QSystemInfoThread testThread;
- runThread(testThread);
- }
-
- void testNetworkInfo() {
- logThread("running in thread:");
- QSystemNetworkInfoThread testThread;
- runThread(testThread);
- }
-
- void testScreenSaver() {
- logThread("running in thread:");
- QSystemScreenSaverThread testThread;
- runThread(testThread);
- }
-
- void testStorageInfo() {
- logThread("running in thread:");
- QSystemStorageInfoThread testThread;
- runThread(testThread);
- }
-};
-
-QTEST_MAIN(tst_QSystemInfo_CreateInfoOutsideMainThread);
-
-#include "tst_CreateInfoOutsideMainThread.moc"
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateInfoOutsideMainThread/tst_CreateInfoOutsideMainThread.pro b/src/systeminfo/symbian/tsrc/threadtests/tst_CreateInfoOutsideMainThread/tst_CreateInfoOutsideMainThread.pro
deleted file mode 100644
index 560371e006..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateInfoOutsideMainThread/tst_CreateInfoOutsideMainThread.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = tst_CreateInfoOutsideMainThread
-CONFIG+=testcase
-
-SOURCES += tst_CreateInfoOutsideMainThread.cpp
-QT = core network
-INCLUDEPATH += ../../../../../src/systeminfo
-
-include(../../../../../../common.pri)
-CONFIG += mobility
-MOBILITY = systeminfo
-
-symbian {
- TARGET.CAPABILITY = All -TCB -DRM
-} \ No newline at end of file
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateSameInfosInDifferentThreads/tst_CreateSameInfosInDifferentThreads.cpp b/src/systeminfo/symbian/tsrc/threadtests/tst_CreateSameInfosInDifferentThreads/tst_CreateSameInfosInDifferentThreads.cpp
deleted file mode 100644
index 8f29029399..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateSameInfosInDifferentThreads/tst_CreateSameInfosInDifferentThreads.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <qsysteminfo.h>
-
-QTM_USE_NAMESPACE
-
-//#define SHOWDEBUGS
-
-QSemaphore MainThreadRunningSemaphore;
-QSemaphore OtherThreadRunningSemaphore;
-
-class Thread : public QThread
-{
- Q_OBJECT
-public:
- void run() {
-#ifdef SHOWDEBUGS
- qDebug()<<"Thread::run - create same object also in thread: "<<thread()->currentThreadId();
-#endif//SHOWDEBUGS
- QSystemNetworkInfo networkInfo;
-#ifdef SHOWDEBUGS
- qDebug()<<"Thread::run - read something directly from object in this thread: "
- <<networkInfo.currentMode();
-#endif//SHOWDEBUGS
- MainThreadRunningSemaphore.release();
- }
-};
-
-class tst_QSystemInfo_CreateSameInfosInDifferentThreads : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
- void testCase() {
-#ifdef SHOWDEBUGS
- qDebug()<<"tst_QSystemInfo_CreateSameInfosInDifferentThreads::testCase - create objects - running in thread: "<<thread()->currentThreadId();
-#endif//SHOWDEBUGS
- QSystemNetworkInfo networkInfo;
- Thread testThread;
- testThread.start();
- MainThreadRunningSemaphore.acquire();
-#ifdef SHOWDEBUGS
- qDebug()<<"tst_QSystemInfo_CreateSameInfosInDifferentThreads::testCase - read something directly from object in this thread: "
- <<networkInfo.currentMode();
-#endif//SHOWDEBUGS
- OtherThreadRunningSemaphore.release();
- testThread.wait();
- }
-};
-
-QTEST_MAIN(tst_QSystemInfo_CreateSameInfosInDifferentThreads);
-
-#include "tst_CreateSameInfosInDifferentThreads.moc"
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateSameInfosInDifferentThreads/tst_CreateSameInfosInDifferentThreads.pro b/src/systeminfo/symbian/tsrc/threadtests/tst_CreateSameInfosInDifferentThreads/tst_CreateSameInfosInDifferentThreads.pro
deleted file mode 100644
index 91db780c32..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_CreateSameInfosInDifferentThreads/tst_CreateSameInfosInDifferentThreads.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = tst_CreateSameInfosInDifferentThreads
-CONFIG+=testcase
-
-SOURCES += tst_CreateSameInfosInDifferentThreads.cpp
-QT = core network
-INCLUDEPATH += ../../../../../src/systeminfo
-
-include(../../../../../../common.pri)
-CONFIG += mobility
-MOBILITY = systeminfo
-
-symbian {
- TARGET.CAPABILITY = All -TCB -DRM
-} \ No newline at end of file
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_MoveInfosToDifferentThreads/tst_MoveInfosToDifferentThreads.cpp b/src/systeminfo/symbian/tsrc/threadtests/tst_MoveInfosToDifferentThreads/tst_MoveInfosToDifferentThreads.cpp
deleted file mode 100644
index e6999ad36f..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_MoveInfosToDifferentThreads/tst_MoveInfosToDifferentThreads.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <qsysteminfo.h>
-#include <qsystemdeviceinfo.h>
-
-QTM_USE_NAMESPACE
-
-//#define SHOWDEBUGS
-
-QSemaphore MainThreadRunningSemaphore;
-QSemaphore OtherThreadRunningSemaphore;
-
-class Thread : public QThread
-{
- Q_OBJECT
-public:
- Thread(QSystemDeviceInfo *deviceInfo, QSystemNetworkInfo *networkInfo)
- : mSysDeviceInfo(deviceInfo), mSysNetworkInfo(networkInfo) {}
-
- void run() {
-#ifdef SHOWDEBUGS
- qDebug()<<"Thread::run - running in thread: "<<thread()->currentThreadId();
- qDebug()<<"Thread::run - read something directly from object in different thread: "
- <<mSysDeviceInfo->manufacturer();
- qDebug()<<"Thread::run - create a signal&slot connection";
-#endif//SHOWDEBUGS
- connect( mSysDeviceInfo, SIGNAL(batteryLevelChanged(int)),
- this, SLOT(testSlot()));
- MainThreadRunningSemaphore.release();
- OtherThreadRunningSemaphore.acquire();
-#ifdef SHOWDEBUGS
- qDebug()<<"ThreadU::run - read something directly from object moved to this thread: "
- <<mSysNetworkInfo->currentMode();
-#endif//SHOWDEBUGS
- MainThreadRunningSemaphore.release();
- }
-
-public slots:
- void testSlot() {
-#ifdef SHOWDEBUGS
- qDebug()<<"Thread::testSlot called - running in thread: "<<thread()->currentThreadId();
-#endif//SHOWDEBUGS
- }
-
-public:
- QSystemDeviceInfo *mSysDeviceInfo;
- QSystemNetworkInfo *mSysNetworkInfo;
-};
-
-class tst_QSystemInfo_MoveInfosToDifferentThreads : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
- void testCase() {
-#ifdef SHOWDEBUGS
- qDebug()<<"tst_QSystemInfo_MoveInfosToDifferentThreads::testCase - create objects - running in thread: "<<thread()->currentThreadId();
-#endif//SHOWDEBUGS
- QSystemDeviceInfo deviceInfo;
- QSystemNetworkInfo networkInfo;
- Thread testThread(&deviceInfo, &networkInfo);
- testThread.start();
- MainThreadRunningSemaphore.acquire();
-#ifdef SHOWDEBUGS
- qDebug()<<"tst_QSystemInfo_MoveInfosToDifferentThreads::testCase - move objects to other thread";
-#endif//SHOWDEBUGS
- deviceInfo.moveToThread(&testThread);
- networkInfo.moveToThread(&testThread);
- OtherThreadRunningSemaphore.release();
- MainThreadRunningSemaphore.acquire();
-#ifdef SHOWDEBUGS
- qDebug()<<"tst_QSystemInfo_MoveInfosToDifferentThreads::testCase - read something directly from object moved to other thread: "
- <<deviceInfo.productName();
-#endif//SHOWDEBUGS
- OtherThreadRunningSemaphore.release();
- testThread.wait();
- }
-};
-
-QTEST_MAIN(tst_QSystemInfo_MoveInfosToDifferentThreads);
-
-#include "tst_MoveInfosToDifferentThreads.moc"
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_MoveInfosToDifferentThreads/tst_MoveInfosToDifferentThreads.pro b/src/systeminfo/symbian/tsrc/threadtests/tst_MoveInfosToDifferentThreads/tst_MoveInfosToDifferentThreads.pro
deleted file mode 100644
index 1610a59599..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_MoveInfosToDifferentThreads/tst_MoveInfosToDifferentThreads.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TARGET = tst_MoveInfosToDifferentThreads
-CONFIG+=testcase
-
-SOURCES += tst_MoveInfosToDifferentThreads.cpp
-QT = core network
-INCLUDEPATH += ../../../../../src/systeminfo
-
-include(../../../../../../common.pri)
-CONFIG += mobility
-MOBILITY = systeminfo
-
-symbian {
- TARGET.CAPABILITY = All -TCB -DRM
-} \ No newline at end of file
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_RecreateInfosInDifferentThreads/tst_RecreateInfosInDifferentThreads.cpp b/src/systeminfo/symbian/tsrc/threadtests/tst_RecreateInfosInDifferentThreads/tst_RecreateInfosInDifferentThreads.cpp
deleted file mode 100644
index fed91ff45b..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_RecreateInfosInDifferentThreads/tst_RecreateInfosInDifferentThreads.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <qsysteminfo.h>
-
-QTM_USE_NAMESPACE
-
-//#define SHOWDEBUGS
-
-QSemaphore MainThreadRunningSemaphore;
-QSemaphore OtherThreadRunningSemaphore;
-
-void createAndDeleteNetworkInfo() {
- QSystemNetworkInfo networkInfo;
-#ifdef SHOWDEBUGS
- qDebug()<<"createAndDeleteNetworkInfo - create and delete in thread: "<<networkInfo.thread()->currentThreadId();
-#endif//SHOWDEBUGS
- }
-
-class Thread : public QThread
-{
- Q_OBJECT
-public:
- void run() {
- createAndDeleteNetworkInfo();
- createAndDeleteNetworkInfo();
- MainThreadRunningSemaphore.release();
- }
-};
-
-class tst_QSystemInfo_RecreateInfosInDifferentThreads : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
- void testCase() {
-#ifdef SHOWDEBUGS
- qDebug()<<"tst_QSystemInfo_RecreateInfosInDifferentThreads::testCase - running in thread: "<<thread()->currentThreadId();
-#endif//SHOWDEBUGS
- createAndDeleteNetworkInfo();
- Thread testThread;
- testThread.start();
- MainThreadRunningSemaphore.acquire();
- OtherThreadRunningSemaphore.release();
- testThread.wait();
- }
-};
-
-QTEST_MAIN(tst_QSystemInfo_RecreateInfosInDifferentThreads);
-
-#include "tst_RecreateInfosInDifferentThreads.moc"
diff --git a/src/systeminfo/symbian/tsrc/threadtests/tst_RecreateInfosInDifferentThreads/tst_RecreateInfosInDifferentThreads.pro b/src/systeminfo/symbian/tsrc/threadtests/tst_RecreateInfosInDifferentThreads/tst_RecreateInfosInDifferentThreads.pro
deleted file mode 100644
index 2cc314c104..0000000000
--- a/src/systeminfo/symbian/tsrc/threadtests/tst_RecreateInfosInDifferentThreads/tst_RecreateInfosInDifferentThreads.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TARGET = tst_RecreateInfosInDifferentThreads
-
-TARGET = tst_RecreateInfosInDifferentThreads
-CONFIG+=testcase
-
-SOURCES += tst_RecreateInfosInDifferentThreads.cpp
-QT = core network
-INCLUDEPATH += ../../../../../src/systeminfo
-
-include(../../../../../../common.pri)
-CONFIG += mobility
-MOBILITY = systeminfo
-
-symbian {
- TARGET.CAPABILITY = All -TCB -DRM
-} \ No newline at end of file