Commit f2d6ba10 authored by spiiroin's avatar spiiroin

Merge branch 'jb41303_android_config' into 'master'

Do not require android configuration block

See merge request !32
parents 70cb7de2 ee9b39a7
...@@ -29,19 +29,6 @@ ...@@ -29,19 +29,6 @@
#include "usb_moded-config.h" #include "usb_moded-config.h"
#include "usb_moded-mac.h" #include "usb_moded-mac.h"
/** check if android settings are set
*
* @return 1 if settings are available, 0 if not
*
*/
int android_settings(void)
{
int ret = 0;
ret = check_android_section();
return ret;
}
/** Read android serial number from kernel command line /** Read android serial number from kernel command line
*/ */
...@@ -97,6 +84,11 @@ void android_init_values(void) ...@@ -97,6 +84,11 @@ void android_init_values(void)
{ {
gchar *text; gchar *text;
if( access("/sys/class/android_usb/android0", F_OK) != 0 )
{
goto EXIT;
}
if( (text = get_android_serial()) ) if( (text = get_android_serial()) )
{ {
write_to_file("/sys/class/android_usb/android0/iSerial", text); write_to_file("/sys/class/android_usb/android0/iSerial", text);
...@@ -139,6 +131,9 @@ void android_init_values(void) ...@@ -139,6 +131,9 @@ void android_init_values(void)
/* Make sure android_usb does not stay disabled in case usb moded /* Make sure android_usb does not stay disabled in case usb moded
* has crashed / been killed in inconvenient time. */ * has crashed / been killed in inconvenient time. */
write_to_file("/sys/class/android_usb/android0/enable", "1"); write_to_file("/sys/class/android_usb/android0/enable", "1");
EXIT:
return;
} }
/* Set a charging mode for the android gadget /* Set a charging mode for the android gadget
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
02110-1301 USA 02110-1301 USA
*/ */
int android_settings(void);
void android_init_values(void); void android_init_values(void);
int set_android_charging_mode(void); int set_android_charging_mode(void);
int set_android_productid(char *id); int set_android_productid(char *id);
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#include "usb_moded-log.h" #include "usb_moded-log.h"
#include "usb_moded-modes.h" #include "usb_moded-modes.h"
#include "usb_moded-modesetting.h" #include "usb_moded-modesetting.h"
#include "usb_moded-dbus.h"
#include "usb_moded-dbus-private.h"
#ifdef USE_MER_SSU #ifdef USE_MER_SSU
# include "usb_moded-ssu.h" # include "usb_moded-ssu.h"
...@@ -859,33 +861,6 @@ char * get_mode_whitelist(void) ...@@ -859,33 +861,6 @@ char * get_mode_whitelist(void)
return(get_conf_string(MODE_SETTING_ENTRY, MODE_WHITELIST_KEY)); return(get_conf_string(MODE_SETTING_ENTRY, MODE_WHITELIST_KEY));
} }
int check_android_section(void)
{
GKeyFile *settingsfile;
gboolean test = FALSE;
gchar **keys;
int ret = 1;
settingsfile = g_key_file_new();
test = g_key_file_load_from_file(settingsfile, FS_MOUNT_CONFIG_FILE, G_KEY_FILE_NONE, NULL);
if(!test)
{
ret = 0;
goto cleanup;
}
keys = g_key_file_get_keys (settingsfile, ANDROID_ENTRY, NULL, NULL);
if(keys == NULL)
{
ret = 0;
goto cleanup;
}
g_strfreev(keys);
cleanup:
g_key_file_free(settingsfile);
return(ret);
}
int is_roaming_not_allowed(void) int is_roaming_not_allowed(void)
{ {
return(get_conf_int(NETWORK_ENTRY, NO_ROAMING_KEY)); return(get_conf_int(NETWORK_ENTRY, NO_ROAMING_KEY));
......
...@@ -83,8 +83,6 @@ char * get_android_product_id(void); ...@@ -83,8 +83,6 @@ char * get_android_product_id(void);
char * get_hidden_modes(void); char * get_hidden_modes(void);
char * get_mode_whitelist(void); char * get_mode_whitelist(void);
int check_android_section(void);
int is_roaming_not_allowed(void); int is_roaming_not_allowed(void);
typedef enum set_config_result_t { typedef enum set_config_result_t {
......
...@@ -733,8 +733,8 @@ static void usb_moded_init(void) ...@@ -733,8 +733,8 @@ static void usb_moded_init(void)
usb_moded_module_ctx_init(); usb_moded_module_ctx_init();
/* Android specific stuff */ /* Android specific stuff */
if(android_settings()) android_init_values();
android_init_values();
/* TODO: add more start-up clean-up and init here if needed */ /* TODO: add more start-up clean-up and init here if needed */
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment