You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FeedbackShakeIntegration leaks the first resumed Activity #6685
SentryShakeDetector caches its SensorManager the first time it is initialized. FeedbackShakeIntegration passes the resumed Activity to start(), and Activity.getSystemService(SENSOR_SERVICE) returns a manager created for that Activity, which holds the Activity as its context. The cached manager outlives the Activity, so the Activity can never be collected.
It is timing-dependent: enableOnShake() warms up the detector with the Application on a background executor, which caches a safe manager. The leak only happens when an Activity resumes before that warm-up runs. The caching came in with the off-main-thread init (#5784).
Fix
Resolve the SensorManager from the application context in SentryShakeDetector.init, regardless of which context the caller passes.
Activity
linear-code commentedon Nov 19, 2026
JAVA-847