From d10a44f8ebd91699598ae6928f53000bb3ad2f21 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Thu, 27 Sep 2018 20:01:01 -0700 Subject: [PATCH] Suppress some noisy logs. --- .../securesms/jobs/MultiDeviceContactUpdateJob.java | 7 ++++--- .../thoughtcrime/securesms/logsubmit/util/Scrubber.java | 4 ++-- src/org/thoughtcrime/securesms/mms/SignalGlideModule.java | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java b/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java index b9556e1e8c..9a11b4b08d 100644 --- a/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java @@ -236,9 +236,10 @@ public class MultiDeviceContactUpdateJob extends MasterSecretJob implements Inje } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + Uri displayPhotoUri = Uri.withAppendedPath(uri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO); + try { - Uri displayPhotoUri = Uri.withAppendedPath(uri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO); - AssetFileDescriptor fd = context.getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r"); + AssetFileDescriptor fd = context.getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r"); if (fd == null) { return Optional.absent(); @@ -250,7 +251,7 @@ public class MultiDeviceContactUpdateJob extends MasterSecretJob implements Inje .withLength(fd.getLength()) .build()); } catch (IOException e) { - Log.w(TAG, e); + Log.i(TAG, "Could not find avatar for URI: " + displayPhotoUri); } } diff --git a/src/org/thoughtcrime/securesms/logsubmit/util/Scrubber.java b/src/org/thoughtcrime/securesms/logsubmit/util/Scrubber.java index 8f928bd6a9..ba37bb69e8 100644 --- a/src/org/thoughtcrime/securesms/logsubmit/util/Scrubber.java +++ b/src/org/thoughtcrime/securesms/logsubmit/util/Scrubber.java @@ -43,7 +43,7 @@ public class Scrubber { } public String scrub(final String in) { - Log.d(TAG, "scrubbing input"); + android.util.Log.d(TAG, "scrubbing input"); String out = in; for (Pattern pattern : patterns) { Matcher matcher = pattern.matcher(out); @@ -59,7 +59,7 @@ public class Scrubber { builder.append(censored); lastEndingPos = matcher.end(); - Log.i(TAG, "replacing a match on /" + pattern.toString() + "/ => " + censored); + android.util.Log.i(TAG, "replacing a match on /" + pattern.toString() + "/ => " + censored); } builder.append(out.substring(lastEndingPos)); out = builder.toString(); diff --git a/src/org/thoughtcrime/securesms/mms/SignalGlideModule.java b/src/org/thoughtcrime/securesms/mms/SignalGlideModule.java index 3584823893..888e39c3b1 100644 --- a/src/org/thoughtcrime/securesms/mms/SignalGlideModule.java +++ b/src/org/thoughtcrime/securesms/mms/SignalGlideModule.java @@ -48,7 +48,7 @@ public class SignalGlideModule extends AppGlideModule { @Override public void applyOptions(Context context, GlideBuilder builder) { - builder.setLogLevel(Log.INFO); + builder.setLogLevel(Log.ERROR); // builder.setDiskCache(new NoopDiskCacheFactory()); }