Skip to content

hwcomposer/interfaces: Fix building on A14+#71

Open
supechicken wants to merge 1 commit into
waydroid:lineage-20from
WayDroid-ATV:fix_build_error
Open

hwcomposer/interfaces: Fix building on A14+#71
supechicken wants to merge 1 commit into
waydroid:lineage-20from
WayDroid-ATV:fix_build_error

Conversation

@supechicken
Copy link
Copy Markdown
Contributor

Fixes the following errors:

prebuilts/clang/host/linux-x86/clang-r547379/include/c++/v1/__memory/allocator.h:79:17: error: static assertion failed due to requirement '!is_const<const std::string>::value': std::allocator does not support const types
   79 |   static_assert(!is_const<_Tp>::value, "std::allocator does not support const types");
      |                 ^~~~~~~~~~~~~~~~~~~~~
prebuilts/clang/host/linux-x86/clang-r547379/include/c++/v1/__memory/allocator_traits.h:248:39: note: in instantiation of template class 'std::allocator<const std::string>' requested here
  248 |   using value_type         = typename allocator_type::value_type;
      |                                       ^
prebuilts/clang/host/linux-x86/clang-r547379/include/c++/v1/vector:399:20: note: in instantiation of template class 'std::allocator_traits<std::allocator<const std::string>>' requested here
  399 |   typedef typename __alloc_traits::size_type size_type;
      |                    ^
hardware/waydroid/hwcomposer/WaydroidClipboard.cpp:30:45: note: in instantiation of template class 'std::vector<const std::string>' requested here
   30 | static const std::vector<const std::string> MIME_TYPES = {
hardware/waydroid/interfaces/task/1.0/default/WaydroidTask.cpp:72:56: error: 'string' is a private member of 'android::String8'
   72 |     const char* OutAppName = android::String8(AppName).string();
      |                                                        ^

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates WaydroidClipboard.cpp to remove const from std::vector elements and modifies WaydroidTask.cpp to support Android API level 34. A critical issue was identified in WaydroidTask.cpp where the use of a temporary String8 object results in a use-after-free vulnerability. Additionally, the fallback logic for empty application names was inadvertently omitted for the new API branch.

Comment thread interfaces/task/1.0/default/WaydroidTask.cpp Outdated
@supechicken supechicken force-pushed the fix_build_error branch 3 times, most recently from f19329d to 0190958 Compare May 11, 2026 07:11
Signed-off-by: SupeChicken666 <me@supechicken666.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant