Set the audio jack status value to 0 or 1 22/49022/1 accepted/tizen/mobile/20151222.224944 accepted/tizen/tv/20151222.224957 accepted/tizen/wearable/20151222.225030 submit/tizen/20151222.122953 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718
authorMu-Woong <muwoong.lee@samsung.com>
Mon, 5 Oct 2015 08:11:10 +0000 (17:11 +0900)
committerMu-Woong <muwoong.lee@samsung.com>
Mon, 5 Oct 2015 08:11:10 +0000 (17:11 +0900)
Change-Id: If32eb2c3c80cefc91d723541b9683066143b83de
Signed-off-by: Mu-Woong <muwoong.lee@samsung.com>
src/shared/system_info.cpp

index f913747..548e328 100644 (file)
 #include <shared_vars.h>
 #include "system_info.h"
 
+#define CONNECTED              1
+#define NOT_CONNECTED  0
+
 bool ctx::system_info::get_audio_jack_state(int* state)
 {
-       int value;
+       int value = NOT_CONNECTED;
        int err = runtime_info_get_value_int(RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, &value);
        IF_FAIL_RETURN(err == RUNTIME_INFO_ERROR_NONE, false);
 
-       //TODO: convert value to state properly.
-       *state = value;
+       *state = (value == NOT_CONNECTED ? NOT_CONNECTED : CONNECTED);
 
        return true;
 }