Changed how to we start the LoggerService
This commit is contained in:
parent
32de82e884
commit
f94bc48a67
2 changed files with 5 additions and 6 deletions
|
|
@ -34,6 +34,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
mVerifyPermissions.addPermission(Manifest.permission.RECORD_AUDIO);
|
||||
mVerifyPermissions.addPermission(Manifest.permission.READ_PHONE_STATE);
|
||||
if (mVerifyPermissions.checkPermissions()) {
|
||||
VoiXtremeService.startLoggerService(getApplicationContext(), getString(R.string.app_name));
|
||||
startApplication();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ public class VoiXtremeService extends VoiXtremeServiceBase
|
|||
@Override
|
||||
public void onCreate() {
|
||||
|
||||
startLoggerService();
|
||||
startLoggerService(getApplicationContext(), getString(R.string.app_name));
|
||||
super.onCreate();
|
||||
mIsConfigured = false;
|
||||
|
||||
|
|
@ -228,11 +228,9 @@ public class VoiXtremeService extends VoiXtremeServiceBase
|
|||
/**
|
||||
* Start the NextLog Service
|
||||
*/
|
||||
private void startLoggerService() {
|
||||
public static void startLoggerService(Context context, final String appName) {
|
||||
|
||||
final String appName = getString(R.string.app_name);
|
||||
|
||||
if (Common.isServiceRunning(this, LoggerService.class.getName(), BuildConfig.APPLICATION_ID)) {
|
||||
if (Common.isServiceRunning(context, LoggerService.class.getName(), BuildConfig.APPLICATION_ID)) {
|
||||
Lg.i(TAG, "eml: Logger service already running: " + appName);
|
||||
} else {
|
||||
final LoggerService.LogNextTypes logType = LoggerService.LogNextTypes.VOIXTREME;
|
||||
|
|
@ -240,7 +238,7 @@ public class VoiXtremeService extends VoiXtremeServiceBase
|
|||
: LoggerService.LogNextMode.NONE);
|
||||
final String appVersion = BuildConfig.VERSION_NAME;
|
||||
|
||||
LoggerService.startLoggerService(getApplicationContext(), logType, logMode, appName, appVersion);
|
||||
LoggerService.startLoggerService(context, logType, logMode, appName, appVersion);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue