Add isLoggable checks to all verbose and debug log outputs (1/2)
Bug: 6813854
Test: built apk and verified log is seen in logcat
Change-Id: Ib17cac0d2d9553276c4271221110305ab2d70a46
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
index e05f7c6..4e2d178 100755
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -304,7 +304,9 @@
@Override
protected void onHandleIntent(final Intent intent) {
if (intent == null) {
- Log.d(TAG, "onHandleIntent: could not handle null intent");
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onHandleIntent: could not handle null intent");
+ }
return;
}
if (!PermissionsUtil.hasPermission(this, WRITE_CONTACTS)) {
@@ -578,7 +580,7 @@
rawContactId);
lookupUri = RawContacts.getContactLookupUri(resolver, rawContactUri);
}
- if (lookupUri != null) {
+ if (lookupUri != null && Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Saved contact. New URI: " + lookupUri);
}