diff --git a/apps/Makefile b/apps/Makefile index f99835fd8..6249c5f29 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -29,7 +29,6 @@ app_objs += $(addprefix apps/,\ shift_alpha_lock_view.o\ suspend_timer.o\ title_bar_view.o\ - usb_timer.o\ variable_box_controller.o\ variable_box_leaf_cell.o\ ) diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index efac81a52..967a2c48b 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -18,7 +18,6 @@ AppsContainer::AppsContainer() : m_updateController(), m_ledTimer(LedTimer()), m_batteryTimer(BatteryTimer(this)), - m_USBTimer(USBTimer(this)), m_suspendTimer(SuspendTimer(this)), m_backlightDimmingTimer(), m_homeSnapshot(), @@ -211,11 +210,11 @@ Window * AppsContainer::window() { } int AppsContainer::numberOfContainerTimers() { - return 4+(GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Activate); + return 3+(GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Activate); } Timer * AppsContainer::containerTimerAtIndex(int i) { - Timer * timers[5] = {&m_batteryTimer, &m_USBTimer, &m_suspendTimer, &m_backlightDimmingTimer, &m_ledTimer}; + Timer * timers[4] = {&m_batteryTimer, &m_suspendTimer, &m_backlightDimmingTimer, &m_ledTimer}; return timers[i]; } diff --git a/apps/apps_container.h b/apps/apps_container.h index c2b1378f5..2596afdfa 100644 --- a/apps/apps_container.h +++ b/apps/apps_container.h @@ -13,7 +13,6 @@ #include "exam_pop_up_controller.h" #include "led_timer.h" #include "battery_timer.h" -#include "usb_timer.h" #include "suspend_timer.h" #include "backlight_dimming_timer.h" @@ -69,7 +68,6 @@ private: OnBoarding::UpdateController m_updateController; LedTimer m_ledTimer; BatteryTimer m_batteryTimer; - USBTimer m_USBTimer; SuspendTimer m_suspendTimer; BacklightDimmingTimer m_backlightDimmingTimer; Home::App::Snapshot m_homeSnapshot; diff --git a/apps/usb_timer.cpp b/apps/usb_timer.cpp deleted file mode 100644 index d38599db2..000000000 --- a/apps/usb_timer.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "usb_timer.h" -#include "global_preferences.h" -#include "apps_container.h" - -USBTimer::USBTimer(AppsContainer * container) : - Timer(1), - m_container(container), - m_previousPluggedState(false) -{ -} - -bool USBTimer::fire() { - bool needRedrawing = false; - if (Ion::USB::isPlugged()) { - if (!m_previousPluggedState) { - Ion::USB::removeSoftDisconnect(); - } - if (!m_previousPluggedState && GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Activate) { - m_container->displayExamModePopUp(false); - needRedrawing = true; - } -#if LED_WHILE_CHARGING - KDColor LEDColor = Ion::Battery::isCharging() ? KDColorYellow : KDColorGreen; - Ion::LED::setColor(LEDColor); -#endif - if (!m_previousPluggedState) { - Ion::Backlight::setBrightness(Ion::Backlight::MaxBrightness); - } - m_previousPluggedState = true; - } else { - if (m_previousPluggedState) { -#if LED_WHILE_CHARGING - Ion::LED::setColor(KDColorBlack); -#endif - m_previousPluggedState = false; - } - } - return needRedrawing; -} diff --git a/apps/usb_timer.h b/apps/usb_timer.h deleted file mode 100644 index 82ed9b581..000000000 --- a/apps/usb_timer.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef APPS_USB_TIMER_H -#define APPS_USB_TIMER_H - -#include - -class AppsContainer; - -class USBTimer : public Timer { -public: - USBTimer(AppsContainer * container); -private: - bool fire() override; - AppsContainer * m_container; - bool m_previousPluggedState; -}; - -#endif -