Merge "Merge "Fix ownership of objects returned by VintfObject::Get*" am: 2cdd1ce600 am: 56d8c8297d am: b519119efd" into oc-mr1-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
7d9492eec8
@@ -56,7 +56,7 @@ static inline jobjectArray toJavaStringArray(JNIEnv* env, const V& v) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void tryAddSchema(const T* object, const XmlConverter<T>& converter,
|
||||
static void tryAddSchema(const std::shared_ptr<const T>& object, const XmlConverter<T>& converter,
|
||||
const std::string& description,
|
||||
std::vector<std::string>* cStrings) {
|
||||
if (object == nullptr) {
|
||||
@@ -66,7 +66,7 @@ static void tryAddSchema(const T* object, const XmlConverter<T>& converter,
|
||||
}
|
||||
}
|
||||
|
||||
static void tryAddHalNamesAndVersions(const HalManifest *manifest,
|
||||
static void tryAddHalNamesAndVersions(const std::shared_ptr<const HalManifest>& manifest,
|
||||
const std::string& description,
|
||||
std::set<std::string> *output) {
|
||||
if (manifest == nullptr) {
|
||||
@@ -119,7 +119,7 @@ static jobjectArray android_os_VintfObject_getHalNamesAndVersions(JNIEnv* env, j
|
||||
}
|
||||
|
||||
static jstring android_os_VintfObject_getSepolicyVersion(JNIEnv* env, jclass) {
|
||||
const HalManifest *manifest = VintfObject::GetDeviceHalManifest();
|
||||
std::shared_ptr<const HalManifest> manifest = VintfObject::GetDeviceHalManifest();
|
||||
if (manifest == nullptr || manifest->type() != SchemaType::DEVICE) {
|
||||
LOG(WARNING) << __FUNCTION__ << "Cannot get device manifest";
|
||||
return nullptr;
|
||||
@@ -129,7 +129,7 @@ static jstring android_os_VintfObject_getSepolicyVersion(JNIEnv* env, jclass) {
|
||||
}
|
||||
|
||||
static jobject android_os_VintfObject_getVndkSnapshots(JNIEnv* env, jclass) {
|
||||
const HalManifest *manifest = VintfObject::GetFrameworkHalManifest();
|
||||
std::shared_ptr<const HalManifest> manifest = VintfObject::GetFrameworkHalManifest();
|
||||
if (manifest == nullptr || manifest->type() != SchemaType::FRAMEWORK) {
|
||||
LOG(WARNING) << __FUNCTION__ << "Cannot get framework manifest";
|
||||
return nullptr;
|
||||
|
||||
@@ -32,7 +32,7 @@ using vintf::VintfObject;
|
||||
#define MAP_STRING_METHOD(javaMethod, cppString) \
|
||||
static jstring android_os_VintfRuntimeInfo_##javaMethod(JNIEnv* env, jclass clazz) \
|
||||
{ \
|
||||
const RuntimeInfo *info = VintfObject::GetRuntimeInfo(); \
|
||||
std::shared_ptr<const RuntimeInfo> info = VintfObject::GetRuntimeInfo(); \
|
||||
if (info == nullptr) return nullptr; \
|
||||
return env->NewStringUTF((cppString).c_str()); \
|
||||
} \
|
||||
@@ -50,7 +50,7 @@ MAP_STRING_METHOD(getBootVbmetaAvbVersion, vintf::to_string(info->bootVbmetaAvbV
|
||||
|
||||
static jlong android_os_VintfRuntimeInfo_getKernelSepolicyVersion(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
const RuntimeInfo *info = VintfObject::GetRuntimeInfo();
|
||||
std::shared_ptr<const RuntimeInfo> info = VintfObject::GetRuntimeInfo();
|
||||
if (info == nullptr) return 0;
|
||||
return static_cast<jlong>(info->kernelSepolicyVersion());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user