Skip to content

Commit ec7cdbd

Browse files
author
Jonah Williams
authored
[Android] Add missing API level check for hcpp (#162901)
Requires API 34
1 parent 6e631c5 commit ec7cdbd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

engine/src/flutter/shell/platform/android/platform_view_android.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
namespace flutter {
4242

4343
namespace {
44+
45+
static constexpr int kMinAPILevelHCPP = 34;
46+
4447
AndroidContext::ContextSettings CreateContextSettings(
4548
const Settings& p_settings) {
4649
AndroidContext::ContextSettings settings;
@@ -138,9 +141,11 @@ PlatformViewAndroid::PlatformViewAndroid(
138141
android_use_new_platform_view_ =
139142
android_context->RenderingApi() ==
140143
AndroidRenderingAPI::kImpellerVulkan &&
144+
(android_get_device_api_level() >= kMinAPILevelHCPP) &&
141145
delegate.OnPlatformViewGetSettings().enable_surface_control;
142146
FML_CHECK(android_surface_ && android_surface_->IsValid())
143-
<< "Could not create an OpenGL, Vulkan or Software surface to set up "
147+
<< "Could not create an OpenGL, Vulkan or Software surface to set "
148+
"up "
144149
"rendering.";
145150
}
146151
}

0 commit comments

Comments
 (0)