diff --git a/src/systemui/batterybusinesslogic.cpp b/src/systemui/batterybusinesslogic.cpp index c5ff1d92..71eb04c5 100644 --- a/src/systemui/batterybusinesslogic.cpp +++ b/src/systemui/batterybusinesslogic.cpp @@ -78,7 +78,7 @@ void BatteryBusinessLogic::chargingStateChanged(MeeGo::QmBattery::ChargingState // The low battery notifications should not be sent when the battery is charging stopLowBatteryNotifier(); - removeNotification(QStringList() << "x-nokia.battery.removecharger" << "x-nokia.battery.chargingcomplete"); + removeNotification(QStringList() << "x-nokia.battery.removecharger" << "x-nokia.battery.chargingcomplete" << "x-nokia.battery.lowbattery"); sendNotification(NotificationCharging); } break; diff --git a/tests/ut_batterybusinesslogic/ut_batterybusinesslogic.cpp b/tests/ut_batterybusinesslogic/ut_batterybusinesslogic.cpp index 3a75c99c..8624d658 100644 --- a/tests/ut_batterybusinesslogic/ut_batterybusinesslogic.cpp +++ b/tests/ut_batterybusinesslogic/ut_batterybusinesslogic.cpp @@ -394,6 +394,17 @@ void Ut_BatteryBusinessLogic::testWhenChargingStopsAndBatteryIsLowNotifierIsCrea #endif } +void Ut_BatteryBusinessLogic::testWhenStateChargingLowBatteryNotificationRemoved() +{ +#ifdef HAVE_QMSYSTEM + m_logic->lowBatteryAlert(); + m_logic->batteryChargerEvent(MeeGo::QmBattery::Wall); + m_logic->chargingStateChanged(MeeGo::QmBattery::StateCharging); + QVERIFY(gMNotificationRemoveEventType.count() > 0); + QCOMPARE(gMNotificationRemoveEventType.last(), QString("x-nokia.battery.lowbattery")); +#endif +} + void Ut_BatteryBusinessLogic::testWhenBatteryFullWhenChargingNotifiedThenNotificationRemoved() { #ifdef HAVE_QMSYSTEM diff --git a/tests/ut_batterybusinesslogic/ut_batterybusinesslogic.h b/tests/ut_batterybusinesslogic/ut_batterybusinesslogic.h index 3b72ab2b..5873c623 100644 --- a/tests/ut_batterybusinesslogic/ut_batterybusinesslogic.h +++ b/tests/ut_batterybusinesslogic/ut_batterybusinesslogic.h @@ -47,6 +47,7 @@ private slots: void testWhenChargingStopsAndBatteryIsLowNotifierIsCreated(); void testWhenBatteryFullWhenChargingNotifiedThenNotificationRemoved(); void testSetTouchScreenLockActive(); + void testWhenStateChargingLowBatteryNotificationRemoved(); private: BatteryBusinessLogic *m_logic;