Merge "Prevent overflow when caching sensor events"