Commit 6f79d22
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>1 parent 6885e68 commit 6f79d22
File tree
3 files changed
+12
-26
lines changed- leakcanary/leakcanary-android-core/src/main/java/leakcanary/internal/activity/db
- plumber/plumber-android-core/src/main/java/leakcanary
3 files changed
+12
-26
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
Lines changed: 10 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 51 | + | |
| 52 | + | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
| |||
246 | 244 | | |
247 | 245 | | |
248 | 246 | | |
249 | | - | |
250 | | - | |
251 | | - | |
| 247 | + | |
| 248 | + | |
252 | 249 | | |
253 | 250 | | |
254 | 251 | | |
| |||
353 | 350 | | |
354 | 351 | | |
355 | 352 | | |
356 | | - | |
357 | | - | |
358 | | - | |
| 353 | + | |
| 354 | + | |
359 | 355 | | |
360 | 356 | | |
361 | 357 | | |
| |||
416 | 412 | | |
417 | 413 | | |
418 | 414 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | 415 | | |
423 | 416 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
| 417 | + | |
| 418 | + | |
428 | 419 | | |
429 | 420 | | |
430 | 421 | | |
| |||
612 | 603 | | |
613 | 604 | | |
614 | 605 | | |
615 | | - | |
616 | 606 | | |
617 | 607 | | |
618 | | - | |
619 | | - | |
620 | | - | |
| 608 | + | |
| 609 | + | |
621 | 610 | | |
622 | 611 | | |
623 | 612 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
| |||
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | | - | |
| 116 | + | |
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
| |||
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
137 | | - | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
| |||
0 commit comments