Status Update
Comments
al...@google.com <al...@google.com>
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #2
<transition xmlns:android="
<item android:drawable="@drawable/test_drawable_blue"/>
<item android:drawable="@drawable/test_drawable_green"/>
</transition>
where blue/green drawables look like this:
<shape
xmlns:android="
android:shape="rectangle">
<size
android:width="@dimen/drawable_large_size"
android:height="@dimen/drawable_small_size" />
<solid
android:color="@color/test_blue" />
</shape>
Then added this test:
@Test
public void testMutateTransitionDrawable() {
Drawable drawable = ResourcesCompat.getDrawable(mResources,
R.drawable.test_transition_drawable, null);
assertTrue(drawable instanceof TransitionDrawable);
Drawable mutated = drawable.mutate();
assertTrue(drawable instanceof TransitionDrawable);
assertTrue(mutated instanceof TransitionDrawable);
}
It passes on the device. Going to also try on other earlier devices a bit later in the day once they are charged.
al...@google.com <al...@google.com>
ap...@google.com <ap...@google.com> #3
al...@google.com <al...@google.com> #4
al...@google.com <al...@google.com> #5
Sergey, do you want to use this bug for your minSdk
-related CLs and then reassign to me when you're done? Or just reassign to me when you're done.
se...@google.com <se...@google.com> #6
I think I'm done with removing RequiresApi-s.
as...@google.com <as...@google.com> #7
Create an autofix for this.
al...@google.com <al...@google.com>
bu...@google.com <bu...@google.com> #8
Bugjuggler:
bu...@google.com <bu...@google.com>
al...@google.com <al...@google.com> #9
Need a new AGP / Lint so that we get bug fixes.
bu...@google.com <bu...@google.com> #10
Bugjuggler:
bu...@google.com <bu...@google.com>
al...@google.com <al...@google.com> #11
Core moved to beta
, so now we need to wait a few weeks until it moves back to alpha
and we can make API changes again.
Bugjuggler: wait until 2024-03-15
bu...@google.com <bu...@google.com> #12
bu...@google.com <bu...@google.com>
al...@google.com <al...@google.com>
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit 7b0e5e3b9e416fbd201fbee4fd9ba1667912b130
Author: Alan Viverette <alanv@google.com>
Date: Tue Mar 26 16:10:04 2024
Move androidx.core:core back to alpha for API changes
Bug: 313834577
Test: ./gradlew :core:core:checkApi
Change-Id: I9974f318bd30daee4baa216485e22a7edf7be7d8
Merged-In: I6236caf2327095763ea82b3661dd1d64c5f91c94
M libraryversions.toml
al...@google.com <al...@google.com> #14
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit 6604eaf83fbfe432168c242c69fb4d709c8a1283
Author: Alan Viverette <alanv@google.com>
Date: Tue Mar 26 16:11:11 2024
Apply auto-fixes from ObsoleteCompatMethod in androidx.core:core
Bumps annotation dependency to latest for @ReplaceWith.
Relnote: Deprecated obsolete compat methods
Bug: 313834577
Test: ./gradlew :core:core:checkApi
Change-Id: I01d9076d4ef7b12614b233f8b0b3e147e97b8221
M activity/integration-tests/testapp/build.gradle
M appcompat/integration-tests/receive-content-testapp/build.gradle
M core/core/api/current.txt
M core/core/api/restricted_current.txt
M core/core/build.gradle
M core/core/src/main/java/androidx/core/accessibilityservice/AccessibilityServiceInfoCompat.java
M core/core/src/main/java/androidx/core/app/ActivityManagerCompat.java
M core/core/src/main/java/androidx/core/app/AlarmManagerCompat.java
M core/core/src/main/java/androidx/core/app/BundleCompat.java
M core/core/src/main/java/androidx/core/app/NavUtils.java
M core/core/src/main/java/androidx/core/app/NotificationCompat.java
M core/core/src/main/java/androidx/core/content/ContextCompat.java
M core/core/src/main/java/androidx/core/graphics/BitmapCompat.java
M core/core/src/main/java/androidx/core/graphics/drawable/DrawableCompat.java
M core/core/src/main/java/androidx/core/location/LocationCompat.java
M core/core/src/main/java/androidx/core/net/ConnectivityManagerCompat.java
M core/core/src/main/java/androidx/core/os/BundleCompat.java
M core/core/src/main/java/androidx/core/os/ParcelCompat.java
M core/core/src/main/java/androidx/core/view/MarginLayoutParamsCompat.java
M core/core/src/main/java/androidx/core/view/MenuCompat.java
M core/core/src/main/java/androidx/core/view/MotionEventCompat.java
M core/core/src/main/java/androidx/core/view/ScaleGestureDetectorCompat.java
M core/core/src/main/java/androidx/core/view/VelocityTrackerCompat.java
M core/core/src/main/java/androidx/core/view/ViewCompat.java
M core/core/src/main/java/androidx/core/view/ViewConfigurationCompat.java
M core/core/src/main/java/androidx/core/view/ViewGroupCompat.java
M core/core/src/main/java/androidx/core/view/ViewParentCompat.java
M core/core/src/main/java/androidx/core/view/accessibility/AccessibilityEventCompat.java
M core/core/src/main/java/androidx/core/view/accessibility/AccessibilityRecordCompat.java
M core/core/src/main/java/androidx/core/widget/CheckedTextViewCompat.java
M core/core/src/main/java/androidx/core/widget/ListPopupWindowCompat.java
M core/core/src/main/java/androidx/core/widget/ListViewCompat.java
M core/core/src/main/java/androidx/core/widget/PopupWindowCompat.java
ap...@google.com <ap...@google.com> #16
Branch: androidx-main
commit ee226e3f129903a29954c39dd49e49ae1f42e320
Author: Alan Viverette <alanv@google.com>
Date: Tue Mar 26 16:30:49 2024
Apply auto-fix for problematic instances of ObsoleteCompatMethod
These didn't apply cleanly and needed some manual work.
Relnote: Deprecate additional obsolete compat methods
Bug: 313834577
Test: ./gradlew :core:core:checkApi :media:media:checkApi
Change-Id: Ie44708f1423037d74b64aadb7418182a6a1dc089
M core/core/api/current.txt
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/view/MenuItemCompat.java
M core/core/src/main/java/androidx/core/view/accessibility/AccessibilityManagerCompat.java
M core/core/src/main/java/androidx/core/widget/TextViewCompat.java
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit 90f97d778b1f3f5e3b0664e0e5df1786f0373c3c
Author: Alan Viverette <alanv@google.com>
Date: Tue Mar 26 16:23:11 2024
Fix ObsoleteCompatDetector auto-fix to remove line breaks
Bug: 313834577
Test: ObsoleteCompatDetectorTest
Change-Id: I1530004a57c019682da7a38a54cadb225753c5fb
A lint-checks/integration-tests/src/main/java/androidx/ObsoleteCompatMethodMissingMultiLineReplaceWith.java
M lint-checks/src/main/java/androidx/build/lint/ObsoleteCompatDetector.kt
M lint-checks/src/test/java/androidx/build/lint/ObsoleteCompatDetectorTest.kt
al...@google.com <al...@google.com> #18
We still have some constants that warrant deprecation and a handful of methods outside of core
, but I think this is sufficient for now.
ub...@gmail.com <ub...@gmail.com> #19
I see that LocationCompat.isMock
was deprecated as part of this effort. This looks like a mistake: Location.isMockProvider
was added in API 18, but deprecated in API 31, at which point Location.isMock
was added. So there remains a need for this compatibility method.
I hope you can revert this one as part of this issue without requiring a separate issue for every single thing that may have gone wrong.
au...@google.com <au...@google.com>
al...@google.com <al...@google.com> #20
LocationCompat.isMock()
calls directly through to the deprecated Location.isFromMockProvider()
regardless of SDK level, which was a bad implementation to begin with.
al...@google.com <al...@google.com>
ap...@google.com <ap...@google.com> #21
Branch: androidx-main
commit 3b9df12d74b961741050fe589aae8003532ec248
Author: Alan Viverette <alanv@google.com>
Date: Wed Jun 12 17:01:10 2024
Undeprecate LocationCompat.isMock, fix delegation on API 31+
Relnote: """Reverts deprecation of LocationCompat.isMock and delegates
to the platform API on API level 31 and above."""
Fixes: 313834577
Test: LocationCompatTest
Change-Id: I559407ae8f2cce149cd2802322485f1b80cb85c9
M core/core/api/current.txt
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/location/LocationCompat.java
ub...@gmail.com <ub...@gmail.com> #22
Thanks for the fix! I just noticed another one:
ParcelCompat.writeBoolean was deprecated with instructions to use Parcel.writeInt directly with a value of 0 or 1. This does not make sense. The point of ParcelCompat.writeBoolean was to complement Parcel.writeBoolean, which was introduced in API 29. Doesn't make sense to take it away now.
al...@google.com <al...@google.com>
ub...@gmail.com <ub...@gmail.com> #23
Just a general thought: it might make sense to review these deprecations systematically. I'm guessing there are quite a few more problems lurking, as I only use a small slice of the affected APIs.
al...@google.com <al...@google.com> #24
Likely, but I don't think we would have caught either of these during manual review. They were technically correct since the implementations were single-line and inlineable, so applying the replacement would still have the same runtime behavior (and bytecode if running an optimizer).
We'd need to go back through and audit methods that were originally written without a proper SDK_INT
check.
ap...@google.com <ap...@google.com> #25
Branch: androidx-main
commit 2d316160b6048996e91929c28ec33d91603900bb
Author: Alan Viverette <alanv@google.com>
Date: Thu Jun 13 14:10:24 2024
Undeprecate ParcelCompat.writeBoolean, fix delegation on API 29+
Relnote: """Reverts deprecation of ParcelCompat.writeBoolean and delegates
to the platform API on API level 29 and above."""
Bug: 313834577
Test: ParcelCompatTest
Change-Id: I9d2436d90f3cbe3bf22e2a3c97171f39b53cf040
M core/core/api/current.txt
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/os/ParcelCompat.java
al...@google.com <al...@google.com> #26
Closing this out. There may still be one-offs, but let's use new bug reports for those.
Description
```
public static int getWindowSystemUiVisibility(@NonNull View view) {
return view.getWindowSystemUiVisibility();
}
```
These methods should be deprecated.