@ -26,7 +26,7 @@ void Applet::UpdateSuspensionStateLocked(bool force_message) {
// Remove any forced resumption.
// Remove any forced resumption.
lifecycle_manager . RemoveForceResumeIfPossible ( ) ;
lifecycle_manager . RemoveForceResumeIfPossible ( ) ;
// Check if we're runnable.
const bool update_requested_focus_state = lifecycle_manager . UpdateRequestedFocusState ( ) ;
const bool curr_activity_runnable = lifecycle_manager . IsRunnable ( ) ;
const bool curr_activity_runnable = lifecycle_manager . IsRunnable ( ) ;
const bool prev_activity_runnable = is_activity_runnable ;
const bool prev_activity_runnable = is_activity_runnable ;
const bool was_changed = curr_activity_runnable ! = prev_activity_runnable ;
const bool was_changed = curr_activity_runnable ! = prev_activity_runnable ;
@ -36,6 +36,7 @@ void Applet::UpdateSuspensionStateLocked(bool force_message) {
process - > Suspend ( false ) ;
process - > Suspend ( false ) ;
} else {
} else {
process - > Suspend ( true ) ;
process - > Suspend ( true ) ;
lifecycle_manager . RequestResumeNotification ( ) ;
}
}
is_activity_runnable = curr_activity_runnable ;
is_activity_runnable = curr_activity_runnable ;
@ -47,8 +48,7 @@ void Applet::UpdateSuspensionStateLocked(bool force_message) {
}
}
// Signal if the focus state was changed or the process state was changed.
// Signal if the focus state was changed or the process state was changed.
if ( lifecycle_manager . UpdateRequestedFocusState ( ) | | was_changed | | force_message ) {
lifecycle_manager . RequestResumeNotification ( ) ;
if ( update_requested_focus_state | | was_changed | | force_message ) {
lifecycle_manager . SignalSystemEventIfNeeded ( ) ;
lifecycle_manager . SignalSystemEventIfNeeded ( ) ;
}
}
}
}