@@ -112,13 +112,15 @@ struct AidlName {
112112 std::string iface;
113113 std::string instance;
114114
115- static bool fill (const std::string& name, AidlName* aname) {
115+ static bool fill (const std::string& name, AidlName* aname, bool logError ) {
116116 size_t firstSlash = name.find (' /' );
117117 size_t lastDot = name.rfind (' .' , firstSlash);
118118 if (firstSlash == std::string::npos || lastDot == std::string::npos) {
119- ALOGE (" VINTF HALs require names in the format type/instance (e.g. "
120- " some.package.foo.IFoo/default) but got: %s" ,
121- name.c_str ());
119+ if (logError) {
120+ ALOGE (" VINTF HALs require names in the format type/instance (e.g. "
121+ " some.package.foo.IFoo/default) but got: %s" ,
122+ name.c_str ());
123+ }
122124 return false ;
123125 }
124126 aname->package = name.substr (0 , lastDot);
@@ -151,7 +153,7 @@ static bool isVintfDeclared(const Access::CallingContext& ctx, const std::string
151153 }
152154
153155 AidlName aname;
154- if (!AidlName::fill (name, &aname)) return false ;
156+ if (!AidlName::fill (name, &aname, true )) return false ;
155157
156158 bool found = forEachManifest ([&](const ManifestWithDescription& mwd) {
157159 if (mwd.manifest ->hasAidlInstance (aname.package , aname.iface , aname.instance )) {
@@ -209,7 +211,7 @@ static std::optional<std::string> getVintfUpdatableApex(const std::string& name)
209211 }
210212
211213 AidlName aname;
212- if (!AidlName::fill (name, &aname)) return std::nullopt ;
214+ if (!AidlName::fill (name, &aname, true )) return std::nullopt ;
213215
214216 std::optional<std::string> updatableViaApex;
215217
@@ -251,7 +253,7 @@ static std::vector<std::string> getVintfUpdatableNames(const std::string& apexNa
251253
252254static std::optional<std::string> getVintfAccessorName (const std::string& name) {
253255 AidlName aname;
254- if (!AidlName::fill (name, &aname)) return std::nullopt ;
256+ if (!AidlName::fill (name, &aname, false )) return std::nullopt ;
255257
256258 std::optional<std::string> accessor;
257259 forEachManifest ([&](const ManifestWithDescription& mwd) {
@@ -270,7 +272,7 @@ static std::optional<std::string> getVintfAccessorName(const std::string& name)
270272
271273static std::optional<ConnectionInfo> getVintfConnectionInfo (const std::string& name) {
272274 AidlName aname;
273- if (!AidlName::fill (name, &aname)) return std::nullopt ;
275+ if (!AidlName::fill (name, &aname, true )) return std::nullopt ;
274276
275277 std::optional<std::string> ip;
276278 std::optional<uint64_t > port;
0 commit comments