Skip to content

android: Update targetSdkVersion to 33 (Android 13) #5749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

chrisbobbe
Copy link
Contributor

This change will be required in order to upload new releases to the Play Store, effective 2023-08-31 (or 2023-11-01 if we request an extension).

Tested on an emulated Pixel running Android 13, but testing on a real device would be good too. (The office device I use only runs Android 9, though, so I can't do that myself.)

Fixes: #5453

This change will be required in order to upload new releases to the
Play Store, effective 2023-08-31 (or 2023-11-01 if we request an
extension).

This change causes Android 13 and later to apply to our app a number
of behavior changes introduced in that version, documented here:
  https://developer.android.com/about/versions/13/behavior-changes-13

The "Granular media permissions" section stood out as potentially
relevant -- until we remembered that, in PR zulip#5618, we upgraded
react-native-image-picker such that on Android 13+ we use Android's
PhotoPicker API. With that API, the app learns about just the images
that the user selects, in a separate media picker, so our app code
doesn't need direct access to whole lists of media created by other
apps. That's what this note in that section of the doc is about:

> Note: If your app only needs to access images, photos, and videos,
> consider using the photo picker instead of declaring the
> READ_MEDIA_IMAGES and READ_MEDIA_VIDEO permissions.

Fixes: zulip#5453
@gnprice
Copy link
Member

gnprice commented Aug 22, 2023

Tested on my Pixel 5 running Android 13, and it seems to work fine. In particular I tested both "attach photo from library" and "use camera" — since that was one area where the docs indicated things were changing, which we looked at in the office on Friday — and both worked fine.

I suppose the other thing we need to do is to read through the list of potentially-breaking changes and confirm we don't see anything else that seems like it might affect us. I saw you'd looked through at least some of those docs on Friday. Do you have any notes on things you spotted?

@chrisbobbe
Copy link
Contributor Author

The short answer is that I read through the whole doc, and I don't think anything in there is likely to be disruptive.

In a section "Battery Resource Utilization", it mentions the system broadcasts BOOT_COMPLETED and LOCKED_BOOT_COMPLETED, which IIUC announce to interested apps that the device has booted and been unlocked (or just booted, for the latter). Our app doesn't listen for those broadcasts.

There is a section "App color theme applied automatically to WebView content" about a setForceDark method being deprecated, but we don't use that; and a behavior change with the css media query prefers-color-scheme, which we don't use (but have thought about using: #5533).

For the "Updated non-SDK restrictions" section, a linked doc says any issues of that kind would show up in the Play Console, and I checked and didn't see any.

@gnprice
Copy link
Member

gnprice commented Aug 22, 2023

Cool, thanks. And I just read through it as well: #5453 (comment) and don't see anything else of interest.

I did just test this in dark theme as well as light theme, and all still worked as desired.

LGTM; merging!

@gnprice gnprice merged commit 6f44474 into zulip:main Aug 22, 2023
@chrisbobbe chrisbobbe deleted the pr-target-sdk-version-33 branch August 29, 2023 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Target Android 13 (set targetSdkVersion to 33), by 2023-10 deadline
2 participants