Suppress too verbose logging
Bug: 5345778
Change-Id: I00b87523632993ae6462fde6606a315d565e7092
diff --git a/src/com/android/contacts/ContactsApplication.java b/src/com/android/contacts/ContactsApplication.java
index 4007916..ff4ab8b 100644
--- a/src/com/android/contacts/ContactsApplication.java
+++ b/src/com/android/contacts/ContactsApplication.java
@@ -22,6 +22,7 @@
import com.google.common.annotations.VisibleForTesting;
import android.app.Application;
+import android.app.FragmentManager;
import android.app.LoaderManager;
import android.content.ContentResolver;
import android.content.Context;
@@ -109,10 +110,14 @@
Context context = getApplicationContext();
PreferenceManager.getDefaultSharedPreferences(context);
AccountTypeManager.getInstance(context);
- LoaderManager.enableDebugLogging(true);
- StrictMode.setThreadPolicy(
- new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
+ LoaderManager.enableDebugLogging(Log.isLoggable(Constants.LOADER_MANAGER_TAG, Log.DEBUG));
+ FragmentManager.enableDebugLogging(
+ Log.isLoggable(Constants.FRAGMENT_MANAGER_TAG, Log.DEBUG));
+ if (Log.isLoggable(Constants.STRICT_MODE_TAG, Log.DEBUG)) {
+ StrictMode.setThreadPolicy(
+ new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
+ }
if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
Log.d(Constants.PERFORMANCE_TAG, "ContactsApplication.onCreate finish");