android.os.VintfObject: update for VNDK version format change.

Test: CTS device info collect
Bug: 36400653

Change-Id: I7b22f82ddd9ddc3b0930b5c1564435c42be2a6fa
This commit is contained in:
Yifan Hong
2018-01-10 16:04:18 -08:00
parent f448371208
commit 8da8798ca3
2 changed files with 4 additions and 4 deletions

View File

@@ -76,8 +76,8 @@ public class VintfObject {
/**
* @return a list of VNDK snapshots supported by the framework, as
* specified in framework manifest. For example,
* [("25.0.5", ["libjpeg.so", "libbase.so"]),
* ("25.1.3", ["libjpeg.so", "libbase.so"])]
* [("27", ["libjpeg.so", "libbase.so"]),
* ("28", ["libjpeg.so", "libbase.so"])]
*/
public static native Map<String, String[]> getVndkSnapshots();
}

View File

@@ -146,8 +146,8 @@ static jobject android_os_VintfObject_getVndkSnapshots(JNIEnv* env, jclass) {
return nullptr;
}
jobject jMap = env->NewObject(gHashMapClazz, gHashMapInit);
for (const Vndk &vndk : manifest->vndks()) {
std::string key = to_string(vndk.versionRange());
for (const auto &vndk : manifest->vendorNdks()) {
std::string key = vndk.version();
env->CallObjectMethod(jMap, gHashMapPut,
env->NewStringUTF(key.c_str()), toJavaStringArray(env, vndk.libraries()));
}