Merge "Fix missing time-in-foreground and time-in-background for some apps" into sc-dev