android_device_samsung_msm8.../libsecnativefeature/SecNativeFeatureCIf.cpp
Ziyan 61a4c37735 msm8976-common: ril: add squash of OSS libsecnativefeature
msm8976-common: ril: add open-sourced libsecnativefeature, used by libsec-ril

 Change-Id: I2f487db23b31c63ba919863f393ca37cc9a81191

 libsecnativefeature: fix build with clang

 Change-Id: Ibda3234af2b1184e094913e35cb919a75f972c87

Change-Id: Iaaa06fa527cedce6609a95b21d787c13dda6a30a
2018-02-12 18:34:12 +01:00

85 lines
1.6 KiB
C++

#include <string>
#include <iostream>
#include "SecNativeFeatureCppIf.h"
#include "SecNativeFeatureCIf.h"
#include <expat.h>
#include <stdlib.h>
int
SecNativeFeature_getEnableStatus(const char* tag)
{
SecNativeFeature* instance = SecNativeFeature::getInstance();
if (instance)
{
return instance->getEnableStatus(tag);
}
return 0;
}
int
SecNativeFeature_getEnableStatusWithDefault(const char* tag, int defaultValue)
{
SecNativeFeature* instance = SecNativeFeature::getInstance();
if (instance)
{
return instance->getEnableStatus(tag, defaultValue);
}
return defaultValue;
}
int
SecNativeFeature_getInteger(const char* tag)
{
SecNativeFeature* instance = SecNativeFeature::getInstance();
if (instance)
{
return instance->getInteger(tag);
}
return -1;
}
int
SecNativeFeature_getIntegerWithDefault(const char* tag, int defaultValue)
{
SecNativeFeature* instance = SecNativeFeature::getInstance();
if (instance)
{
return instance->getInteger(tag, defaultValue);
}
return defaultValue;
}
const char*
SecNativeFeature_getString(const char* tag)
{
SecNativeFeature* instance = SecNativeFeature::getInstance();
if (instance)
{
return instance->getString(tag);
}
return NULL;
}
const char*
SecNativeFeature_getStringWithDefault(const char* tag, char* defaultValue)
{
SecNativeFeature* instance = SecNativeFeature::getInstance();
if (instance)
{
return instance->getString(tag, defaultValue);
}
return defaultValue;
}