Merge "av: native_window_set_buffers_geometry is deprecated."
diff --git a/services/camera/libcameraservice/device1/CameraHardwareInterface.h b/services/camera/libcameraservice/device1/CameraHardwareInterface.h
index 925b645..2746f6f 100644
--- a/services/camera/libcameraservice/device1/CameraHardwareInterface.h
+++ b/services/camera/libcameraservice/device1/CameraHardwareInterface.h
@@ -625,9 +625,14 @@
     static int __set_buffers_geometry(struct preview_stream_ops* w,
                       int width, int height, int format)
     {
+        int rc;
         ANativeWindow *a = anw(w);
-        return native_window_set_buffers_geometry(a,
-                          width, height, format);
+
+        rc = native_window_set_buffers_dimensions(a, width, height);
+        if (!rc) {
+            rc = native_window_set_buffers_format(a, format);
+        }
+        return rc;
     }
 
     static int __set_crop(struct preview_stream_ops *w,