Skip to content

Commit f5da7ee

Browse files
author
Ethan Chen
committed
Set linker namespaces to null if VNDK namespace is not available
The ANGLE namespace will be non-null if the VNDK namespace is not available, meaning subsequent calls to getAngleNamespace will return a non-null value even though the first call to getAngleNamespace will return nullptr. Set mAngleNamespace to nullptr if an error occurs when retrieving the VNDK namespace as well. The same applies to the graphics driver namespace. Test: lunch aosp_arm64-eng && m Bug: 321123035 Change-Id: Iac55c51d904f42536fe2056bb108f4d768b029e3
1 parent 72d92ef commit f5da7ee

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libs/graphicsenv/GraphicsEnv.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ android_namespace_t* GraphicsEnv::getDriverNamespace() {
265265

266266
auto vndkNamespace = android_get_exported_namespace("vndk");
267267
if (!vndkNamespace) {
268-
return nullptr;
268+
mDriverNamespace = nullptr;
269+
return mDriverNamespace;
269270
}
270271

271272
mDriverNamespace = android_create_namespace("updatable gfx driver",
@@ -617,7 +618,8 @@ android_namespace_t* GraphicsEnv::getAngleNamespace() {
617618

618619
auto vndkNamespace = android_get_exported_namespace("vndk");
619620
if (!vndkNamespace) {
620-
return nullptr;
621+
mAngleNamespace = nullptr;
622+
return mAngleNamespace;
621623
}
622624

623625
if (!linkDriverNamespaceLocked(mAngleNamespace, vndkNamespace, "")) {

0 commit comments

Comments
 (0)