Bump target SDK to Android 12 (31)
We should bump the compileSdk and targetSdk to 31 since there are some dependencies that require those versions.
To do it, we need to verify that the ownCloud App supports each point in https://developer.android.com/about/versions/12/behavior-changes-12
TASKS
- [x] Research (if needed)
- [x] Create branch feature/feature_name
- [x] Research which Android12 features must be checked inside the app, due to feasible changes.
- [x] Development tasks
- [x] Develop changes
- [x] ...
- [ ] Code review and apply changes requested
- [ ] Design test plan
- [ ] QA
- [ ] Check if in is installable from Internal testing track in Android 12
- [ ] Merge branch feature/feature_name into master
PR
- App
- Library (if needed)
This is my attempt https://github.com/owncloud/android/pull/3512
Apps targeting API 31+
User experience
- [x] Custom notifications
- [x] Android App Links verification changes - No impact on us
- [x] PiP Mode - No impact on us
- [x] Toast redesign
Security and privacy
- [X] Approximate location - No impact on us
- [x] Modern SameSite cookies in WebView
- [x] Motion sensors are rate-limited - No impact on us
- [x] App hibernation
- [x] Attribution declaration in data access auditing - No impact on us
- [x] ADB backup restriction - No impact on us
- [x] Safer component exporting
- [x] Pending intents mutability
- [x] Unsafe intent launches
Performance
- [x] Foreground service launch restrictions
- [x] Exact alarm permission - No impact on us
- [x] Notification trampoline restrictions
Backup and restore
- [x] D2D transfer functionality changes - No impact on us
- [x] New include and exclude format - No impact on us
Connectivity
- [x] Concurrent Peer-to-Peer + Internet Connection - No impact on us
- [x] mDNSResponder native API - No impact on us
Vendor libraries
- [x] Vendor-supplied native shared libraries - No impact on us
Updated non-SDK restrictions
- [x] Tests
After performing an examination of the .apk with the tool provided by Google to check how many non-SDK interfaces are currently in the project, this is the result:
65 hidden API(s) used: 10 linked against, 55 through reflection:
- 48 in unsupported
- 2 in blocked
- 1 in max-target-o
- 11 in max-target-p
- 3 in max-target-q
- 0 in max-target-r
By consulting the table that Google published from API 29, we can deduce that:

Most of our APIs are not supported, but currently, they are not restricted and our application can use them, we have to be careful with them in case they change and make the app not work properly.
What do you think @abelgardep @jesmrec @theScrabi ?