summaryrefslogtreecommitdiffstats
path: root/ucb/Library_ucpexpand1.mk
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-05-13 15:36:20 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2024-05-14 08:37:49 +0200
commite99991216e47751b80238825aaeb21702d46dc34 (patch)
treec4ff679e59eaa8c9e972c6cce86de8cb81d6dddb /ucb/Library_ucpexpand1.mk
parentandroid: Don't restrict taking photo to rear camera (diff)
downloadcore-master.tar.gz
core-master.zip
android: Fix taking photos by dropping permission HEADmaster
At least on recent devices (seen e.g. on an AVD with API level 34 and a Fairphone 3 with LineageOS 20 (based on Android 13)), inserting a picture by taking a photo using the camera didn't work, "nothing was happening" when choosing the corresponding option from the formatting toolbar with experimental editing mode enabled. This is due to the system filtering information about other apps/packages with target API level >= 30 for privacy reasons, see [1] for more details. As described at [2], requesting the `CAMERA` permission is not required: > Users might take pictures in your app, using the pre-installed > system camera app. > > In this situation, don't declare the CAMERA permission. Instead, > invoke the ACTION_IMAGE_CAPTURE intent action. In fact, specifying the permission is even counter-productive and would cause this to not work, as also described at [2]: > Note: If your app declares Manifest.permission.CAMERA > permission and is not granted, then the action results in > a SecurityException. Rather than explicitly requesting the permission, just drop it from the AndroidManifest, as it's not needed. Also drop the additional code interacting with the package manager, as that doesn't work with newer API versions as described above. With these changes in place, inserting a photo works fine in tests in API 21 and API 34 AVDs and on the above-mentioned Fairphone 3. [1] https://developer.android.com/training/package-visibility [2] https://developer.android.com/privacy-and-security/minimize-permission-requests#take-photo Change-Id: Ia1ee4e4de577a269e2b79bf5460d08b1bf2bee56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167603 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
Diffstat (limited to 'ucb/Library_ucpexpand1.mk')
0 files changed, 0 insertions, 0 deletions