Vixen
02b45cc4
csharp
public sealed class HeadlessLifecycle

The lifecycle a headless head has, plus the ability to drive it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A server is never suspended by its OS, so on its own this would be an object that reports Running forever. The reason it is driveable is docs/plan/10 § Android: lifecycle is the largest source of platform bugs, the suspend/resume fault-injection loop it asks for has to run somewhere, and running it on a phone in CI is not a thing that will happen on every pull request. Here it costs milliseconds.

Every transition goes through the event buffer, so a test sees exactly what an Android build's frame loop would see, in the same order.

Fields and properties (3)

  • public ApplicationState State

    Where the application is now.

  • public MemoryPressure MemoryPressure

    How much memory pressure the OS last reported.

  • public bool IsQuitRequested

    Whether a quit has been requested and not yet cancelled.

Methods (7)

  • public HeadlessLifecycle(PlatformEventBuffer events)

    The lifecycle a headless head has, plus the ability to drive it.

  • public void RequestQuit()

    Asks the application to quit.

  • public void CancelQuit()

    Withdraws a quit request.

  • public void Suspend()

    Suspends the application, as a mobile OS would.

  • public void Resume()

    Resumes the application.

  • public void SetBackground(bool background)

    Moves the application in or out of the background.

  • public void ReportMemoryPressure(MemoryPressure pressure)

    Reports memory pressure, as iOS's memory warning and Android's onTrimMemory do.

Used by (2)

  • HeadlessLifecycleTestsVixen.Platform.Headless.Tests
  • HeadlessPlatformVixen.Platform.Headless