Fixed
Status Update
Comments
al...@google.com <al...@google.com> #2
(bug is assigned to AppCompat for initial high-priority work, but please address usages outside of AppCompat as P3)
ob...@google.com <ob...@google.com>
al...@google.com <al...@google.com> #3
Stretch goal: Write a Lint rule to detect unsafe calls *and* an associated auto-fix that conforms to the pattern already used in Jetpack.
ob...@google.com <ob...@google.com> #4
Turns out that R8 might inline methods in separate classes to call site and then we're back to square one. The alternative is to have R8 do some constant checking (SDK_INT) and create separate classes accordingly as a workaround for previous SDK, and have ART check for that as a permanent workaround
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d50d11e3a4e35caa033be78ed48bad10b5e660bf
Author: Oussama Ben Abdelbaki <obenabde@google.com>
Date: Tue Aug 18 11:47:44 2020
Add @DoNotInline annotation
The annotation annotates only methods and makes it such that the
method is never inlined during optimization but can still be
shrunk and obfuscated.
Relnote: Adding @DoNotInline annotation which instructs proguard to not inline the annotated method.
Test: None
Bug: 141326133
Change-Id: I3dfe8732c062e500b19d1cf2e3812389c7fc3cca
M annotation/annotation/api/current.txt
M annotation/annotation/api/public_plus_experimental_current.txt
M annotation/annotation/api/restricted_current.txt
A annotation/annotation/src/main/java/androidx/annotation/DoNotInline.java
M annotation/annotation/src/main/resources/META-INF/proguard/androidx-annotations.pro
https://android-review.googlesource.com/1403868
Branch: androidx-master-dev
commit d50d11e3a4e35caa033be78ed48bad10b5e660bf
Author: Oussama Ben Abdelbaki <obenabde@google.com>
Date: Tue Aug 18 11:47:44 2020
Add @DoNotInline annotation
The annotation annotates only methods and makes it such that the
method is never inlined during optimization but can still be
shrunk and obfuscated.
Relnote: Adding @DoNotInline annotation which instructs proguard to not inline the annotated method.
Test: None
Bug: 141326133
Change-Id: I3dfe8732c062e500b19d1cf2e3812389c7fc3cca
M annotation/annotation/api/current.txt
M annotation/annotation/api/public_plus_experimental_current.txt
M annotation/annotation/api/restricted_current.txt
A annotation/annotation/src/main/java/androidx/annotation/DoNotInline.java
M annotation/annotation/src/main/resources/META-INF/proguard/
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit dd0931fe099fc9f344607bdcb04beae9949578f3
Author: Oussama Ben Abdelbaki <obenabde@google.com>
Date: Wed Aug 05 12:17:43 2020
Add new lint check to detect practices that could inhibit ART optimization
Bug contains context.
Bug: 141326133
Test: gw lintDebug
Change-Id: I1a4340e48ad11d8bc11e1f9c9be87ba7a6e9befa
A activity/activity/lint-baseline.xml
M appcompat/appcompat-resources/lint-baseline.xml
M appcompat/appcompat/lint-baseline.xml
M arch/core-runtime/lint-baseline.xml
A autofill/autofill/lint-baseline.xml
M benchmark/common/lint-baseline.xml
M biometric/biometric/lint-baseline.xml
A browser/browser/lint-baseline.xml
M buildSrc/src/main/kotlin/androidx/build/LintConfiguration.kt
M buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
A camera/camera-camera2-pipe/lint-baseline.xml
M camera/camera-camera2/lint-baseline.xml
M camera/camera-core/lint-baseline.xml
M camera/camera-testing/lint-baseline.xml
A camera/camera-view/lint-baseline.xml
M camera/integration-tests/extensionstestlib/lint-baseline.xml
D compose/runtime/runtime/lint-baseline.xml
M compose/test-utils/lint-baseline.xml
A compose/ui/ui-graphics/lint-baseline.xml
A compose/ui/ui-text-android/lint-baseline.xml
A compose/ui/ui-text/lint-baseline.xml
A compose/ui/ui/lint-baseline.xml
M contentpager/contentpager/lint-baseline.xml
M core/core-animation/lint-baseline.xml
A core/core-ktx/lint-baseline.xml
M core/core/lint-baseline.xml
A datastore/datastore-core/lint-baseline.xml
A documentfile/documentfile/lint-baseline.xml
M drawerlayout/drawerlayout/lint-baseline.xml
M dynamic-animation/dynamic-animation/lint-baseline.xml
M emoji/core/lint-baseline.xml
M exifinterface/exifinterface/lint-baseline.xml
A fragment/fragment/lint-baseline.xml
M leanback/leanback/lint-baseline.xml
A lifecycle/lifecycle-livedata-ktx/lint-baseline.xml
A lifecycle/lifecycle-process/lint-baseline.xml
M lint-checks/build.gradle
M lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
A lint-checks/src/main/java/androidx/build/lint/UnsafeNewApiCallsDetector.kt
M media/media/lint-baseline.xml
M media2/common/lint-baseline.xml
M media2/player/lint-baseline.xml
M media2/session/lint-baseline.xml
M media2/session/version-compat-tests/common/lint-baseline.xml
M media2/widget/lint-baseline.xml
M mediarouter/mediarouter/lint-baseline.xml
M preference/preference/lint-baseline.xml
A print/print/lint-baseline.xml
M room/guava/lint-baseline.xml
A room/ktx/lint-baseline.xml
M room/runtime/lint-baseline.xml
M security/crypto/lint-baseline.xml
M slices/builders/lint-baseline.xml
M slices/core/lint-baseline.xml
M slices/view/lint-baseline.xml
M sqlite/sqlite-framework/lint-baseline.xml
M sqlite/sqlite/lint-baseline.xml
M testutils/testutils-runtime/lint-baseline.xml
M textclassifier/textclassifier/lint-baseline.xml
A tracing/tracing/lint-baseline.xml
M transition/transition/lint-baseline.xml
M tv-provider/tv-provider/lint-baseline.xml
A ui/ui-graphics/lint-baseline.xml
A ui/ui-test/lint-baseline.xml
A ui/ui-text-android/lint-baseline.xml
A ui/ui-tooling/lint-baseline.xml
M vectordrawable/vectordrawable-animated/lint-baseline.xml
M versionedparcelable/versionedparcelable/lint-baseline.xml
M viewpager2/viewpager2/lint-baseline.xml
A window/window/lint-baseline.xml
M work/workmanager-testing/lint-baseline.xml
M work/workmanager/lint-baseline.xml
https://android-review.googlesource.com/1277372
Branch: androidx-master-dev
commit dd0931fe099fc9f344607bdcb04beae9949578f3
Author: Oussama Ben Abdelbaki <obenabde@google.com>
Date: Wed Aug 05 12:17:43 2020
Add new lint check to detect practices that could inhibit ART optimization
Bug contains context.
Bug: 141326133
Test: gw lintDebug
Change-Id: I1a4340e48ad11d8bc11e1f9c9be87ba7a6e9befa
A activity/activity/lint-baseline.xml
M appcompat/appcompat-resources/lint-baseline.xml
M appcompat/appcompat/lint-baseline.xml
M arch/core-runtime/lint-baseline.xml
A autofill/autofill/lint-baseline.xml
M benchmark/common/lint-baseline.xml
M biometric/biometric/lint-baseline.xml
A browser/browser/lint-baseline.xml
M buildSrc/src/main/kotlin/androidx/build/LintConfiguration.kt
M buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
A camera/camera-camera2-pipe/lint-baseline.xml
M camera/camera-camera2/lint-baseline.xml
M camera/camera-core/lint-baseline.xml
M camera/camera-testing/lint-baseline.xml
A camera/camera-view/lint-baseline.xml
M camera/integration-tests/extensionstestlib/lint-baseline.xml
D compose/runtime/runtime/lint-baseline.xml
M compose/test-utils/lint-baseline.xml
A compose/ui/ui-graphics/lint-baseline.xml
A compose/ui/ui-text-android/lint-baseline.xml
A compose/ui/ui-text/lint-baseline.xml
A compose/ui/ui/lint-baseline.xml
M contentpager/contentpager/lint-baseline.xml
M core/core-animation/lint-baseline.xml
A core/core-ktx/lint-baseline.xml
M core/core/lint-baseline.xml
A datastore/datastore-core/lint-baseline.xml
A documentfile/documentfile/lint-baseline.xml
M drawerlayout/drawerlayout/lint-baseline.xml
M dynamic-animation/dynamic-animation/lint-baseline.xml
M emoji/core/lint-baseline.xml
M exifinterface/exifinterface/lint-baseline.xml
A fragment/fragment/lint-baseline.xml
M leanback/leanback/lint-baseline.xml
A lifecycle/lifecycle-livedata-ktx/lint-baseline.xml
A lifecycle/lifecycle-process/lint-baseline.xml
M lint-checks/build.gradle
M lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
A lint-checks/src/main/java/androidx/build/lint/UnsafeNewApiCallsDetector.kt
M media/media/lint-baseline.xml
M media2/common/lint-baseline.xml
M media2/player/lint-baseline.xml
M media2/session/lint-baseline.xml
M media2/session/version-compat-tests/common/lint-baseline.xml
M media2/widget/lint-baseline.xml
M mediarouter/mediarouter/lint-baseline.xml
M preference/preference/lint-baseline.xml
A print/print/lint-baseline.xml
M room/guava/lint-baseline.xml
A room/ktx/lint-baseline.xml
M room/runtime/lint-baseline.xml
M security/crypto/lint-baseline.xml
M slices/builders/lint-baseline.xml
M slices/core/lint-baseline.xml
M slices/view/lint-baseline.xml
M sqlite/sqlite-framework/lint-baseline.xml
M sqlite/sqlite/lint-baseline.xml
M testutils/testutils-runtime/lint-baseline.xml
M textclassifier/textclassifier/lint-baseline.xml
A tracing/tracing/lint-baseline.xml
M transition/transition/lint-baseline.xml
M tv-provider/tv-provider/lint-baseline.xml
A ui/ui-graphics/lint-baseline.xml
A ui/ui-test/lint-baseline.xml
A ui/ui-text-android/lint-baseline.xml
A ui/ui-tooling/lint-baseline.xml
M vectordrawable/vectordrawable-animated/lint-baseline.xml
M versionedparcelable/versionedparcelable/lint-baseline.xml
M viewpager2/viewpager2/lint-baseline.xml
A window/window/lint-baseline.xml
M work/workmanager-testing/lint-baseline.xml
M work/workmanager/lint-baseline.xml
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 69d3a1a7dc9a5c574728039180a1ca97a716c658
Author: Jeff Gaston <jeffrygaston@google.com>
Date: Tue Sep 01 12:23:14 2020
Spelling buf -> but
Bug: 141326133
Change-Id: Ie25a0db7320cd135aa6108a0a73f8dfbd7590779
M lint-checks/src/main/java/androidx/build/lint/UnsafeNewApiCallsDetector.kt
https://android-review.googlesource.com/1417112
Branch: androidx-master-dev
commit 69d3a1a7dc9a5c574728039180a1ca97a716c658
Author: Jeff Gaston <jeffrygaston@google.com>
Date: Tue Sep 01 12:23:14 2020
Spelling buf -> but
Bug: 141326133
Change-Id: Ie25a0db7320cd135aa6108a0a73f8dfbd7590779
M lint-checks/src/main/java/androidx/build/lint/UnsafeNewApiCallsDetector.kt
al...@google.com <al...@google.com> #8
Relatedly, @DoNotInline
.
ob...@google.com <ob...@google.com> #9
Alan, I think we said we could have some sort of event where library owners do this? Or we send an email urging owners to do this?
al...@google.com <al...@google.com> #10
We've got a couple of other baseline clean-up tasks pending. At some point we'll run a Fix It by dumping all the baselines into a spreadsheet and automating the bug filing.
For now, we can send an email explaining (1) that we baselined violations across almost every library, (2) violations are known to lead to crashes on certain device versions, and (3) how to see where you violations are (ex. run the linter from Studio).
I can handle that if you've got other P1's to close out, just assign to me.
ob...@google.com <ob...@google.com> #11
Alan, since you probably know how to explain this better than I do, I might as well assign it to you now.
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #12
Bugs filed and discussion kicked off on how to best address them.
na...@google.com <na...@google.com> #13
This bug was linked in a change in the following release(s):
androidx.drawerlayout:drawerlayout:1.2.0-alpha01
Description
Any class that makes such a call will fail ART optimization and degrade overall performance.
All unsafe calls should be migrated into API level-specific static inner classes, e.g. the way BiometricManager handles API 29 calls in Api29Impl here:
We will also need a way to prevent developers from making these types of mistakes in the future, such as a Lint rule.