Skip to content

Switch to targeting Android 16#7111

Merged
grzesiek2010 merged 25 commits intogetodk:masterfrom
seadowg:android-16
Mar 4, 2026
Merged

Switch to targeting Android 16#7111
grzesiek2010 merged 25 commits intogetodk:masterfrom
seadowg:android-16

Conversation

@seadowg
Copy link
Copy Markdown
Member

@seadowg seadowg commented Feb 25, 2026

Closes #6647

Why is this the best possible solution? Were any other approaches considered?

The main changes are listed in the issue and I'll leave comments on specific things that need highlighted.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

The app is most at risk of behaviour changes from just changing the target version when running on the target OS (Android 16) so a general test with that would be a good idea.

The whole app is at risk of having display problems due to the edge to edge change, but I think that's something we can just keep any eye on for this release cycle.

Other key areas to test:

  • Manual form syncs (with Exactly Match Server enabled)
  • Draw screen (signature widget etc.) on small and large devices (won't change orentation on large devices any longer)
  • Selfie camera

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

}

private fun Activity.handleEdgeToEdge(edgeToEdge: Boolean) {
WindowCompat.enableEdgeToEdge(window)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For right now, edge to edge is enabled across the app for all Android versions, and then we adjust screen insets to accommodate - basically avoiding needing to deal with it in any specific Activity. If there are screens that would benefit from edge to edge, we can opt them in one at a time.

<application>
<activity android:name="org.odk.collect.selfiecamera.CaptureSelfieActivity"
android:theme="@style/Theme.AppCompat"
android:screenOrientation="portrait"/>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selfie camera screen will no longer lock to portrait. To be honest, I'm not sure why it ever did - you don't want orientation to flip if you're using the device landscape intentionally.

@seadowg seadowg marked this pull request as ready for review February 26, 2026 13:54
@seadowg seadowg requested a review from grzesiek2010 February 26, 2026 13:54
Comment thread collect_app/src/main/java/org/odk/collect/android/activities/AppListActivity.java Outdated
Comment thread collect_app/src/main/java/org/odk/collect/android/activities/AppListActivity.java Outdated
Comment thread draw/src/main/java/org/odk/collect/draw/DrawActivity.java
Comment thread async/src/main/java/org/odk/collect/async/coroutines/CoroutineTaskRunner.kt Outdated
Comment thread async/src/main/java/org/odk/collect/async/coroutines/CoroutineTaskRunner.kt Outdated
flags: Int,
startId: Int
): Int {
val notificationChannel = intent!!.getStringExtra(EXTRA_NOTIFICATION_CHANNEL)!!
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment in Service#onStartCommand says:

The intent supplied to Context.startService, as given. This may be null if the service is being restarted after its process has gone away, and it had previously returned anything except START_STICKY_COMPATIBILITY.

So, shouldn't we check for null here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe that applies tot his Service because we return START_NOT_STICKY. That's confusing given the other comment though!

@seadowg seadowg requested a review from grzesiek2010 March 3, 2026 11:23
Comment thread androidshared/src/main/java/org/odk/collect/androidshared/ui/EdgeToEdge.kt Outdated
@seadowg seadowg requested a review from grzesiek2010 March 4, 2026 14:05
@grzesiek2010 grzesiek2010 merged commit d06379a into getodk:master Mar 4, 2026
8 checks passed
@seadowg seadowg deleted the android-16 branch March 4, 2026 14:50
@WKobus
Copy link
Copy Markdown

WKobus commented Mar 12, 2026

Tested with success

Verified on Android 16

Verified cases:

  • Manual syncing forms
  • Check on selfie camera and draw widgets
  • Checks on all question type form
  • Different font size setting
  • Light and dark mode

@dbemke
Copy link
Copy Markdown

dbemke commented Mar 12, 2026

Tested with success

Verified on Android 10

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 16

4 participants