Merge "Only use PROCESS_STATE_TOP as foreground time." into oc-dev