#include "com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter.h"
#include "ClientAdapter/ClientAdapter.h"
#include "clientadapterproxy/ClientAdapterProxy.h"
#include <jni.h>

//static NS_DM_Client::TestClientAdapter S_testClientAdapter;
static NS_DM_Client::ClientAdapterProxy S_testClientAdapter;

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_GetManagementObject
(JNIEnv *env, jclass, jstring objectName)
{
	const char* str = env->GetStringUTFChars(objectName, 0);
	bool res = S_testClientAdapter.GetManagementObject(str);

	env->ReleaseStringUTFChars(objectName, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_GetManagementTree
(JNIEnv * env, jclass, jstring uri)
{
	const char* str = env->GetStringUTFChars(uri, 0);
	bool res = S_testClientAdapter.GetManagementTree(str);

	env->ReleaseStringUTFChars(uri, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_GetClientProfiles
(JNIEnv *, jclass)
{
	bool res = S_testClientAdapter.GetClientProfiles();
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_SetManagementObject
(JNIEnv * env, jclass, jstring objectName)
{
	const char* str = env->GetStringUTFChars(objectName, 0);
	bool res = S_testClientAdapter.SetManagementObject(str);

	env->ReleaseStringUTFChars(objectName, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_Set
(JNIEnv * env, jclass, jstring filename)
{
	const char* str = env->GetStringUTFChars(filename, 0);
	bool res = S_testClientAdapter.Set(str);

	env->ReleaseStringUTFChars(filename, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_SetEMSK
(JNIEnv * env, jclass, jstring emsk)
{
	const char* str = env->GetStringUTFChars(emsk, 0);
	bool res = S_testClientAdapter.SetEMSK(str);

	env->ReleaseStringUTFChars(emsk, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_SetManufacturer
(JNIEnv * env, jclass, jstring manufacturer)
{
	const char* str = env->GetStringUTFChars(manufacturer, 0);
	bool res = S_testClientAdapter.SetManufacturer(str);

	env->ReleaseStringUTFChars(manufacturer, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_SetModel
(JNIEnv * env, jclass, jstring model)
{
	const char* str = env->GetStringUTFChars(model, 0);
	bool res = S_testClientAdapter.SetModel(str);

	env->ReleaseStringUTFChars(model, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_SetDeviceID
(JNIEnv * env, jclass, jstring deviceID)
{
	const char* str = env->GetStringUTFChars(deviceID, 0);
	bool res = S_testClientAdapter.SetDeviceID(str);

	env->ReleaseStringUTFChars(deviceID, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_SetWiMAXDiagnostics
(JNIEnv *, jclass)
{
	bool res = S_testClientAdapter.SetWiMAXDiagnostics();
    return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_CheckFirmware
(JNIEnv *, jclass)
{
	bool res = S_testClientAdapter.CheckFirmware();
    return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_StartDMSession
(JNIEnv *, jclass)
{
	bool res = S_testClientAdapter.StartDMSession();
    return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_HandleProvision
(JNIEnv *, jclass)
{
	bool res = S_testClientAdapter.HandleProvision();
   return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_HandleConfirmation
(JNIEnv *, jclass)
{
	bool res = S_testClientAdapter.HandleConfirmation();
    return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_Subscribe
(JNIEnv *, jclass)
{
	bool res = S_testClientAdapter.Subscribe();
   return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_DRMDReadyRequest
(JNIEnv *, jclass)
{
	bool res = S_testClientAdapter.DRMDReadyRequest();
    return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_HandleNetworkEntry
(JNIEnv * env, jclass, jint hnspID, jstring operatorName)
{
	const char* str = env->GetStringUTFChars(operatorName, 0);
	bool res = S_testClientAdapter.HandleNetworkEntry(hnspID, str);

	env->ReleaseStringUTFChars(operatorName, str);
	return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_GetProfileActivationStatus
  (JNIEnv *, jclass, jlong isActive)
{
    bool tmp = 0;
    bool res = S_testClientAdapter.GetProfileActivationStatus(tmp);
    isActive = tmp;
    return res? 1: 0;
}
//-------------------------------------------------------------------------------------------

JNIEXPORT jlong JNICALL Java_com_funambol_omadmclient_android_testremoteclientadapter_TestRemoteClientAdapter_StartBootstrap
  (JNIEnv *, jclass)
{
//    bool res = S_testClientAdapter.StartBootstrap();
//    return res? 1: 0;
       return 0;
}
//-------------------------------------------------------------------------------------------
