SIGN IN SIGN UP
square / leakcanary UNCLAIMED

A memory leak detection library for Android.

0 0 74 Kotlin

Fix ObsoleteSdkInt lint errors after API 26 upgrade

With minSdkVersion now set to API 26 (Android 8.0), many of the Android leak fixes in the plumber module are no longer necessary as they targeted older API levels. This commit resolves lint warnings by adding early returns to obsolete fixes and removing unnecessary API annotations.

Changes made:
- AndroidLeakFixes.kt: Added early returns to 6 leak fixes that only applied to API levels below 26:
  • MEDIA_SESSION_LEGACY_HELPER (was for API 21)
  • FLUSH_HANDLER_THREADS (was for API 14-25)
  • LEAK_CANARY_THREAD_EDGE_CASE (was for API 21-25)
  • ACTIVITY_THREAD_EDGE_CASE (was for API 16-25)
  • CONNECTIVITY_MANAGER (was for API 21-25)
- FixedWindowCallback.java: Removed obsolete @RequiresApi(23) annotation from onSearchRequested method
- Cleaned up unused Build.VERSION imports after removing version checks

These changes eliminate 11 ObsoleteSdkInt lint errors while maintaining API compatibility. The affected leak fixes are no longer needed since Android 8.0+ doesn't have these issues.

Co-Authored-By: Claude <noreply@anthropic.com>
P
pblundell committed
6f79d2232b1a8a1f4aedf541ef69463c9ce4238f
Parent: 6885e68