Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states
TraceAttributes::ANDROID_STATE
public const ANDROID_STATE_FOREGROUND = 'foreground';