| Flutter Impeller |

Static Public Member Functions | List of all members
impeller::android::ShadowRealm Class Reference

`#include <shadow_realm.h>`

## Static Public Member Functions
static bool | ShouldDisableAHB ()
| Whether the device should disable any usage of Android Hardware Buffers regardless of stated support. More...
static bool | ShouldDisableAHBInternal (std::string_view clientidbase, std::string_view first_api_level, uint32_t api_level)

## Detailed Description

Definition at line 13 of file shadow_realm.h.

## Member Function Documentation

## ◆ ShouldDisableAHB()

bool impeller::android::ShadowRealm::ShouldDisableAHB | ( |  | ) |
| static

Whether the device should disable any usage of Android Hardware Buffers regardless of stated support.

Definition at line 13 of file shadow_realm.cc.

13 {
14 char clientidbase[PROP_VALUE_MAX];
15 __system_property_get("ro.com.google.clientidbase", clientidbase);
16
17 auto api_level = android_get_device_api_level();
18 char first_api_level[PROP_VALUE_MAX];
19 __system_property_get("ro.product.first_api_level", first_api_level);
20
21 return ShouldDisableAHBInternal(clientidbase, first_api_level, api_level);
22 }

References ShouldDisableAHBInternal().

## ◆ ShouldDisableAHBInternal()

bool impeller::android::ShadowRealm::ShouldDisableAHBInternal | ( | std::string_view | clientidbase,
|  | std::string_view | first_api_level,
|  | uint32_t | api_level
| ) |  |
| static

Definition at line 25 of file shadow_realm.cc.

27 {
28 // Most devices that have updated to API 29 don't seem to correctly
29 // support AHBs: https://github.com/flutter/flutter/issues/157113
30 if (first_api_level == "28" || first_api_level == "27" ||
31 first_api_level == "26" || first_api_level == "25" ||
32 first_api_level == "24") {
33 return true;
34 }
35 // From local testing, neither the swapchain nor AHB import works, see also:
36 // https://github.com/flutter/flutter/issues/154068
37 if (clientidbase == kAndroidHuawei && api_level <= 29) {
38 return true;
39 }
40 return false;
41 }

References impeller::android::kAndroidHuawei.

Referenced by ShouldDisableAHB(), and impeller::android::testing::TEST().

The documentation for this class was generated from the following files:

- impeller/toolkit/android/shadow_realm.h
- impeller/toolkit/android/shadow_realm.cc

impeller::android::ShadowRealm::ShouldDisableAHBInternal
static bool ShouldDisableAHBInternal(std::string_view clientidbase, std::string_view first_api_level, uint32_t api_level)
Definition: shadow_realm.cc:25
impeller::android::kAndroidHuawei
constexpr std::string_view kAndroidHuawei
Definition: shadow_realm.cc:11