From 728997cd8f82f385ea60ae0ca0057e0d6677be65 Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" <98614782+auto-submit[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:24:19 +0000 Subject: [PATCH] Reverts "[Impeller] Reland: disable AHBs on devices that were upgraded to 29. (#56213)" (flutter/engine#56220) Reverts: flutter/engine#56213 Initiated by: jtmcdole Reason for reverting: breaks the tree. :'( Original PR Author: jonahwilliams Reviewed By: {chinmaygarde, jtmcdole} This change reverts the following previous change: Uses ro.product.first_api_level to disable AHBs on devices that began life pre 29. Fixes https://github.com/flutter/flutter/issues/157113 --- .../impeller/toolkit/android/shadow_realm.cc | 12 +----------- .../impeller/toolkit/android/shadow_realm.h | 1 - .../toolkit/android/toolkit_android_unittests.cc | 14 +++----------- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/engine/src/flutter/impeller/toolkit/android/shadow_realm.cc b/engine/src/flutter/impeller/toolkit/android/shadow_realm.cc index 312f45c116a..6d19e6fe459 100644 --- a/engine/src/flutter/impeller/toolkit/android/shadow_realm.cc +++ b/engine/src/flutter/impeller/toolkit/android/shadow_realm.cc @@ -15,23 +15,13 @@ bool ShadowRealm::ShouldDisableAHB() { __system_property_get("ro.com.google.clientidbase", clientidbase); auto api_level = android_get_device_api_level(); - char first_api_level[PROP_VALUE_MAX]; - __system_property_get("ro.product.first_api_level", first_api_level); - return ShouldDisableAHBInternal(clientidbase, first_api_level, api_level); + return ShouldDisableAHBInternal(clientidbase, api_level); } // static bool ShadowRealm::ShouldDisableAHBInternal(std::string_view clientidbase, - std::string_view first_api_level, uint32_t api_level) { - // Most devices that have updated to API 29 don't seem to correctly - // support AHBs: https://github.com/flutter/flutter/issues/157113 - if (first_api_level == "28" || first_api_level == "27" || - first_api_level == "26" || first_api_level == "25" || - first_api_level == "24") { - return true; - } // From local testing, neither the swapchain nor AHB import works, see also: // https://github.com/flutter/flutter/issues/154068 if (clientidbase == kAndroidHuawei && api_level <= 29) { diff --git a/engine/src/flutter/impeller/toolkit/android/shadow_realm.h b/engine/src/flutter/impeller/toolkit/android/shadow_realm.h index 90f265ec612..90f913b5af3 100644 --- a/engine/src/flutter/impeller/toolkit/android/shadow_realm.h +++ b/engine/src/flutter/impeller/toolkit/android/shadow_realm.h @@ -18,7 +18,6 @@ class ShadowRealm { // For testing. static bool ShouldDisableAHBInternal(std::string_view clientidbase, - std::string_view first_api_level, uint32_t api_level); }; diff --git a/engine/src/flutter/impeller/toolkit/android/toolkit_android_unittests.cc b/engine/src/flutter/impeller/toolkit/android/toolkit_android_unittests.cc index 7d07577d528..c96e04c2dfe 100644 --- a/engine/src/flutter/impeller/toolkit/android/toolkit_android_unittests.cc +++ b/engine/src/flutter/impeller/toolkit/android/toolkit_android_unittests.cc @@ -138,17 +138,9 @@ TEST(ToolkitAndroidTest, CanPostAndWaitForFrameCallbacks) { TEST(ToolkitAndroidTest, ShouldDisableAHB) { EXPECT_FALSE(ShadowRealm::ShouldDisableAHB()); - EXPECT_FALSE( - ShadowRealm::ShouldDisableAHBInternal("android-huawei", "30", 30)); - EXPECT_FALSE( - ShadowRealm::ShouldDisableAHBInternal("something made up", "29", 29)); - - EXPECT_TRUE( - ShadowRealm::ShouldDisableAHBInternal("android-huawei", "29", 29)); - EXPECT_TRUE( - ShadowRealm::ShouldDisableAHBInternal("something made up", "27", 29)); - EXPECT_TRUE( - ShadowRealm::ShouldDisableAHBInternal("android-huawei", "garbage", 29)); + EXPECT_TRUE(ShadowRealm::ShouldDisableAHBInternal("android-huawei", 29)); + EXPECT_FALSE(ShadowRealm::ShouldDisableAHBInternal("android-huawei", 30)); + EXPECT_FALSE(ShadowRealm::ShouldDisableAHBInternal("something made up", 29)); } } // namespace impeller::android::testing