Fix logging of state change and ignore background requests in suspended Change-Id: Ia0e9146023a9b8e390382f3c465f8c058dd9c25f Signed-off-by: Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
diff --git a/plugin/CobaltImplementation.cpp b/plugin/CobaltImplementation.cpp index e84470d..cf1db40 100644 --- a/plugin/CobaltImplementation.cpp +++ b/plugin/CobaltImplementation.cpp
@@ -517,7 +517,7 @@ result = Core::ERROR_NONE; break; case PluginHost::IStateControl::BACKGROUND: - if (_state != PluginHost::IStateControl::BACKGROUNDED && _statePending != PluginHost::IStateControl::BACKGROUNDED) { + if (_state == PluginHost::IStateControl::RESUMED || _statePending == PluginHost::IStateControl::RESUMED) { _statePending = PluginHost::IStateControl::BACKGROUNDED; _sink.RequestForStateChange( PluginHost::IStateControl::BACKGROUND); @@ -623,7 +623,7 @@ const PluginHost::IStateControl::command command) { bool result = false; - SYSLOG(Logging::Notification, (_T("Cobalt request state change -> %s\n"), command == PluginHost::IStateControl::SUSPEND ? "suspend" : "resume")); + SYSLOG(Logging::Notification, (_T("Cobalt request state change -> %s\n"), PluginHost::IStateControl::ToString(command))); switch (command) { case PluginHost::IStateControl::SUSPEND: {