[Android] Add missing API level check for hcpp (#162901)

Requires API 34
This commit is contained in:
Jonah Williams 2025-02-07 13:52:35 -08:00 committed by GitHub
parent 6e631c5a46
commit ec7cdbd126
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,6 +41,9 @@
namespace flutter {
namespace {
static constexpr int kMinAPILevelHCPP = 34;
AndroidContext::ContextSettings CreateContextSettings(
const Settings& p_settings) {
AndroidContext::ContextSettings settings;
@ -138,9 +141,11 @@ PlatformViewAndroid::PlatformViewAndroid(
android_use_new_platform_view_ =
android_context->RenderingApi() ==
AndroidRenderingAPI::kImpellerVulkan &&
(android_get_device_api_level() >= kMinAPILevelHCPP) &&
delegate.OnPlatformViewGetSettings().enable_surface_control;
FML_CHECK(android_surface_ && android_surface_->IsValid())
<< "Could not create an OpenGL, Vulkan or Software surface to set up "
<< "Could not create an OpenGL, Vulkan or Software surface to set "
"up "
"rendering.";
}
}