Skip to content

Commit 8bba22b

Browse files
committed
GraphicsEnv: Get feature overrides from GpuService
Query GpuService for the latest ANGLE feature overrides and store them in GraphicsEnv. This must be done separately, because Zygote cannot perform Binder calls and GraphicsEnv must be able to handle being called at Zygote creation and App launch. This also helps minimize the boot time impact of this feature. Bug: 372694741 Test: CQ, Manual verification Flag: com.android.graphics.graphicsenv.flags.feature_overrides Change-Id: I9bfd295e57593074262a77fc8e2abe91b5d18791
1 parent 7ad24b9 commit 8bba22b

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

libs/graphicsenv/GraphicsEnv.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,10 @@ void GraphicsEnv::setAngleInfo(const std::string& path, const bool shouldUseNati
621621
mShouldUseAngle = true;
622622
}
623623
mShouldUseNativeDriver = shouldUseNativeDriver;
624+
625+
if (mShouldUseAngle) {
626+
updateAngleFeatureOverrides();
627+
}
624628
}
625629

626630
std::string& GraphicsEnv::getPackageName() {
@@ -632,6 +636,22 @@ const std::vector<std::string>& GraphicsEnv::getAngleEglFeatures() {
632636
return mAngleEglFeatures;
633637
}
634638

639+
// List of ANGLE features to override (enabled or disable).
640+
// The list of overrides is loaded and parsed by GpuService.
641+
void GraphicsEnv::updateAngleFeatureOverrides() {
642+
if (!graphicsenv_flags::feature_overrides()) {
643+
return;
644+
}
645+
646+
const sp<IGpuService> gpuService = getGpuService();
647+
if (!gpuService) {
648+
ALOGE("No GPU service");
649+
return;
650+
}
651+
652+
mFeatureOverrides = gpuService->getFeatureOverrides();
653+
}
654+
635655
void GraphicsEnv::getAngleFeatureOverrides(std::vector<const char*>& enabled,
636656
std::vector<const char*>& disabled) {
637657
if (!graphicsenv_flags::feature_overrides()) {

libs/graphicsenv/include/graphicsenv/GraphicsEnv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class GraphicsEnv {
121121
// Get the app package name.
122122
std::string& getPackageName();
123123
const std::vector<std::string>& getAngleEglFeatures();
124+
void updateAngleFeatureOverrides();
124125
void getAngleFeatureOverrides(std::vector<const char*>& enabled,
125126
std::vector<const char*>& disabled);
126127
// Set the persist.graphics.egl system property value.

0 commit comments

Comments
 (0)