summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2024-04-01 16:17:15 +0900
committerJiyong Park <jiyong@google.com>2024-04-05 18:47:47 +0900
commit8032bff1b67a21d4e82525fcec2fe5166cb4d490 (patch)
tree9215fb2382fa46b0faaeb346faa620c1a238b039
parentc2d55d916ac53d2f1ab62c0e5b80a060508ea0e6 (diff)
downloadnative-8032bff1b67a21d4e82525fcec2fe5166cb4d490.tar.gz
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
-rw-r--r--libs/nativewindow/rust/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/nativewindow/rust/src/lib.rs b/libs/nativewindow/rust/src/lib.rs
index 22ad83463c..dc3f51f7fd 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};