androidx icon indicating copy to clipboard operation
androidx copied to clipboard

Implement PendingIntentCompat to enforce mutability flag.

Open adaext opened this issue 2 years ago • 2 comments

To improve system security, M+ starts to support the IMMUTABLE, and S+ requires that mutability Flags must be set. On S+. When an app creates a PendingIntent without providing mutability flags, the app will be force-closed during runtime. Choosing to add or not add Mutability Flags depending on the operating system version is a hassle, not to mention adding version check. Moreover, mutability is easy to be forgotten to add. When we separate mutability into a Boolean in PendingIntentCompat, we can force this parameter be set directly at compile time to reduce runtime errors.

Test: ./gradlew test connectedCheck

adaext avatar Jul 22 '22 01:07 adaext

You'll have to rewrite my commit to use [email protected] as the author email for the CLA check to pass. Or feel free to just squash my commit into yours–I don't require any attribution.

JakeWharton avatar Jul 22 '22 12:07 JakeWharton

e: /home/runner/work/androidx/androidx/appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/SystemLocalesMaintainedOnAppLanguageChangeTestCase.kt: (23, 26): Unresolved reference: LocaleManagerCompat
e: /home/runner/work/androidx/androidx/appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/SystemLocalesMaintainedOnAppLanguageChangeTestCase.kt: (55, 45): Unresolved reference: LocaleManagerCompat
e: /home/runner/work/androidx/androidx/appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/SystemLocalesMaintainedOnAppLanguageChangeTestCase.kt: (66, 45): Unresolved reference: LocaleManagerCompat

The failure seems to be unrelated. I've succeed in my fork. https://github.com/adaext/androidx/actions/runs/2745163648. Please help me check it again, Thanks.

adaext avatar Jul 28 '22 00:07 adaext