Skip to content

Commit

Permalink
Fixes: NB#273060 - Connect charger to an already low battery sleeping…
Browse files Browse the repository at this point in the history
… device, show only charging notification when display turns on

RevBy: Vesa Halttunen
  • Loading branch information
Sachin Kundu committed Aug 3, 2011
1 parent 33a8f36 commit 90a3de4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/systemui/batterybusinesslogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions tests/ut_batterybusinesslogic/ut_batterybusinesslogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ut_batterybusinesslogic/ut_batterybusinesslogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ private slots:
void testWhenChargingStopsAndBatteryIsLowNotifierIsCreated();
void testWhenBatteryFullWhenChargingNotifiedThenNotificationRemoved();
void testSetTouchScreenLockActive();
void testWhenStateChargingLowBatteryNotificationRemoved();

private:
BatteryBusinessLogic *m_logic;
Expand Down

0 comments on commit 90a3de4

Please sign in to comment.