} else if ( capability == CAPABILITY_FILESYNC ) {
make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_PUSHPULL );
} else if ( capability == CAPABILITY_USB_PROTOCOL ) {
- if ( is_emulator() ) {
- make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_DISABLED );
- } else {
- make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_ENABLED );
- }
+ make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_ENABLED );
} else if ( capability == CAPABILITY_SOCK_PROTOCOL ) {
make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_ENABLED );
} else if ( capability == CAPABILITY_ROOT_ONOFF ) {
} else if ( capability == CAPABILITY_PRODUCT_VER ) {
make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_UNKNOWN );
} else if ( capability == CAPABILITY_LOG_ENABLE ) {
- make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_DISABLED );
+ make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_ENABLED );
} else if ( capability == CAPABILITY_LOG_PATH ) {
make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", LOG_DIRECTORY );
} else if ( capability == CAPABILITY_APPCMD ) {
#include <vconf.h>
#include <glib.h>
-#define TRACE_TAG TRACE_SDB
-#include "log.h"
-
#include "sysdeps.h"
#include "sdbd_plugin.h"
#include "default_plugin.h"
-int get_lock_state ( parameters* in, parameters* out )
-{
- if ( in == NULL || in->number_of_parameter != 1 || in->array_of_parameter == NULL
- || in->array_of_parameter[0].type != type_int32 ) {
- D ( "Invalid argument\n" );
- return PLUGIN_CMD_FAIL;
- }
-
- if ( out == NULL ) {
- D ( "Invalid argument\n" );
- return PLUGIN_CMD_FAIL;
- }
-
- D ( "lock type: %d\n", in->array_of_parameter[0].v_int32);
-
- out->number_of_parameter = 1;
- out->array_of_parameter = ( parameter* ) malloc ( sizeof ( parameter ) );
- out->array_of_parameter[0].type = type_int32;
- out->array_of_parameter[0].v_int32 = ( plugin_pwlocked() == 1 ) ? PLUGIN_RET_ON : PLUGIN_RET_OFF;
-
- return PLUGIN_CMD_SUCCESS;
-}
-
int plugin_pwlocked ( void )
{
int pwlock_status = 0;
return 0; // unlocked!
}
+int get_lock_state ( parameters* in, parameters* out )
+{
+ if ( in == NULL || in->number_of_parameter != 1 || in->array_of_parameter == NULL
+ || in->array_of_parameter[0].type != type_int32 ) {
+ PLUGIN_LOG ( "Invalid argument\n" );
+ return PLUGIN_CMD_FAIL;
+ }
+
+ if ( out == NULL ) {
+ PLUGIN_LOG ( "Invalid argument\n" );
+ return PLUGIN_CMD_FAIL;
+ }
+
+ PLUGIN_LOG ( "lock type: %d\n", in->array_of_parameter[0].v_int32);
+
+ out->number_of_parameter = 1;
+ out->array_of_parameter = ( parameter* ) malloc ( sizeof ( parameter ) );
+ out->array_of_parameter[0].type = type_int32;
+ out->array_of_parameter[0].v_int32 = ( plugin_pwlocked() == 1 ) ? PLUGIN_RET_ON : PLUGIN_RET_OFF;
+
+ return PLUGIN_CMD_SUCCESS;
+}
+
static void pwlock_cb ( keynode_t *key, void* data )
{
PLUGIN_LOG ( "pwlock callback is issued\n" );
{
sdb_thread_t t;
if ( sdb_thread_create ( &t, pwlock_thread, NULL ) ) {
- PLUGIN_LOG ( "cannot create_pwlock_thread.\n" );
+ PLUGIN_LOG ( "default plugin : cannot create_pwlock_thread.\n" );
return;
}
- PLUGIN_LOG ( "created pwlock_thread\n" );
+ PLUGIN_LOG ( "default plugin : created pwlock_thread\n" );
}
static int plugin_register_command ( int command, priority cmd_priority )
{
if ( plugin_cmd_hashtable ) {
- hashtable_put ( plugin_cmd_hashtable, command, cmd_priority );
+ int ret = hashtable_put ( plugin_cmd_hashtable, command, cmd_priority );
+ D ("register plugin command : cmd(%d), result(%d)\n", command, ret);
+ } else {
+ D ("hashtable is not created\n");
}
return 0;
}
if ( plugin_cmd_hashtable ) {
int value;
ret = hashtable_get ( plugin_cmd_hashtable, cmd, &value );
+ D ("get from hashtable : cmd(%d), result(%d)\n", cmd, ret);
+ } else {
+ D ("hashtable is not created\n");
}
return ret;
in.array_of_parameter[0].type = type_int32;
in.array_of_parameter[0].v_int32 = cap;
+ D ("requested capability : %d\n", cap);
+
ret = request_sync_cmd ( PLUGIN_SYNC_CMD_CAPABILITY, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
strncpy ( out_buf, out.array_of_parameter[0].v_string.data, out_len - 1 );
out_buf[out_len - 1] = '\0';
success = 1;
release_parameters ( &out );
+
+ D ("request capability success : %s\n", out_buf);
}
release_parameters ( &in );
in.array_of_parameter = NULL;
}
+ D ("requested validity : %d, %s\n", cmd, in_buf);
+
ret = request_sync_cmd ( cmd, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
success = ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_VALID ) ? 1 : 0;
release_parameters ( &out );
+
+ D ("request validity success : %d\n", out.array_of_parameter[0].v_int32);
}
release_parameters ( &in );