Export surface::Surface as Surface
In frameworks/native/aidl/gui/android/view/Surface.aidl, the rust type
for the parcelable Surface is `nativewindow::Surface`. To match with
that, crate::surface::Surface has to be exported as Surface.
If without this change, an AIDL rust backend using Surface experiences
the following error.
error[E0412]: cannot find type `Surface` in crate `nativewindow`
--> out/soong/.intermediates/packages/modules/Virtualization/libs/android_display_backend/libcrosvm_android_display_service-rust/android_arm64_armv8-a_source/libcrosvm_android_display_service.rs:141:77
|
141 | fn r#setSurface<'a>(&'a self, _arg_surface: &'a mut nativewindow::Surface) -> binder::BoxFuture<'a, binder::Result<()>> {
| ^^^^^^^ not found in `nativewindow`
|
help: consider importing this struct
|
17 + use nativewindow::surface::Surface;
|
help: if you import `Surface`, refer to it directly
|
141 - fn r#setSurface<'a>(&'a self, _arg_surface: &'a mut nativewindow::Surface) -> binder::BoxFuture<'a, binder::Result<()>> {
141 + fn r#setSurface<'a>(&'a self, _arg_surface: &'a mut Surface) -> binder::BoxFuture<'a, binder::Result<()>> {
Bug: N/A
Test: m
Change-Id: I20f13fd378890b803ce53ce654ee74a610f1a1c8
diff --git a/libs/nativewindow/rust/src/lib.rs b/libs/nativewindow/rust/src/lib.rs
index 22ad834..dc3f51f 100644
--- a/libs/nativewindow/rust/src/lib.rs
+++ b/libs/nativewindow/rust/src/lib.rs
@@ -16,7 +16,8 @@
extern crate nativewindow_bindgen as ffi;
-pub mod surface;
+mod surface;
+pub use surface::Surface;
pub use ffi::{AHardwareBuffer_Format, AHardwareBuffer_UsageFlags};