Reduce usage of Log.w()

This commit is contained in:
Greyson Parrelli
2018-08-02 09:25:33 -04:00
parent a498176043
commit 43068e0613
115 changed files with 400 additions and 387 deletions

View File

@@ -87,7 +87,7 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
return;
}
Log.w(TAG, "Downloading push part " + attachmentId);
Log.i(TAG, "Downloading push part " + attachmentId);
database.setTransferState(messageId, attachmentId, AttachmentDatabase.TRANSFER_PROGRESS_STARTED);
retrieveAttachment(messageId, attachmentId, attachment);
@@ -154,9 +154,9 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
}
if (attachment.getDigest() != null) {
Log.w(TAG, "Downloading attachment with digest: " + Hex.toString(attachment.getDigest()));
Log.i(TAG, "Downloading attachment with digest: " + Hex.toString(attachment.getDigest()));
} else {
Log.w(TAG, "Downloading attachment with no digest...");
Log.i(TAG, "Downloading attachment with no digest...");
}
return new SignalServiceAttachmentPointer(id, null, key, relay,

View File

@@ -75,7 +75,7 @@ public class AvatarDownloadJob extends MasterSecretJob implements InjectableType
}
if (digest.isPresent()) {
Log.w(TAG, "Downloading group avatar with digest: " + Hex.toString(digest.get()));
Log.i(TAG, "Downloading group avatar with digest: " + Hex.toString(digest.get()));
}
attachment = File.createTempFile("avatar", "tmp", context.getCacheDir());

View File

@@ -51,7 +51,7 @@ public class CleanPreKeysJob extends MasterSecretJob implements InjectableType {
@Override
public void onRun(MasterSecret masterSecret) throws IOException {
try {
Log.w(TAG, "Cleaning prekeys...");
Log.i(TAG, "Cleaning prekeys...");
int activeSignedPreKeyId = PreKeyUtil.getActiveSignedPreKeyId(context);
SignedPreKeyStore signedPreKeyStore = signedPreKeyStoreFactory.create();
@@ -64,8 +64,8 @@ public class CleanPreKeysJob extends MasterSecretJob implements InjectableType {
Collections.sort(oldRecords, new SignedPreKeySorter());
Log.w(TAG, "Active signed prekey: " + activeSignedPreKeyId);
Log.w(TAG, "Old signed prekey record count: " + oldRecords.size());
Log.i(TAG, "Active signed prekey: " + activeSignedPreKeyId);
Log.i(TAG, "Old signed prekey record count: " + oldRecords.size());
boolean foundAgedRecord = false;
@@ -76,7 +76,7 @@ public class CleanPreKeysJob extends MasterSecretJob implements InjectableType {
if (!foundAgedRecord) {
foundAgedRecord = true;
} else {
Log.w(TAG, "Removing signed prekey record: " + oldRecord.getId() + " with timestamp: " + oldRecord.getTimestamp());
Log.i(TAG, "Removing signed prekey record: " + oldRecord.getId() + " with timestamp: " + oldRecord.getTimestamp());
signedPreKeyStore.removeSignedPreKey(oldRecord.getId());
}
}

View File

@@ -16,6 +16,8 @@ import java.io.IOException;
public class DirectoryRefreshJob extends ContextJob {
private static final String TAG = DirectoryRefreshJob.class.getSimpleName();
@Nullable private transient Recipient recipient;
private transient boolean notifyOfNewUsers;
@@ -41,7 +43,7 @@ public class DirectoryRefreshJob extends ContextJob {
@Override
public void onRun() throws IOException {
Log.w("DirectoryRefreshJob", "DirectoryRefreshJob.onRun()");
Log.i(TAG, "DirectoryRefreshJob.onRun()");
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Directory Refresh");

View File

@@ -62,7 +62,7 @@ public class GcmRefreshJob extends ContextJob implements InjectableType {
public void onRun() throws Exception {
if (TextSecurePreferences.isGcmDisabled(context)) return;
Log.w(TAG, "Reregistering GCM...");
Log.i(TAG, "Reregistering GCM...");
int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context);
if (result != ConnectionResult.SUCCESS) {

View File

@@ -41,7 +41,7 @@ public class LocalBackupJob extends ContextJob {
@Override
public void onRun() throws NoExternalStorageException, IOException {
Log.w(TAG, "Executing backup job...");
Log.i(TAG, "Executing backup job...");
if (!Permissions.hasAll(context, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
throw new IOException("No external storage permission!");

View File

@@ -113,7 +113,7 @@ public class MmsDownloadJob extends MasterSecretJob {
Log.w(TAG, e);
}
Log.w(TAG, "Downloading mms at " + Uri.parse(contentLocation).getHost() + ", subscription ID: " + notification.get().getSubscriptionId());
Log.i(TAG, "Downloading mms at " + Uri.parse(contentLocation).getHost() + ", subscription ID: " + notification.get().getSubscriptionId());
RetrieveConf retrieveConf = new CompatMmsConnection(context).retrieve(contentLocation, transactionId, notification.get().getSubscriptionId());

View File

@@ -60,7 +60,7 @@ public class MmsReceiveJob extends ContextJob {
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
Pair<Long, Long> messageAndThreadId = database.insertMessageInbox((NotificationInd)pdu, subscriptionId);
Log.w(TAG, "Inserted received MMS notification...");
Log.i(TAG, "Inserted received MMS notification...");
ApplicationContext.getInstance(context)
.getJobManager()

View File

@@ -138,8 +138,8 @@ public class MmsSendJob extends SendJob {
}
private boolean isInconsistentResponse(SendReq message, SendConf response) {
Log.w(TAG, "Comparing: " + Hex.toString(message.getTransactionId()));
Log.w(TAG, "With: " + Hex.toString(response.getTransactionId()));
Log.i(TAG, "Comparing: " + Hex.toString(message.getTransactionId()));
Log.i(TAG, "With: " + Hex.toString(response.getTransactionId()));
return !Arrays.equals(message.getTransactionId(), response.getTransactionId());
}

View File

@@ -200,7 +200,7 @@ public class PushDecryptJob extends ContextJob {
else if (syncMessage.getVerified().isPresent()) handleSynchronizeVerifiedMessage(syncMessage.getVerified().get());
else Log.w(TAG, "Contains no known sync types...");
} else if (content.getCallMessage().isPresent()) {
Log.w(TAG, "Got call message...");
Log.i(TAG, "Got call message...");
SignalServiceCallMessage message = content.getCallMessage().get();
if (message.getOfferMessage().isPresent()) handleCallOfferMessage(envelope, message.getOfferMessage().get(), smsMessageId);
@@ -266,7 +266,7 @@ public class PushDecryptJob extends ContextJob {
private void handleCallAnswerMessage(@NonNull SignalServiceEnvelope envelope,
@NonNull AnswerMessage message)
{
Log.w(TAG, "handleCallAnswerMessage...");
Log.i(TAG, "handleCallAnswerMessage...");
Intent intent = new Intent(context, WebRtcCallService.class);
intent.setAction(WebRtcCallService.ACTION_RESPONSE_MESSAGE);
intent.putExtra(WebRtcCallService.EXTRA_CALL_ID, message.getId());
@@ -297,7 +297,7 @@ public class PushDecryptJob extends ContextJob {
@NonNull HangupMessage message,
@NonNull Optional<Long> smsMessageId)
{
Log.w(TAG, "handleCallHangupMessage");
Log.i(TAG, "handleCallHangupMessage");
if (smsMessageId.isPresent()) {
DatabaseFactory.getSmsDatabase(context).markAsMissedCall(smsMessageId.get());
} else {
@@ -846,7 +846,7 @@ public class PushDecryptJob extends ContextJob {
@NonNull SignalServiceReceiptMessage message)
{
for (long timestamp : message.getTimestamps()) {
Log.w(TAG, String.format("Received encrypted delivery receipt: (XXXXX, %d)", timestamp));
Log.i(TAG, String.format("Received encrypted delivery receipt: (XXXXX, %d)", timestamp));
DatabaseFactory.getMmsSmsDatabase(context)
.incrementDeliveryReceiptCount(new SyncMessageId(Address.fromExternal(context, envelope.getSource()), timestamp), System.currentTimeMillis());
}
@@ -857,7 +857,7 @@ public class PushDecryptJob extends ContextJob {
{
if (TextSecurePreferences.isReadReceiptsEnabled(context)) {
for (long timestamp : message.getTimestamps()) {
Log.w(TAG, String.format("Received encrypted read receipt: (XXXXX, %d)", timestamp));
Log.i(TAG, String.format("Received encrypted read receipt: (XXXXX, %d)", timestamp));
DatabaseFactory.getMmsSmsDatabase(context)
.incrementReadReceiptCount(new SyncMessageId(Address.fromExternal(context, envelope.getSource()), timestamp), envelope.getTimestamp());
@@ -882,7 +882,7 @@ public class PushDecryptJob extends ContextJob {
MessageRecord message = DatabaseFactory.getMmsSmsDatabase(context).getMessageFor(quote.get().getId(), author);
if (message != null) {
Log.w(TAG, "Found matching message record...");
Log.i(TAG, "Found matching message record...");
List<Attachment> attachments = new LinkedList<>();

View File

@@ -53,7 +53,7 @@ public abstract class PushReceivedJob extends ContextJob {
}
private void handleReceipt(SignalServiceEnvelope envelope) {
Log.w(TAG, String.format("Received receipt: (XXXXX, %d)", envelope.getTimestamp()));
Log.i(TAG, String.format("Received receipt: (XXXXX, %d)", envelope.getTimestamp()));
DatabaseFactory.getMmsSmsDatabase(context).incrementDeliveryReceiptCount(new SyncMessageId(Address.fromExternal(context, envelope.getSource()),
envelope.getTimestamp()), System.currentTimeMillis());
}

View File

@@ -51,7 +51,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
SmsMessageRecord record = database.getMessage(messageId);
try {
Log.w(TAG, "Sending message: " + messageId);
Log.i(TAG, "Sending message: " + messageId);
deliver(record);
database.markAsSent(messageId, true);

View File

@@ -53,7 +53,7 @@ public class RefreshPreKeysJob extends MasterSecretJob implements InjectableType
int availableKeys = accountManager.getPreKeysCount();
if (availableKeys >= PREKEY_MINIMUM && TextSecurePreferences.isSignedPreKeyRegistered(context)) {
Log.w(TAG, "Available keys sufficient: " + availableKeys);
Log.i(TAG, "Available keys sufficient: " + availableKeys);
return;
}
@@ -61,7 +61,7 @@ public class RefreshPreKeysJob extends MasterSecretJob implements InjectableType
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context);
SignedPreKeyRecord signedPreKeyRecord = PreKeyUtil.generateSignedPreKey(context, identityKey, false);
Log.w(TAG, "Registering new prekeys...");
Log.i(TAG, "Registering new prekeys...");
accountManager.setPreKeys(identityKey.getPublicKey(), signedPreKeyRecord, preKeyRecords);

View File

@@ -41,7 +41,7 @@ public class RotateSignedPreKeyJob extends MasterSecretJob implements Injectable
@Override
public void onRun(MasterSecret masterSecret) throws Exception {
Log.w(TAG, "Rotating signed prekey...");
Log.i(TAG, "Rotating signed prekey...");
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context);
SignedPreKeyRecord signedPreKeyRecord = PreKeyUtil.generateSignedPreKey(context, identityKey, false);

View File

@@ -45,7 +45,7 @@ public class SmsReceiveJob extends ContextJob {
@Override
public void onRun() throws MigrationPendingException {
Log.w(TAG, "onRun()");
Log.i(TAG, "onRun()");
Optional<IncomingTextMessage> message = assembleMessageFragments(pdus, subscriptionId);

View File

@@ -48,7 +48,7 @@ public class SmsSendJob extends SendJob {
SmsMessageRecord record = database.getMessage(messageId);
try {
Log.w(TAG, "Sending message: " + messageId);
Log.i(TAG, "Sending message: " + messageId);
deliver(record);
} catch (UndeliverableMessageException ude) {
@@ -106,8 +106,8 @@ public class SmsSendJob extends SendJob {
getSmsManagerFor(message.getSubscriptionId()).sendMultipartTextMessage(recipient, null, messages, sentIntents, deliveredIntents);
} catch (NullPointerException | IllegalArgumentException npe) {
Log.w(TAG, npe);
Log.w(TAG, "Recipient: " + recipient);
Log.w(TAG, "Message Parts: " + messages.size());
Log.i(TAG, "Recipient: " + recipient);
Log.i(TAG, "Message Parts: " + messages.size());
try {
for (int i=0;i<messages.size();i++) {

View File

@@ -43,7 +43,7 @@ public class SmsSentJob extends MasterSecretJob {
@Override
public void onRun(MasterSecret masterSecret) {
Log.w(TAG, "Got SMS callback: " + action + " , " + result);
Log.i(TAG, "Got SMS callback: " + action + " , " + result);
switch (action) {
case SmsDeliveryListener.SENT_SMS_ACTION:

View File

@@ -52,7 +52,7 @@ public class UpdateApkJob extends ContextJob {
public void onRun() throws IOException, PackageManager.NameNotFoundException {
if (!BuildConfig.PLAY_STORE_DISABLED) return;
Log.w(TAG, "Checking for APK update...");
Log.i(TAG, "Checking for APK update...");
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url(String.format("%s/latest.json", BuildConfig.NOPLAY_UPDATE_URL)).build();
@@ -66,18 +66,18 @@ public class UpdateApkJob extends ContextJob {
UpdateDescriptor updateDescriptor = JsonUtils.fromJson(response.body().string(), UpdateDescriptor.class);
byte[] digest = Hex.fromStringCondensed(updateDescriptor.getDigest());
Log.w(TAG, "Got descriptor: " + updateDescriptor);
Log.i(TAG, "Got descriptor: " + updateDescriptor);
if (updateDescriptor.getVersionCode() > getVersionCode()) {
DownloadStatus downloadStatus = getDownloadStatus(updateDescriptor.getUrl(), digest);
Log.w(TAG, "Download status: " + downloadStatus.getStatus());
Log.i(TAG, "Download status: " + downloadStatus.getStatus());
if (downloadStatus.getStatus() == DownloadStatus.Status.COMPLETE) {
Log.w(TAG, "Download status complete, notifying...");
Log.i(TAG, "Download status complete, notifying...");
handleDownloadNotify(downloadStatus.getDownloadId());
} else if (downloadStatus.getStatus() == DownloadStatus.Status.MISSING) {
Log.w(TAG, "Download status missing, starting download...");
Log.i(TAG, "Download status missing, starting download...");
handleDownloadStart(updateDescriptor.getUrl(), updateDescriptor.getVersionName(), digest);
}
}