android_device_samsung_msm8.../libsecnativefeature/SecNativeFeatureCIf.cpp
Ziyan 79060a6bb2 msm8974-common: ril: add squash of OSS libsecnativefeature
msm8974-common: ril: add open-sourced libsecnativefeature, used by libsec-ril

 Change-Id: I2f487db23b31c63ba919863f393ca37cc9a81191

 libsecnativefeature: fix build with clang

 Change-Id: Ibda3234af2b1184e094913e35cb919a75f972c87

 msm8974-common: ril: Move device dependent modules to /vendor

 Change-Id: Ia2f4835e3325f3d8d53db26fb632b3b9eedcc382

Change-Id: Iaaa06fa527cedce6609a95b21d787c13dda6a30a
2018-01-23 06:42:56 -07:00

86 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;
}