Respect reserved event count for postEventOrFree
Continuous sensor data can quickly flood CHRE's event queue when several sensors are enabled at a max rate and CHRE stalls when issuing an external request for some reason. To avoid this, modify postEventOrFree to respect the kMinReservedHighPriorityEventCount var that reserves space for high priority events and migrate several methods that (mistakenly) use this API to the postEvent method to guarantee their event delivery. Additionally, modify the postEvent method to become postEventOrDie and only allow system events to be posted here which also requires moving nanoapp events to the new postLowPriorityEventOrFree function. Bug: 139448882 Test: Load onto device and play w/ a_sns_test and see if crashes occur Test: ./load_chre, ./run_tests.sh, ./run_sim.sh Change-Id: I1e6d0268b96934b805aaa0dd8ee831e05f74f0f7 Merged-In: I1e6d0268b96934b805aaa0dd8ee831e05f74f0f7
Loading