From e36b6ff4fa808afa84dc09fa82587dae106c8d3d Mon Sep 17 00:00:00 2001 From: Andrew Stadler Date: Wed, 15 Sep 2010 11:06:03 -0700 Subject: [PATCH] Fix debug logging controls * Assign "enable exchange parser logging" from Eas.PARSER_LOG instead of from EAS.USER_LOG. * Reorder setup to assign listeners last; This avoids unnecessary calls to Email.updateLoggingFlags() during setup. Note: The bug exists as far back as eclair, but the fix will need to be made in a different file in earlier versions (pre DebugFragment) Bug: 3003813 Change-Id: I5d8f66747a86139dd593ac16ea421ab1e33b8795 --- .../android/email/activity/setup/DebugFragment.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/android/email/activity/setup/DebugFragment.java b/src/com/android/email/activity/setup/DebugFragment.java index 26d670d97..db8c4c24c 100644 --- a/src/com/android/email/activity/setup/DebugFragment.java +++ b/src/com/android/email/activity/setup/DebugFragment.java @@ -58,16 +58,20 @@ public class DebugFragment extends Fragment implements OnCheckedChangeListener { context.getString(R.string.build_number))); mEnableDebugLoggingView = (CheckBox) view.findViewById(R.id.debug_logging); - mEnableDebugLoggingView.setOnCheckedChangeListener(this); mEnableDebugLoggingView.setChecked(Email.DEBUG); //EXCHANGE-REMOVE-SECTION-START mEnableExchangeLoggingView = (CheckBox) view.findViewById(R.id.exchange_logging); mEnableExchangeFileLoggingView = (CheckBox) view.findViewById(R.id.exchange_file_logging); + mEnableExchangeLoggingView.setChecked(Eas.PARSER_LOG); + mEnableExchangeFileLoggingView.setChecked(Eas.FILE_LOG); + //EXCHANGE-REMOVE-SECTION-END + + // Note: To prevent recursion while presetting checkboxes, assign all listeners last + mEnableDebugLoggingView.setOnCheckedChangeListener(this); + //EXCHANGE-REMOVE-SECTION-START mEnableExchangeLoggingView.setOnCheckedChangeListener(this); mEnableExchangeFileLoggingView.setOnCheckedChangeListener(this); - mEnableExchangeLoggingView.setChecked(Eas.USER_LOG); - mEnableExchangeFileLoggingView.setChecked(Eas.FILE_LOG); //EXCHANGE-REMOVE-SECTION-END return view;