diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index 0e4501623..0f0eebdc4 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -86,19 +86,7 @@ bool AppsContainer::dispatchEvent(Ion::Events::Event event) { bool didProcessEvent = false; - if (event == Ion::Events::USBPlug) { - if (Ion::USB::isPlugged()) { - if (GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Activate) { - displayExamModePopUp(false); - } else { - Ion::USB::enable(); - } - Ion::Backlight::setBrightness(Ion::Backlight::MaxBrightness); - } else { - Ion::USB::disable(); - } - didProcessEvent = true; - } else if (event == Ion::Events::USBEnumeration) { + if (event == Ion::Events::USBEnumeration) { if (Ion::USB::isPlugged()) { App::Snapshot * activeSnapshot = (activeApp() == nullptr ? appSnapshotAtIndex(0) : activeApp()->snapshot()); switchTo(usbConnectedAppSnapshot()); @@ -132,6 +120,19 @@ bool AppsContainer::dispatchEvent(Ion::Events::Event event) { } bool AppsContainer::processEvent(Ion::Events::Event event) { + if (event == Ion::Events::USBPlug) { + if (Ion::USB::isPlugged()) { + if (GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Activate) { + displayExamModePopUp(false); + } else { + Ion::USB::enable(); + } + Ion::Backlight::setBrightness(Ion::Backlight::MaxBrightness); + } else { + Ion::USB::disable(); + } + return true; + } if (event == Ion::Events::Home || event == Ion::Events::Back) { switchTo(appSnapshotAtIndex(0)); return true;