Commit dd4731b3 authored by Philippe De Swert's avatar Philippe De Swert

[usb-moded] Split of appsync for diag mode also. It's cleaner that way.

Signed-off-by: default avatarPhilippe De Swert <philippe.deswert@jollamobile.com>
parent ee07aad3
......@@ -272,11 +272,13 @@ install -m 644 -D %{SOURCE2} %{buildroot}/%{_sysconfdir}/modprobe.d/usb_moded.co
install -m 644 -D %{SOURCE1} %{buildroot}/lib/systemd/system/%{name}.service
install -d %{buildroot}/%{_sysconfdir}/usb-moded
install -d %{buildroot}/%{_sysconfdir}/usb-moded/run
install -d %{buildroot}/%{_sysconfdir}/usb-moded/run-diag
install -d %{buildroot}/%{_sysconfdir}/usb-moded/dyn-modes
install -d %{buildroot}/%{_sysconfdir}/usb-moded/diag
install -m 644 -D config/dyn-modes/* %{buildroot}/%{_sysconfdir}/usb-moded/dyn-modes/
install -m 644 -D config/diag/* %{buildroot}/%{_sysconfdir}/usb-moded/diag/
install -m 644 -D config/run/* %{buildroot}/%{_sysconfdir}/usb-moded/run/
install -m 644 -D config/run-diag/* %{buildroot}/%{_sysconfdir}/usb-moded/run-diag/
install -m 644 -D config/mass-storage-jolla.ini %{buildroot}/%{_sysconfdir}/usb-moded/
install -d $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants/
ln -s ../%{name}.service $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants/%{name}.service
......@@ -367,7 +369,7 @@ systemctl daemon-reload || :
%files diagnostics-config
%defattr(-,root,root,-)
%{_sysconfdir}/usb-moded/diag/qa_diagnostic_mode.ini
%{_sysconfdir}/usb-moded/run/qa-diagnostic.ini
%{_sysconfdir}/usb-moded/run-diag/qa-diagnostic.ini
%files connection-sharing-android-config
%defattr(-,root,root,-)
......
......@@ -77,7 +77,7 @@ void free_appsync_list(void)
}
}
void readlist(void)
void readlist(int diag)
{
GDir *confdir = 0;
......@@ -86,8 +86,16 @@ void readlist(void)
free_appsync_list();
if( !(confdir = g_dir_open(CONF_DIR_PATH, 0, NULL)) )
goto cleanup;
if(diag)
{
if( !(confdir = g_dir_open(CONF_DIR_DIAG_PATH, 0, NULL)) )
goto cleanup;
}
else
{
if( !(confdir = g_dir_open(CONF_DIR_PATH, 0, NULL)) )
goto cleanup;
}
while( (dirname = g_dir_read_name(confdir)) )
{
......
......@@ -19,7 +19,8 @@
02110-1301 USA
*/
#define CONF_DIR_PATH "/etc/usb-moded/run"
#define CONF_DIR_PATH "/etc/usb-moded/run"
#define CONF_DIR_DIAG_PATH "/etc/usb-moded/run-diag"
#define APP_INFO_ENTRY "info"
#define APP_INFO_MODE_KEY "mode"
......@@ -45,7 +46,7 @@ typedef struct list_elem
/*@}*/
}list_elem;
void readlist(void);
void readlist(int diag);
int activate_sync(const char *mode);
int activate_sync_post(const char *mode);
int mark_active(const gchar *name);
......
......@@ -516,7 +516,7 @@ static void usb_moded_init(void)
}
#ifdef APP_SYNC
readlist();
readlist(diag_mode);
/* make sure all services are down when starting */
appsync_stop();
modelist = read_mode_list(diag_mode);
......
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