| 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.compare("28") == 0 ||
31 first_api_level.compare("27") == 0 ||
32 first_api_level.compare("26") == 0 ||
33 first_api_level.compare("25") == 0 ||
34 first_api_level.compare("24") == 0) {
35 return true;
36 }
37 // From local testing, neither the swapchain nor AHB import works, see also:
38 // https://github.com/flutter/flutter/issues/154068
39 if (clientidbase == kAndroidHuawei && api_level <= 29) {
40 return true;
41 }
42 return false;
43 }

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