diff --git a/src/org/linphone/LinphoneLauncherActivity.java b/src/org/linphone/LinphoneLauncherActivity.java index 02460c7a9..362769bc0 100644 --- a/src/org/linphone/LinphoneLauncherActivity.java +++ b/src/org/linphone/LinphoneLauncherActivity.java @@ -46,9 +46,6 @@ public class LinphoneLauncherActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - // Used to change for the lifetime of the app the name used to tag the logs - new Log(getResources().getString(R.string.app_name), !getResources().getBoolean(R.bool.disable_every_log)); - // Hack to avoid to draw twice LinphoneActivity on tablets if (getResources().getBoolean(R.bool.orientation_portrait_only)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 004d3f695..7464aa8b8 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -588,9 +588,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag try { copyAssetsFromPackage(); //traces alway start with traces enable to not missed first initialization - boolean isDebugLogEnabled = !(mR.getBoolean(R.bool.disable_every_log)); - LinphoneCoreFactory.instance().setDebugMode(isDebugLogEnabled, getString(R.string.app_name)); - LinphoneCoreFactory.instance().enableLogCollection(isDebugLogEnabled); mLc = LinphoneCoreFactory.instance().createLinphoneCore(this, mLinphoneConfigFile, mLinphoneFactoryConfigFile, null, c); @@ -619,9 +616,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag private synchronized void initLiblinphone(LinphoneCore lc) throws LinphoneCoreException { mLc = lc; - boolean isDebugLogEnabled = !(mR.getBoolean(R.bool.disable_every_log)) && mPrefs.isDebugEnabled(); - LinphoneCoreFactory.instance().setDebugMode(isDebugLogEnabled, getString(R.string.app_name)); - LinphoneCoreFactory.instance().enableLogCollection(isDebugLogEnabled); PreferencesMigrator prefMigrator = new PreferencesMigrator(mServiceContext); prefMigrator.migrateRemoteProvisioningUriIfNeeded(); diff --git a/src/org/linphone/LinphonePreferences.java b/src/org/linphone/LinphonePreferences.java index abae7649d..ea1cee5a0 100644 --- a/src/org/linphone/LinphonePreferences.java +++ b/src/org/linphone/LinphonePreferences.java @@ -81,7 +81,6 @@ public class LinphonePreferences { } if (!LinphoneManager.isInstanciated()) { - Log.w("LinphoneManager not instanciated yet..."); return LinphoneCoreFactory.instance().createLpConfig(mContext.getFilesDir().getAbsolutePath() + "/.linphonerc"); } @@ -1198,14 +1197,6 @@ public class LinphonePreferences { return getConfig().getString("app", "debug_popup_magic", null); } - public void enableDebugLogs(Boolean debugMode){ - getConfig().setBool("app", "debug_logs_enabled", debugMode); - } - - public Boolean isDebugLogsEnabled(){ - return getConfig().getBool("app", "debug_logs_enabled", false); - } - public Boolean audioPermAsked(){ return getConfig().getBool("app", "audio_perm", false); } diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index 9d1a50efb..a25ed0769 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -135,8 +135,9 @@ public final class LinphoneService extends Service { mNotificationTitle = getString(R.string.service_name); // Needed in order for the two next calls to succeed, libraries must have been loaded first + LinphonePreferences.instance().setContext(getApplicationContext()); LinphoneCoreFactory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath()); - LinphoneCoreFactory.instance().enableLogCollection(!(getResources().getBoolean(R.bool.disable_every_log))); + LinphoneCoreFactory.instance().enableLogCollection(LinphonePreferences.instance().isDebugEnabled()); // Dump some debugging information to the logs Log.i(START_LINPHONE_LOGS); diff --git a/src/org/linphone/ui/Digit.java b/src/org/linphone/ui/Digit.java index 8eb705cf3..dbe2c6b55 100644 --- a/src/org/linphone/ui/Digit.java +++ b/src/org/linphone/ui/Digit.java @@ -132,11 +132,11 @@ public class Digit extends Button implements AddressAware { public void displayDebugPopup(){ AlertDialog.Builder alertDialog = new AlertDialog.Builder(getContext()); alertDialog.setTitle(getContext().getString(R.string.debug_popup_title)); - if(LinphonePreferences.instance().isDebugLogsEnabled()) { + if(LinphonePreferences.instance().isDebugEnabled()) { alertDialog.setItems(getContext().getResources().getStringArray(R.array.popup_send_log), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if(which == 0){ - LinphonePreferences.instance().enableDebugLogs(false); + LinphonePreferences.instance().setDebugEnabled(false); LinphoneCoreFactory.instance().enableLogCollection(false); } if(which == 1) { @@ -152,7 +152,7 @@ public class Digit extends Button implements AddressAware { alertDialog.setItems(getContext().getResources().getStringArray(R.array.popup_enable_log), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if(which == 0) { - LinphonePreferences.instance().enableDebugLogs(true); + LinphonePreferences.instance().setDebugEnabled(true); LinphoneCoreFactory.instance().enableLogCollection(true); } } diff --git a/submodules/linphone b/submodules/linphone index fa00efddb..5872dddc3 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit fa00efddbb22cda2dabf6e0629de27ad40bbe45b +Subproject commit 5872dddc3c49838899a1eec80cbb61eaa0fbf299