Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0551beb authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

Camera: Remove GPS_LOCATION if set is called with null

Per CaptureRequest documentation, if CaptureRequest.set(GPS_LOCATION)
is called with null, the corresponding entries in the CameraMetata
should be cleared.

Make the logic so.

Test: Camera CTS
Bug: 268581420
Change-Id: Ib7801e14237e4500a7a9d5c00b2f15c35d482798
parent e7020d59
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1132,6 +1132,12 @@ public class CameraMetadataNative implements Parcelable {

    private boolean setGpsLocation(Location l) {
        if (l == null) {
            // If Location value being set is null, remove corresponding keys.
            // This is safe because api1/client2/CameraParameters.cpp already erases
            // the keys for JPEG_GPS_LOCATION for certain cases.
            setBase(CaptureRequest.JPEG_GPS_TIMESTAMP, null);
            setBase(CaptureRequest.JPEG_GPS_COORDINATES, null);
            setBase(CaptureRequest.JPEG_GPS_PROCESSING_METHOD, null);
            return false;
        }