diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index bcc7e63930..e61ca6521b 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -274,7 +274,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override protected void onCreate(Bundle state, boolean ready) { - Log.w(TAG, "onCreate()"); + Log.i(TAG, "onCreate()"); supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); setContentView(R.layout.conversation_activity); @@ -316,7 +316,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override protected void onNewIntent(Intent intent) { - Log.w(TAG, "onNewIntent()"); + Log.i(TAG, "onNewIntent()"); if (isFinishing()) { Log.w(TAG, "Activity is finishing..."); @@ -370,7 +370,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity MessageNotifier.setVisibleThread(threadId); markThreadAsRead(); - Log.w(TAG, "onResume() Finished: " + (System.currentTimeMillis() - getIntent().getLongExtra(TIMING_EXTRA, 0))); + Log.i(TAG, "onResume() Finished: " + (System.currentTimeMillis() - getIntent().getLongExtra(TIMING_EXTRA, 0))); } @Override @@ -395,7 +395,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override public void onConfigurationChanged(Configuration newConfig) { - Log.w(TAG, "onConfigurationChanged(" + newConfig.orientation + ")"); + Log.i(TAG, "onConfigurationChanged(" + newConfig.orientation + ")"); super.onConfigurationChanged(newConfig); composeText.setTransport(sendButton.getSelectedTransport()); quickAttachmentDrawer.onConfigurationChanged(); @@ -415,7 +415,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override public void onActivityResult(final int reqCode, int resultCode, Intent data) { - Log.w(TAG, "onActivityResult called: " + reqCode + ", " + resultCode + " , " + data); + Log.i(TAG, "onActivityResult called: " + reqCode + ", " + resultCode + " , " + data); super.onActivityResult(reqCode, resultCode, data); if ((data == null && reqCode != TAKE_PHOTO && reqCode != SMS_DEFAULT) || @@ -589,7 +589,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override public void onBackPressed() { - Log.w(TAG, "onBackPressed()"); + Log.d(TAG, "onBackPressed()"); if (container.isInputOpen()) container.hideCurrentInput(composeText); else super.onBackPressed(); } @@ -972,7 +972,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } private void handleSecurityChange(boolean isSecureText, boolean isDefaultSms) { - Log.w(TAG, "handleSecurityChange(" + isSecureText + ", " + isDefaultSms + ")"); + Log.i(TAG, "handleSecurityChange(" + isSecureText + ", " + isDefaultSms + ")"); if (isSecurityInitialized && isSecureText == this.isSecureText && isDefaultSms == this.isDefaultSms) { return; } @@ -1108,33 +1108,33 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity protected boolean[] doInBackground(Recipient... params) { Context context = ConversationActivity.this; Recipient recipient = params[0]; - Log.w(TAG, "Resolving registered state..."); + Log.i(TAG, "Resolving registered state..."); RegisteredState registeredState; if (recipient.isPushGroupRecipient()) { - Log.w(TAG, "Push group recipient..."); + Log.i(TAG, "Push group recipient..."); registeredState = RegisteredState.REGISTERED; } else if (recipient.isResolving()) { - Log.w(TAG, "Talking to DB directly."); + Log.i(TAG, "Talking to DB directly."); registeredState = DatabaseFactory.getRecipientDatabase(ConversationActivity.this).isRegistered(recipient.getAddress()); } else { - Log.w(TAG, "Checking through resolved recipient"); + Log.i(TAG, "Checking through resolved recipient"); registeredState = recipient.resolve().getRegistered(); } - Log.w(TAG, "Resolved registered state: " + registeredState); + Log.i(TAG, "Resolved registered state: " + registeredState); boolean signalEnabled = TextSecurePreferences.isPushRegistered(context); if (registeredState == RegisteredState.UNKNOWN) { try { - Log.w(TAG, "Refreshing directory for user: " + recipient.getAddress().serialize()); + Log.i(TAG, "Refreshing directory for user: " + recipient.getAddress().serialize()); registeredState = DirectoryHelper.refreshDirectoryFor(context, recipient); } catch (IOException e) { Log.w(TAG, e); } } - Log.w(TAG, "Returning registered state..."); + Log.i(TAG, "Returning registered state..."); return new boolean[] {registeredState == RegisteredState.REGISTERED && signalEnabled, Util.isDefaultSmsProvider(context)}; } @@ -1142,7 +1142,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override protected void onPostExecute(boolean[] result) { if (result[0] != currentSecureText || result[1] != currentIsDefaultSms) { - Log.w(TAG, "onPostExecute() handleSecurityChange: " + result[0] + " , " + result[1]); + Log.i(TAG, "onPostExecute() handleSecurityChange: " + result[0] + " , " + result[1]); handleSecurityChange(result[0], result[1]); } future.set(true); @@ -1154,13 +1154,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } private void onSecurityUpdated() { - Log.w(TAG, "onSecurityUpdated()"); + Log.i(TAG, "onSecurityUpdated()"); updateReminders(recipient.hasSeenInviteReminder()); updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId()); } protected void updateReminders(boolean seenInvite) { - Log.w(TAG, "updateReminders(" + seenInvite + ")"); + Log.i(TAG, "updateReminders(" + seenInvite + ")"); if (UnauthorizedReminder.isEligible(this)) { reminderView.get().showReminder(new UnauthorizedReminder(this)); @@ -1187,7 +1187,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } private void updateDefaultSubscriptionId(Optional defaultSubscriptionId) { - Log.w(TAG, "updateDefaultSubscriptionId(" + defaultSubscriptionId.orNull() + ")"); + Log.i(TAG, "updateDefaultSubscriptionId(" + defaultSubscriptionId.orNull() + ")"); sendButton.setDefaultSubscriptionId(defaultSubscriptionId); } @@ -1223,7 +1223,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } for (Recipient recipient : recipients) { - Log.w(TAG, "Loading identity for: " + recipient.getAddress()); + Log.i(TAG, "Loading identity for: " + recipient.getAddress()); identityRecordList.add(identityDatabase.getIdentity(recipient.getAddress())); } @@ -1238,16 +1238,16 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override protected void onPostExecute(@NonNull Pair result) { - Log.w(TAG, "Got identity records: " + result.first.isUnverified()); + Log.i(TAG, "Got identity records: " + result.first.isUnverified()); identityRecords.replaceWith(result.first); if (result.second != null) { - Log.w(TAG, "Replacing banner..."); + Log.d(TAG, "Replacing banner..."); unverifiedBannerView.get().display(result.second, result.first.getUnverifiedRecords(), new UnverifiedClickedListener(), new UnverifiedDismissedListener()); } else if (unverifiedBannerView.resolved()) { - Log.w(TAG, "Clearing banner..."); + Log.d(TAG, "Clearing banner..."); unverifiedBannerView.get().hide(); } @@ -1362,7 +1362,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private void initializeProfiles() { if (!isSecureText) { - Log.w(TAG, "SMS contact, no profile fetch needed."); + Log.i(TAG, "SMS contact, no profile fetch needed."); return; } @@ -1373,9 +1373,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override public void onModified(final Recipient recipient) { - Log.w(TAG, "onModified(" + recipient.getAddress().serialize() + ")"); + Log.i(TAG, "onModified(" + recipient.getAddress().serialize() + ")"); Util.runOnMain(() -> { - Log.w(TAG, "onModifiedRun(): " + recipient.getRegistered()); + Log.i(TAG, "onModifiedRun(): " + recipient.getRegistered()); titleView.setTitle(glideRequests, recipient); titleView.setVerified(identityRecords.isVerified()); setBlockedUserState(recipient, isSecureText, isDefaultSms); @@ -1410,7 +1410,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity //////// Helper Methods private void addAttachment(int type) { - Log.w("ComposeMessageActivity", "Selected: " + type); + Log.i(TAG, "Selected: " + type); switch (type) { case AttachmentTypeSelector.ADD_GALLERY: AttachmentManager.selectGallery(this, PICK_GALLERY); break; @@ -1718,8 +1718,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity long expiresIn = recipient.getExpireMessages() * 1000L; boolean initiating = threadId == -1; - Log.w(TAG, "isManual Selection: " + sendButton.isManualSelection()); - Log.w(TAG, "forceSms: " + forceSms); + Log.i(TAG, "isManual Selection: " + sendButton.isManualSelection()); + Log.i(TAG, "forceSms: " + forceSms); if ((recipient.isMmsGroupRecipient() || recipient.getAddress().isEmail()) && !isMmsEnabled) { handleManualMmsRequired(); @@ -1747,7 +1747,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private void sendMediaMessage(final boolean forceSms, final long expiresIn, final int subscriptionId, boolean initiating) throws InvalidMessageException { - Log.w(TAG, "Sending media message..."); + Log.i(TAG, "Sending media message..."); sendMediaMessage(forceSms, getMessage(), attachmentManager.buildSlideDeck(), Collections.emptyList(), expiresIn, subscriptionId, initiating); } @@ -2198,7 +2198,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private class UnverifiedClickedListener implements UnverifiedBannerView.ClickListener { @Override public void onClicked(final List unverifiedIdentities) { - Log.w(TAG, "onClicked: " + unverifiedIdentities.size()); + Log.i(TAG, "onClicked: " + unverifiedIdentities.size()); if (unverifiedIdentities.size() == 1) { Intent intent = new Intent(ConversationActivity.this, VerifyIdentityActivity.class); intent.putExtra(VerifyIdentityActivity.ADDRESS_EXTRA, unverifiedIdentities.get(0).getAddress()); diff --git a/src/org/thoughtcrime/securesms/ConversationAdapter.java b/src/org/thoughtcrime/securesms/ConversationAdapter.java index 82b233f968..93da2ca23a 100644 --- a/src/org/thoughtcrime/securesms/ConversationAdapter.java +++ b/src/org/thoughtcrime/securesms/ConversationAdapter.java @@ -209,7 +209,7 @@ public class ConversationAdapter recordToPulseHighlight = null; } - Log.w(TAG, "Bind time: " + (System.currentTimeMillis() - start)); + Log.d(TAG, "Bind time: " + (System.currentTimeMillis() - start)); } @Override @@ -228,7 +228,7 @@ public class ConversationAdapter return true; }); itemView.setEventListener(clickListener); - Log.w(TAG, "Inflate time: " + (System.currentTimeMillis() - start)); + Log.d(TAG, "Inflate time: " + (System.currentTimeMillis() - start)); return new ViewHolder(itemView); } diff --git a/src/org/thoughtcrime/securesms/ConversationFragment.java b/src/org/thoughtcrime/securesms/ConversationFragment.java index a316d049eb..9ec757fc3c 100644 --- a/src/org/thoughtcrime/securesms/ConversationFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationFragment.java @@ -460,7 +460,7 @@ public class ConversationFragment extends Fragment @Override public Loader onCreateLoader(int id, Bundle args) { - Log.w(TAG, "onCreateLoader"); + Log.i(TAG, "onCreateLoader"); loaderStartTime = System.currentTimeMillis(); int limit = args.getInt(KEY_LIMIT, PARTIAL_CONVERSATION_LIMIT); @@ -477,7 +477,7 @@ public class ConversationFragment extends Fragment public void onLoadFinished(Loader cursorLoader, Cursor cursor) { long loadTime = System.currentTimeMillis() - loaderStartTime; int count = cursor.getCount(); - Log.w(TAG, "onLoadFinished - took " + loadTime + " ms to load a cursor of size " + count); + Log.i(TAG, "onLoadFinished - took " + loadTime + " ms to load a cursor of size " + count); ConversationLoader loader = (ConversationLoader)cursorLoader; ConversationAdapter adapter = getListAdapter(); diff --git a/src/org/thoughtcrime/securesms/ConversationItem.java b/src/org/thoughtcrime/securesms/ConversationItem.java index 29465afbf0..ffcae68be9 100644 --- a/src/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/ConversationItem.java @@ -890,9 +890,9 @@ public class ConversationItem extends LinearLayout context.startActivity(intent); } else if (slide.getUri() != null) { - Log.w(TAG, "Clicked: " + slide.getUri() + " , " + slide.getContentType()); + Log.i(TAG, "Clicked: " + slide.getUri() + " , " + slide.getContentType()); Uri publicUri = PartAuthority.getAttachmentPublicUri(slide.getUri()); - Log.w(TAG, "Public URI: " + publicUri); + Log.i(TAG, "Public URI: " + publicUri); Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setDataAndType(PartAuthority.getAttachmentPublicUri(slide.getUri()), slide.getContentType()); diff --git a/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java b/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java index b2b82a7627..b682d16a6c 100644 --- a/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java +++ b/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java @@ -115,7 +115,7 @@ public class DatabaseUpgradeActivity extends BaseActivity { this.masterSecret = KeyCachingService.getMasterSecret(this); if (needsUpgradeTask()) { - Log.w("DatabaseUpgradeActivity", "Upgrading..."); + Log.i("DatabaseUpgradeActivity", "Upgrading..."); setContentView(R.layout.database_upgrade_activity); ProgressBar indeterminateProgress = findViewById(R.id.indeterminate_progress); @@ -135,13 +135,13 @@ public class DatabaseUpgradeActivity extends BaseActivity { int currentVersionCode = Util.getCurrentApkReleaseVersion(this); int lastSeenVersion = VersionTracker.getLastSeenVersion(this); - Log.w("DatabaseUpgradeActivity", "LastSeenVersion: " + lastSeenVersion); + Log.i("DatabaseUpgradeActivity", "LastSeenVersion: " + lastSeenVersion); if (lastSeenVersion >= currentVersionCode) return false; for (int version : UPGRADE_VERSIONS) { - Log.w("DatabaseUpgradeActivity", "Comparing: " + version); + Log.i("DatabaseUpgradeActivity", "Comparing: " + version); if (lastSeenVersion < version) return true; } @@ -192,7 +192,7 @@ public class DatabaseUpgradeActivity extends BaseActivity { protected Void doInBackground(Integer... params) { Context context = DatabaseUpgradeActivity.this.getApplicationContext(); - Log.w("DatabaseUpgradeActivity", "Running background upgrade.."); + Log.i("DatabaseUpgradeActivity", "Running background upgrade.."); DatabaseFactory.getInstance(DatabaseUpgradeActivity.this) .onApplicationLevelUpgrade(context, masterSecret, params[0], this); @@ -314,16 +314,16 @@ public class DatabaseUpgradeActivity extends BaseActivity { final MmsDatabase mmsDb = DatabaseFactory.getMmsDatabase(context); final List pendingAttachments = DatabaseFactory.getAttachmentDatabase(context).getPendingAttachments(); - Log.w(TAG, pendingAttachments.size() + " pending parts."); + Log.i(TAG, pendingAttachments.size() + " pending parts."); for (DatabaseAttachment attachment : pendingAttachments) { final Reader reader = mmsDb.readerFor(mmsDb.getMessage(attachment.getMmsId())); final MessageRecord record = reader.getNext(); if (attachment.hasData()) { - Log.w(TAG, "corrected a pending media part " + attachment.getAttachmentId() + "that already had data."); + Log.i(TAG, "corrected a pending media part " + attachment.getAttachmentId() + "that already had data."); attachmentDb.setTransferState(attachment.getMmsId(), attachment.getAttachmentId(), AttachmentDatabase.TRANSFER_PROGRESS_DONE); } else if (record != null && !record.isOutgoing() && record.isPush()) { - Log.w(TAG, "queuing new attachment download job for incoming push part " + attachment.getAttachmentId() + "."); + Log.i(TAG, "queuing new attachment download job for incoming push part " + attachment.getAttachmentId() + "."); ApplicationContext.getInstance(context) .getJobManager() .add(new AttachmentDownloadJob(context, attachment.getMmsId(), attachment.getAttachmentId(), false)); diff --git a/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java b/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java index 53c686e7e3..795f1b35df 100644 --- a/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java +++ b/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java @@ -172,7 +172,7 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity { public static Optional getExperienceUpgrade(Context context) { final int currentVersionCode = Util.getCurrentApkReleaseVersion(context); final int lastSeenVersion = TextSecurePreferences.getLastExperienceVersionCode(context); - Log.w(TAG, "getExperienceUpgrade(" + lastSeenVersion + ")"); + Log.i(TAG, "getExperienceUpgrade(" + lastSeenVersion + ")"); if (lastSeenVersion >= currentVersionCode) { TextSecurePreferences.setLastExperienceVersionCode(context, currentVersionCode); diff --git a/src/org/thoughtcrime/securesms/MediaPreviewActivity.java b/src/org/thoughtcrime/securesms/MediaPreviewActivity.java index aa478b47a8..612f525eda 100644 --- a/src/org/thoughtcrime/securesms/MediaPreviewActivity.java +++ b/src/org/thoughtcrime/securesms/MediaPreviewActivity.java @@ -197,7 +197,7 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im finish(); } - Log.w(TAG, "Loading Part URI: " + initialMediaUri); + Log.i(TAG, "Loading Part URI: " + initialMediaUri); if (conversationRecipient != null) { getSupportLoaderManager().restartLoader(0, null, this); diff --git a/src/org/thoughtcrime/securesms/PassphraseActivity.java b/src/org/thoughtcrime/securesms/PassphraseActivity.java index c8a3152c3a..318cbf73be 100644 --- a/src/org/thoughtcrime/securesms/PassphraseActivity.java +++ b/src/org/thoughtcrime/securesms/PassphraseActivity.java @@ -34,6 +34,8 @@ import org.thoughtcrime.securesms.service.KeyCachingService; */ public abstract class PassphraseActivity extends BaseActionBarActivity { + private static final String TAG = PassphraseActivity.class.getSimpleName(); + private KeyCachingService keyCachingService; private MasterSecret masterSecret; @@ -62,8 +64,7 @@ public abstract class PassphraseActivity extends BaseActionBarActivity { try { startActivity(nextIntent); } catch (java.lang.SecurityException e) { - Log.w("PassphraseActivity", - "Access permission not passed from PassphraseActivity, retry sharing."); + Log.w(TAG, "Access permission not passed from PassphraseActivity, retry sharing."); } } finish(); diff --git a/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java b/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java index 9d8fd1b168..b0aa6bb53a 100644 --- a/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java +++ b/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java @@ -88,7 +88,7 @@ public class PassphrasePromptActivity extends PassphraseActivity { @Override public void onCreate(Bundle savedInstanceState) { - Log.w(TAG, "onCreate()"); + Log.i(TAG, "onCreate()"); dynamicTheme.onCreate(this); dynamicLanguage.onCreate(this); getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); @@ -269,11 +269,11 @@ public class PassphrasePromptActivity extends PassphraseActivity { } if (Build.VERSION.SDK_INT >= 16 && fingerprintManager.isHardwareDetected() && fingerprintManager.hasEnrolledFingerprints()) { - Log.w(TAG, "Listening for fingerprints..."); + Log.i(TAG, "Listening for fingerprints..."); fingerprintCancellationSignal = new CancellationSignal(); fingerprintManager.authenticate(null, 0, fingerprintCancellationSignal, fingerprintListener, null); } else if (Build.VERSION.SDK_INT >= 21){ - Log.w(TAG, "firing intent..."); + Log.i(TAG, "firing intent..."); Intent intent = keyguardManager.createConfirmDeviceCredentialIntent("Unlock Signal", ""); startActivityForResult(intent, 1); } else { @@ -345,7 +345,7 @@ public class PassphrasePromptActivity extends PassphraseActivity { @Override public void onAuthenticationSucceeded(FingerprintManagerCompat.AuthenticationResult result) { - Log.w(TAG, "onAuthenticationSucceeded"); + Log.i(TAG, "onAuthenticationSucceeded"); fingerprintPrompt.setImageResource(R.drawable.ic_check_white_48dp); fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.green_500), PorterDuff.Mode.SRC_IN); fingerprintPrompt.animate().setInterpolator(new BounceInterpolator()).scaleX(1.1f).scaleY(1.1f).setDuration(500).setListener(new AnimationCompleteListener() { diff --git a/src/org/thoughtcrime/securesms/PassphraseRequiredActionBarActivity.java b/src/org/thoughtcrime/securesms/PassphraseRequiredActionBarActivity.java index 559511bc0f..838536f2c2 100644 --- a/src/org/thoughtcrime/securesms/PassphraseRequiredActionBarActivity.java +++ b/src/org/thoughtcrime/securesms/PassphraseRequiredActionBarActivity.java @@ -38,7 +38,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA @Override protected final void onCreate(Bundle savedInstanceState) { - Log.w(TAG, "onCreate(" + savedInstanceState + ")"); + Log.i(TAG, "onCreate(" + savedInstanceState + ")"); this.networkAccess = new SignalServiceNetworkAccess(this); onPreCreate(); @@ -58,7 +58,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA @Override protected void onResume() { - Log.w(TAG, "onResume()"); + Log.i(TAG, "onResume()"); super.onResume(); KeyCachingService.registerPassphraseActivityStarted(this); @@ -70,7 +70,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA @Override protected void onPause() { - Log.w(TAG, "onPause()"); + Log.i(TAG, "onPause()"); super.onPause(); KeyCachingService.registerPassphraseActivityStopped(this); @@ -81,14 +81,14 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA @Override protected void onDestroy() { - Log.w(TAG, "onDestroy()"); + Log.i(TAG, "onDestroy()"); super.onDestroy(); removeClearKeyReceiver(this); } @Override public void onMasterSecretCleared() { - Log.w(TAG, "onMasterSecretCleared()"); + Log.i(TAG, "onMasterSecretCleared()"); if (isVisible) routeApplicationState(true); else finish(); } @@ -134,7 +134,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA } private Intent getIntentForState(int state) { - Log.w(TAG, "routeApplicationState(), state: " + state); + Log.i(TAG, "routeApplicationState(), state: " + state); switch (state) { case STATE_CREATE_PASSPHRASE: return getCreatePassphraseIntent(); @@ -200,11 +200,11 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA } private void initializeClearKeyReceiver() { - Log.w(TAG, "initializeClearKeyReceiver()"); + Log.i(TAG, "initializeClearKeyReceiver()"); this.clearKeyReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - Log.w(TAG, "onReceive() for clear key event"); + Log.i(TAG, "onReceive() for clear key event"); onMasterSecretCleared(); } }; diff --git a/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java b/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java index 30ac7dbdaa..3be75b0e6a 100644 --- a/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java +++ b/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java @@ -247,7 +247,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi @Override public void onCreate(Bundle icicle) { - Log.w(TAG, "onCreate (fragment)"); + Log.i(TAG, "onCreate (fragment)"); super.onCreate(icicle); initializeRecipients(); @@ -279,7 +279,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi @Override public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) { - Log.w(TAG, "onCreatePreferences..."); + Log.i(TAG, "onCreatePreferences..."); addPreferencesFromResource(R.xml.recipient_preferences); } @@ -591,7 +591,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi private final IdentityRecord identityKey; private IdentityClickedListener(IdentityRecord identityKey) { - Log.w(TAG, "Identity record: " + identityKey); + Log.i(TAG, "Identity record: " + identityKey); this.identityKey = identityKey; } diff --git a/src/org/thoughtcrime/securesms/RegistrationActivity.java b/src/org/thoughtcrime/securesms/RegistrationActivity.java index 719d8f85e3..770e6db5bb 100644 --- a/src/org/thoughtcrime/securesms/RegistrationActivity.java +++ b/src/org/thoughtcrime/securesms/RegistrationActivity.java @@ -1006,7 +1006,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif private class ChallengeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Log.w(TAG, "Got a challenge broadcast..."); + Log.i(TAG, "Got a challenge broadcast..."); handleChallengeReceived(intent.getStringExtra(CHALLENGE_EXTRA)); } } diff --git a/src/org/thoughtcrime/securesms/ShareActivity.java b/src/org/thoughtcrime/securesms/ShareActivity.java index e573337c92..86ff6456db 100644 --- a/src/org/thoughtcrime/securesms/ShareActivity.java +++ b/src/org/thoughtcrime/securesms/ShareActivity.java @@ -110,7 +110,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity @Override protected void onNewIntent(Intent intent) { - Log.w(TAG, "onNewIntent()"); + Log.i(TAG, "onNewIntent()"); super.onNewIntent(intent); setIntent(intent); initializeMedia(); @@ -118,7 +118,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity @Override public void onResume() { - Log.w(TAG, "onResume()"); + Log.i(TAG, "onResume()"); super.onResume(); dynamicTheme.onResume(this); dynamicLanguage.onResume(this); diff --git a/src/org/thoughtcrime/securesms/VerifyIdentityActivity.java b/src/org/thoughtcrime/securesms/VerifyIdentityActivity.java index aa3e3d829e..552dd0b122 100644 --- a/src/org/thoughtcrime/securesms/VerifyIdentityActivity.java +++ b/src/org/thoughtcrime/securesms/VerifyIdentityActivity.java @@ -592,7 +592,7 @@ public class VerifyIdentityActivity extends PassphraseRequiredActionBarActivity protected Void doInBackground(Recipient... params) { synchronized (SESSION_LOCK) { if (isChecked) { - Log.w(TAG, "Saving identity: " + params[0].getAddress()); + Log.i(TAG, "Saving identity: " + params[0].getAddress()); DatabaseFactory.getIdentityDatabase(getActivity()) .saveIdentity(params[0].getAddress(), remoteIdentity, diff --git a/src/org/thoughtcrime/securesms/WebRtcCallActivity.java b/src/org/thoughtcrime/securesms/WebRtcCallActivity.java index f52440f507..b3ad8a5a80 100644 --- a/src/org/thoughtcrime/securesms/WebRtcCallActivity.java +++ b/src/org/thoughtcrime/securesms/WebRtcCallActivity.java @@ -70,7 +70,7 @@ public class WebRtcCallActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { - Log.w(TAG, "onCreate()"); + Log.i(TAG, "onCreate()"); getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); super.onCreate(savedInstanceState); @@ -86,7 +86,7 @@ public class WebRtcCallActivity extends Activity { @Override public void onResume() { - Log.w(TAG, "onResume()"); + Log.i(TAG, "onResume()"); super.onResume(); if (!networkAccess.isCensored(this)) MessageRetrievalService.registerActivityStarted(this); initializeScreenshotSecurity(); @@ -95,7 +95,7 @@ public class WebRtcCallActivity extends Activity { @Override public void onNewIntent(Intent intent){ - Log.w(TAG, "onNewIntent"); + Log.i(TAG, "onNewIntent"); if (ANSWER_ACTION.equals(intent.getAction())) { handleAnswerCall(); } else if (DENY_ACTION.equals(intent.getAction())) { @@ -107,7 +107,7 @@ public class WebRtcCallActivity extends Activity { @Override public void onPause() { - Log.w(TAG, "onPause"); + Log.i(TAG, "onPause"); super.onPause(); if (!networkAccess.isCensored(this)) MessageRetrievalService.registerActivityStopped(this); EventBus.getDefault().unregister(this); @@ -202,7 +202,7 @@ public class WebRtcCallActivity extends Activity { } private void handleEndCall() { - Log.w(TAG, "Hangup pressed, handling termination now..."); + Log.i(TAG, "Hangup pressed, handling termination now..."); Intent intent = new Intent(WebRtcCallActivity.this, WebRtcCallService.class); intent.setAction(WebRtcCallService.ACTION_LOCAL_HANGUP); startService(intent); @@ -217,7 +217,7 @@ public class WebRtcCallActivity extends Activity { } private void handleTerminate(@NonNull Recipient recipient /*, int terminationType */) { - Log.w(TAG, "handleTerminate called"); + Log.i(TAG, "handleTerminate called"); callScreen.setActiveCall(recipient, getString(R.string.RedPhone_ending_call)); EventBus.getDefault().removeStickyEvent(WebRtcViewModel.class); @@ -314,7 +314,7 @@ public class WebRtcCallActivity extends Activity { @Subscribe(sticky = true, threadMode = ThreadMode.MAIN) public void onEventMainThread(final WebRtcViewModel event) { - Log.w(TAG, "Got message from service: " + event); + Log.i(TAG, "Got message from service: " + event); switch (event.getState()) { case CALL_CONNECTED: handleCallConnected(event); break; diff --git a/src/org/thoughtcrime/securesms/attachments/AttachmentServer.java b/src/org/thoughtcrime/securesms/attachments/AttachmentServer.java index c4710872f7..e44e7d6ab2 100644 --- a/src/org/thoughtcrime/securesms/attachments/AttachmentServer.java +++ b/src/org/thoughtcrime/securesms/attachments/AttachmentServer.java @@ -276,15 +276,13 @@ public class AttachmentServer implements Runnable { return; StringTokenizer st = new StringTokenizer(inLine); if (!st.hasMoreTokens()) - Log.e(TAG, - "BAD REQUEST: Syntax error. Usage: GET /example/file.html"); + Log.e(TAG, "BAD REQUEST: Syntax error. Usage: GET /example/file.html"); String method = st.nextToken(); pre.put("method", method); if (!st.hasMoreTokens()) - Log.e(TAG, - "BAD REQUEST: Missing URI. Usage: GET /example/file.html"); + Log.e(TAG, "BAD REQUEST: Missing URI. Usage: GET /example/file.html"); String uri = st.nextToken(); @@ -313,8 +311,7 @@ public class AttachmentServer implements Runnable { pre.put("uri", uri); } catch (IOException ioe) { - Log.e(TAG, - "SERVER INTERNAL ERROR: IOException: " + ioe.getMessage()); + Log.e(TAG, "SERVER INTERNAL ERROR: IOException: " + ioe.getMessage()); } } diff --git a/src/org/thoughtcrime/securesms/audio/AudioRecorder.java b/src/org/thoughtcrime/securesms/audio/AudioRecorder.java index cc873ec872..39cb5a3735 100644 --- a/src/org/thoughtcrime/securesms/audio/AudioRecorder.java +++ b/src/org/thoughtcrime/securesms/audio/AudioRecorder.java @@ -38,10 +38,10 @@ public class AudioRecorder { } public void startRecording() { - Log.w(TAG, "startRecording()"); + Log.i(TAG, "startRecording()"); executor.execute(() -> { - Log.w(TAG, "Running startRecording() + " + Thread.currentThread().getId()); + Log.i(TAG, "Running startRecording() + " + Thread.currentThread().getId()); try { if (audioCodec != null) { throw new AssertionError("We can only record once at a time."); @@ -61,7 +61,7 @@ public class AudioRecorder { } public @NonNull ListenableFuture> stopRecording() { - Log.w(TAG, "stopRecording()"); + Log.i(TAG, "stopRecording()"); final SettableFuture> future = new SettableFuture<>(); diff --git a/src/org/thoughtcrime/securesms/audio/AudioSlidePlayer.java b/src/org/thoughtcrime/securesms/audio/AudioSlidePlayer.java index fff1bf4c33..9c4557103a 100644 --- a/src/org/thoughtcrime/securesms/audio/AudioSlidePlayer.java +++ b/src/org/thoughtcrime/securesms/audio/AudioSlidePlayer.java @@ -96,7 +96,7 @@ public class AudioSlidePlayer implements SensorEventListener { mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { - Log.w(TAG, "onPrepared"); + Log.i(TAG, "onPrepared"); synchronized (AudioSlidePlayer.this) { if (mediaPlayer == null) return; @@ -118,7 +118,7 @@ public class AudioSlidePlayer implements SensorEventListener { mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { - Log.w(TAG, "onComplete"); + Log.i(TAG, "onComplete"); synchronized (AudioSlidePlayer.this) { mediaPlayer = null; @@ -171,7 +171,7 @@ public class AudioSlidePlayer implements SensorEventListener { } public synchronized void stop() { - Log.w(TAG, "Stop called!"); + Log.i(TAG, "Stop called!"); removePlaying(this); diff --git a/src/org/thoughtcrime/securesms/components/AudioView.java b/src/org/thoughtcrime/securesms/components/AudioView.java index 55895aa566..dcf60f2aae 100644 --- a/src/org/thoughtcrime/securesms/components/AudioView.java +++ b/src/org/thoughtcrime/securesms/components/AudioView.java @@ -257,7 +257,7 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener @Override public void onClick(View v) { try { - Log.w(TAG, "playbutton onClick"); + Log.d(TAG, "playbutton onClick"); if (audioSlidePlayer != null) { togglePlayToPause(); audioSlidePlayer.play(getProgress()); @@ -272,7 +272,7 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void onClick(View v) { - Log.w(TAG, "pausebutton onClick"); + Log.d(TAG, "pausebutton onClick"); if (audioSlidePlayer != null) { togglePauseToPlay(); audioSlidePlayer.stop(); diff --git a/src/org/thoughtcrime/securesms/components/CustomDefaultPreference.java b/src/org/thoughtcrime/securesms/components/CustomDefaultPreference.java index d7770ebd22..757a58b9d3 100644 --- a/src/org/thoughtcrime/securesms/components/CustomDefaultPreference.java +++ b/src/org/thoughtcrime/securesms/components/CustomDefaultPreference.java @@ -122,7 +122,7 @@ public class CustomDefaultPreference extends DialogPreference { @Override protected void onBindDialogView(@NonNull View view) { - Log.w(TAG, "onBindDialogView"); + Log.i(TAG, "onBindDialogView"); super.onBindDialogView(view); CustomDefaultPreference preference = (CustomDefaultPreference)getPreference(); diff --git a/src/org/thoughtcrime/securesms/components/InputPanel.java b/src/org/thoughtcrime/securesms/components/InputPanel.java index 5452bfe02d..8fc9aea9aa 100644 --- a/src/org/thoughtcrime/securesms/components/InputPanel.java +++ b/src/org/thoughtcrime/securesms/components/InputPanel.java @@ -164,7 +164,7 @@ public class InputPanel extends LinearLayout long elapsedTime = onRecordHideEvent(x); if (listener != null) { - Log.w(TAG, "Elapsed time: " + elapsedTime); + Log.d(TAG, "Elapsed time: " + elapsedTime); if (elapsedTime > 1000) { listener.onRecorderFinished(); } else { diff --git a/src/org/thoughtcrime/securesms/components/KeyboardAwareLinearLayout.java b/src/org/thoughtcrime/securesms/components/KeyboardAwareLinearLayout.java index a326c7fe7d..b6c1af9592 100644 --- a/src/org/thoughtcrime/securesms/components/KeyboardAwareLinearLayout.java +++ b/src/org/thoughtcrime/securesms/components/KeyboardAwareLinearLayout.java @@ -86,7 +86,7 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat { int oldRotation = rotation; rotation = getDeviceRotation(); if (oldRotation != rotation) { - Log.w(TAG, "rotation changed"); + Log.i(TAG, "rotation changed"); onKeyboardClose(); } } @@ -132,14 +132,14 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat { } protected void onKeyboardOpen(int keyboardHeight) { - Log.w(TAG, "onKeyboardOpen(" + keyboardHeight + ")"); + Log.i(TAG, "onKeyboardOpen(" + keyboardHeight + ")"); keyboardOpen = true; notifyShownListeners(); } protected void onKeyboardClose() { - Log.w(TAG, "onKeyboardClose()"); + Log.i(TAG, "onKeyboardClose()"); keyboardOpen = false; notifyHiddenListeners(); } diff --git a/src/org/thoughtcrime/securesms/components/ThumbnailView.java b/src/org/thoughtcrime/securesms/components/ThumbnailView.java index b52b6d5c20..3541823e5d 100644 --- a/src/org/thoughtcrime/securesms/components/ThumbnailView.java +++ b/src/org/thoughtcrime/securesms/components/ThumbnailView.java @@ -249,19 +249,19 @@ public class ThumbnailView extends FrameLayout { } if (Util.equals(slide, this.slide)) { - Log.w(TAG, "Not re-loading slide " + slide.asAttachment().getDataUri()); + Log.i(TAG, "Not re-loading slide " + slide.asAttachment().getDataUri()); return new SettableFuture<>(false); } if (this.slide != null && this.slide.getFastPreflightId() != null && this.slide.getFastPreflightId().equals(slide.getFastPreflightId())) { - Log.w(TAG, "Not re-loading slide for fast preflight: " + slide.getFastPreflightId()); + Log.i(TAG, "Not re-loading slide for fast preflight: " + slide.getFastPreflightId()); this.slide = slide; return new SettableFuture<>(false); } - Log.w(TAG, "loading part with id " + slide.asAttachment().getDataUri() + Log.i(TAG, "loading part with id " + slide.asAttachment().getDataUri() + ", progress " + slide.getTransferState() + ", fast preflight id: " + slide.asAttachment().getFastPreflightId()); diff --git a/src/org/thoughtcrime/securesms/components/ZoomingImageView.java b/src/org/thoughtcrime/securesms/components/ZoomingImageView.java index 0c5b735685..5d7844a5e8 100644 --- a/src/org/thoughtcrime/securesms/components/ZoomingImageView.java +++ b/src/org/thoughtcrime/securesms/components/ZoomingImageView.java @@ -65,7 +65,7 @@ public class ZoomingImageView extends FrameLayout { final Context context = getContext(); final int maxTextureSize = BitmapUtil.getMaxTextureSize(); - Log.w(TAG, "Max texture size: " + maxTextureSize); + Log.i(TAG, "Max texture size: " + maxTextureSize); new AsyncTask>() { @Override @@ -82,13 +82,13 @@ public class ZoomingImageView extends FrameLayout { } protected void onPostExecute(@Nullable Pair dimensions) { - Log.w(TAG, "Dimensions: " + (dimensions == null ? "(null)" : dimensions.first + ", " + dimensions.second)); + Log.i(TAG, "Dimensions: " + (dimensions == null ? "(null)" : dimensions.first + ", " + dimensions.second)); if (dimensions == null || (dimensions.first <= maxTextureSize && dimensions.second <= maxTextureSize)) { - Log.w(TAG, "Loading in standard image view..."); + Log.i(TAG, "Loading in standard image view..."); setImageViewUri(glideRequests, uri); } else { - Log.w(TAG, "Loading in subsampling image view..."); + Log.i(TAG, "Loading in subsampling image view..."); setSubsamplingImageViewUri(uri); } } diff --git a/src/org/thoughtcrime/securesms/components/camera/CameraUtils.java b/src/org/thoughtcrime/securesms/components/camera/CameraUtils.java index 8899c36578..31c24c52a6 100644 --- a/src/org/thoughtcrime/securesms/components/camera/CameraUtils.java +++ b/src/org/thoughtcrime/securesms/components/camera/CameraUtils.java @@ -30,7 +30,7 @@ public class CameraUtils { final int targetHeight = displayOrientation % 180 == 90 ? width : height; final double targetRatio = (double) targetWidth / targetHeight; - Log.w(TAG, String.format("getPreferredPreviewSize(%d, %d, %d) -> target %dx%d, AR %.02f", + Log.d(TAG, String.format("getPreferredPreviewSize(%d, %d, %d) -> target %dx%d, AR %.02f", displayOrientation, width, height, targetWidth, targetHeight, targetRatio)); @@ -39,14 +39,14 @@ public class CameraUtils { List bigEnough = new LinkedList<>(); for (Size size : sizes) { - Log.w(TAG, String.format(" %dx%d (%.02f)", size.width, size.height, (float)size.width / size.height)); + Log.d(TAG, String.format(" %dx%d (%.02f)", size.width, size.height, (float)size.width / size.height)); if (size.height == size.width * targetRatio && size.height >= targetHeight && size.width >= targetWidth) { ideals.add(size); - Log.w(TAG, " (ideal ratio)"); + Log.d(TAG, " (ideal ratio)"); } else if (size.width >= targetWidth && size.height >= targetHeight) { bigEnough.add(size); - Log.w(TAG, " (good size, suboptimal ratio)"); + Log.d(TAG, " (good size, suboptimal ratio)"); } } diff --git a/src/org/thoughtcrime/securesms/components/camera/CameraView.java b/src/org/thoughtcrime/securesms/components/camera/CameraView.java index f1ac17eef6..ee481f1c8f 100644 --- a/src/org/thoughtcrime/securesms/components/camera/CameraView.java +++ b/src/org/thoughtcrime/securesms/components/camera/CameraView.java @@ -97,7 +97,7 @@ public class CameraView extends ViewGroup { public void onResume() { if (state != State.PAUSED) return; state = State.RESUMED; - Log.w(TAG, "onResume() queued"); + Log.i(TAG, "onResume() queued"); enqueueTask(new SerialAsyncTask() { @Override protected @@ -106,7 +106,7 @@ public class CameraView extends ViewGroup { try { long openStartMillis = System.currentTimeMillis(); camera = Optional.fromNullable(Camera.open(cameraId)); - Log.w(TAG, "camera.open() -> " + (System.currentTimeMillis() - openStartMillis) + "ms"); + Log.i(TAG, "camera.open() -> " + (System.currentTimeMillis() - openStartMillis) + "ms"); synchronized (CameraView.this) { CameraView.this.notifyAll(); } @@ -130,7 +130,7 @@ public class CameraView extends ViewGroup { if (getActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { onOrientationChange.enable(); } - Log.w(TAG, "onResume() completed"); + Log.i(TAG, "onResume() completed"); } }); } @@ -138,7 +138,7 @@ public class CameraView extends ViewGroup { public void onPause() { if (state == State.PAUSED) return; state = State.PAUSED; - Log.w(TAG, "onPause() queued"); + Log.i(TAG, "onPause() queued"); enqueueTask(new SerialAsyncTask() { private Optional cameraToDestroy; @@ -170,7 +170,7 @@ public class CameraView extends ViewGroup { outputOrientation = -1; removeView(surface); addView(surface); - Log.w(TAG, "onPause() completed"); + Log.i(TAG, "onPause() completed"); } }); @@ -220,7 +220,7 @@ public class CameraView extends ViewGroup { @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { - Log.w(TAG, "onSizeChanged(" + oldw + "x" + oldh + " -> " + w + "x" + h + ")"); + Log.i(TAG, "onSizeChanged(" + oldw + "x" + oldh + " -> " + w + "x" + h + ")"); super.onSizeChanged(w, h, oldw, oldh); if (camera.isPresent()) startPreview(camera.get().getParameters()); } @@ -310,7 +310,7 @@ public class CameraView extends ViewGroup { final Size preferredPreviewSize = getPreferredPreviewSize(parameters); if (preferredPreviewSize != null && !parameters.getPreviewSize().equals(preferredPreviewSize)) { - Log.w(TAG, "starting preview with size " + preferredPreviewSize.width + "x" + preferredPreviewSize.height); + Log.i(TAG, "starting preview with size " + preferredPreviewSize.width + "x" + preferredPreviewSize.height); if (state == State.ACTIVE) stopPreview(); previewSize = preferredPreviewSize; parameters.setPreviewSize(preferredPreviewSize.width, preferredPreviewSize.height); @@ -320,7 +320,7 @@ public class CameraView extends ViewGroup { } long previewStartMillis = System.currentTimeMillis(); camera.startPreview(); - Log.w(TAG, "camera.startPreview() -> " + (System.currentTimeMillis() - previewStartMillis) + "ms"); + Log.i(TAG, "camera.startPreview() -> " + (System.currentTimeMillis() - previewStartMillis) + "ms"); state = State.ACTIVE; Util.runOnMain(new Runnable() { @Override @@ -445,11 +445,11 @@ public class CameraView extends ViewGroup { final Size previewSize = camera.getParameters().getPreviewSize(); final Rect croppingRect = getCroppedRect(previewSize, previewRect, rotation); - Log.w(TAG, "previewSize: " + previewSize.width + "x" + previewSize.height); - Log.w(TAG, "data bytes: " + data.length); - Log.w(TAG, "previewFormat: " + camera.getParameters().getPreviewFormat()); - Log.w(TAG, "croppingRect: " + croppingRect.toString()); - Log.w(TAG, "rotation: " + rotation); + Log.i(TAG, "previewSize: " + previewSize.width + "x" + previewSize.height); + Log.i(TAG, "data bytes: " + data.length); + Log.i(TAG, "previewFormat: " + camera.getParameters().getPreviewFormat()); + Log.i(TAG, "croppingRect: " + croppingRect.toString()); + Log.i(TAG, "rotation: " + rotation); new CaptureTask(previewSize, rotation, croppingRect).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, data); } }); @@ -536,7 +536,7 @@ public class CameraView extends ViewGroup { throw new PreconditionsNotMetException(); } while (getMeasuredHeight() <= 0 || getMeasuredWidth() <= 0 || !surface.isReady()) { - Log.w(TAG, String.format("waiting. surface ready? %s", surface.isReady())); + Log.i(TAG, String.format("waiting. surface ready? %s", surface.isReady())); Util.wait(CameraView.this, 0); } } diff --git a/src/org/thoughtcrime/securesms/components/camera/QuickAttachmentDrawer.java b/src/org/thoughtcrime/securesms/components/camera/QuickAttachmentDrawer.java index 398d9e7ab0..cbdb428dc2 100644 --- a/src/org/thoughtcrime/securesms/components/camera/QuickAttachmentDrawer.java +++ b/src/org/thoughtcrime/securesms/components/camera/QuickAttachmentDrawer.java @@ -117,7 +117,7 @@ public class QuickAttachmentDrawer extends ViewGroup implements InputView, Camer } private void updateControlsView() { - Log.w(TAG, "updateControlsView()"); + Log.i(TAG, "updateControlsView()"); View controls = LayoutInflater.from(getContext()).inflate(isLandscape() ? R.layout.quick_camera_controls_land : R.layout.quick_camera_controls, this, false); diff --git a/src/org/thoughtcrime/securesms/components/emoji/EmojiDrawer.java b/src/org/thoughtcrime/securesms/components/emoji/EmojiDrawer.java index 80cb3b1c4f..ef4db457f8 100644 --- a/src/org/thoughtcrime/securesms/components/emoji/EmojiDrawer.java +++ b/src/org/thoughtcrime/securesms/components/emoji/EmojiDrawer.java @@ -28,6 +28,9 @@ import java.util.LinkedList; import java.util.List; public class EmojiDrawer extends LinearLayout implements InputView { + + private static final String TAG = EmojiDrawer.class.getSimpleName(); + private static final KeyEvent DELETE_KEY_EVENT = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL); private ViewPager pager; @@ -62,7 +65,7 @@ public class EmojiDrawer extends LinearLayout implements InputView { } private void initializeResources(View v) { - Log.w("EmojiDrawer", "initializeResources()"); + Log.i(TAG, "initializeResources()"); this.pager = (ViewPager) v.findViewById(R.id.emoji_pager); this.strip = (PagerSlidingTabStrip) v.findViewById(R.id.tabs); @@ -85,7 +88,7 @@ public class EmojiDrawer extends LinearLayout implements InputView { if (this.pager == null) initView(); ViewGroup.LayoutParams params = getLayoutParams(); params.height = height; - Log.w("EmojiDrawer", "showing emoji drawer with height " + params.height); + Log.i(TAG, "showing emoji drawer with height " + params.height); setLayoutParams(params); setVisibility(VISIBLE); if (drawerListener != null) drawerListener.onShown(); @@ -95,7 +98,7 @@ public class EmojiDrawer extends LinearLayout implements InputView { public void hide(boolean immediate) { setVisibility(GONE); if (drawerListener != null) drawerListener.onHidden(); - Log.w("EmojiDrawer", "hide()"); + Log.i(TAG, "hide()"); } private void initializeEmojiGrid() { @@ -104,7 +107,7 @@ public class EmojiDrawer extends LinearLayout implements InputView { new EmojiSelectionListener() { @Override public void onEmojiSelected(String emoji) { - Log.w("EmojiDrawer", "onEmojiSelected()"); + Log.i(TAG, "onEmojiSelected()"); recentModel.onCodePointSelected(emoji); if (listener != null) listener.onEmojiSelected(emoji); } diff --git a/src/org/thoughtcrime/securesms/components/emoji/RecentEmojiPageModel.java b/src/org/thoughtcrime/securesms/components/emoji/RecentEmojiPageModel.java index ea9cccdda0..2e186b19b4 100644 --- a/src/org/thoughtcrime/securesms/components/emoji/RecentEmojiPageModel.java +++ b/src/org/thoughtcrime/securesms/components/emoji/RecentEmojiPageModel.java @@ -63,7 +63,7 @@ public class RecentEmojiPageModel implements EmojiPageModel { } public void onCodePointSelected(String emoji) { - Log.w(TAG, "onCodePointSelected(" + emoji + ")"); + Log.i(TAG, "onCodePointSelected(" + emoji + ")"); recentlyUsed.remove(emoji); recentlyUsed.add(emoji); diff --git a/src/org/thoughtcrime/securesms/components/emoji/parsing/EmojiPageBitmap.java b/src/org/thoughtcrime/securesms/components/emoji/parsing/EmojiPageBitmap.java index 2f96a2d21d..a842b6c36a 100644 --- a/src/org/thoughtcrime/securesms/components/emoji/parsing/EmojiPageBitmap.java +++ b/src/org/thoughtcrime/securesms/components/emoji/parsing/EmojiPageBitmap.java @@ -45,7 +45,7 @@ public class EmojiPageBitmap { } else { Callable callable = () -> { try { - Log.w(TAG, "loading page " + model.getSprite()); + Log.i(TAG, "loading page " + model.getSprite()); return loadPage(); } catch (IOException ioe) { Log.w(TAG, ioe); @@ -82,7 +82,7 @@ public class EmojiPageBitmap { Bitmap scaledBitmap = Bitmap.createScaledBitmap(originalBitmap, (int)(originalBitmap.getWidth() * decodeScale), (int)(originalBitmap.getHeight() * decodeScale), false); bitmapReference = new SoftReference<>(scaledBitmap); - Log.w(TAG, "onPageLoaded(" + model.getSprite() + ")"); + Log.i(TAG, "onPageLoaded(" + model.getSprite() + ")"); return scaledBitmap; } catch (InterruptedException e) { Log.w(TAG, e); diff --git a/src/org/thoughtcrime/securesms/components/identity/UnverifiedBannerView.java b/src/org/thoughtcrime/securesms/components/identity/UnverifiedBannerView.java index 1e5cf2eb92..6b03ca4c9d 100644 --- a/src/org/thoughtcrime/securesms/components/identity/UnverifiedBannerView.java +++ b/src/org/thoughtcrime/securesms/components/identity/UnverifiedBannerView.java @@ -68,7 +68,7 @@ public class UnverifiedBannerView extends LinearLayout { this.container.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - Log.w(TAG, "onClick()"); + Log.i(TAG, "onClick()"); clickListener.onClicked(unverifiedIdentities); } }); diff --git a/src/org/thoughtcrime/securesms/components/subsampling/AttachmentRegionDecoder.java b/src/org/thoughtcrime/securesms/components/subsampling/AttachmentRegionDecoder.java index 9faafc2e65..3d2a727f20 100644 --- a/src/org/thoughtcrime/securesms/components/subsampling/AttachmentRegionDecoder.java +++ b/src/org/thoughtcrime/securesms/components/subsampling/AttachmentRegionDecoder.java @@ -27,7 +27,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder { @Override public Point init(Context context, Uri uri) throws Exception { - Log.w(TAG, "Init!"); + Log.d(TAG, "Init!"); if (!PartAuthority.isLocalUri(uri)) { passthrough = new SkiaImageRegionDecoder(); return passthrough.init(context, uri); @@ -43,7 +43,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder { @Override public Bitmap decodeRegion(Rect rect, int sampleSize) { - Log.w(TAG, "Decode region: " + rect); + Log.d(TAG, "Decode region: " + rect); if (passthrough != null) { return passthrough.decodeRegion(rect, sampleSize); @@ -65,7 +65,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder { } public boolean isReady() { - Log.w(TAG, "isReady"); + Log.d(TAG, "isReady"); return (passthrough != null && passthrough.isReady()) || (bitmapRegionDecoder != null && !bitmapRegionDecoder.isRecycled()); } diff --git a/src/org/thoughtcrime/securesms/contacts/ContactsCursorLoader.java b/src/org/thoughtcrime/securesms/contacts/ContactsCursorLoader.java index 48011e927c..4045faf679 100644 --- a/src/org/thoughtcrime/securesms/contacts/ContactsCursorLoader.java +++ b/src/org/thoughtcrime/securesms/contacts/ContactsCursorLoader.java @@ -240,7 +240,7 @@ public class ContactsCursorLoader extends CursorLoader { ContactsDatabase.NORMAL_TYPE}); } } - Log.w(TAG, "filterNonPushContacts() -> " + (System.currentTimeMillis() - startMillis) + "ms"); + Log.i(TAG, "filterNonPushContacts() -> " + (System.currentTimeMillis() - startMillis) + "ms"); return matrix; } finally { cursor.close(); diff --git a/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java b/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java index 207982a5d5..f4f137bc78 100644 --- a/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java +++ b/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java @@ -89,7 +89,7 @@ public class ContactsDatabase { try (Cursor cursor = context.getContentResolver().query(currentContactsUri, projection, RawContacts.DELETED + " = ?", new String[] {"1"}, null)) { while (cursor != null && cursor.moveToNext()) { long rawContactId = cursor.getLong(0); - Log.w(TAG, "Deleting raw contact: " + cursor.getString(1) + ", " + rawContactId); + Log.i(TAG, "Deleting raw contact: " + cursor.getString(1) + ", " + rawContactId); context.getContentResolver().delete(currentContactsUri, RawContacts._ID + " = ?", new String[] {String.valueOf(rawContactId)}); } @@ -112,7 +112,7 @@ public class ContactsDatabase { Optional systemContactInfo = getSystemContactInfo(registeredAddress); if (systemContactInfo.isPresent()) { - Log.w(TAG, "Adding number: " + registeredAddress); + Log.i(TAG, "Adding number: " + registeredAddress); addTextSecureRawContact(operations, account, systemContactInfo.get().number, systemContactInfo.get().name, systemContactInfo.get().id); } @@ -122,16 +122,16 @@ public class ContactsDatabase { for (Map.Entry currentContactEntry : currentContacts.entrySet()) { if (!registeredAddressSet.contains(currentContactEntry.getKey())) { if (remove) { - Log.w(TAG, "Removing number: " + currentContactEntry.getKey()); + Log.i(TAG, "Removing number: " + currentContactEntry.getKey()); removeTextSecureRawContact(operations, account, currentContactEntry.getValue().getId()); } } else if (!currentContactEntry.getValue().isVoiceSupported()) { - Log.w(TAG, "Adding voice support: " + currentContactEntry.getKey()); + Log.i(TAG, "Adding voice support: " + currentContactEntry.getKey()); addContactVoiceSupport(operations, currentContactEntry.getKey(), currentContactEntry.getValue().getId()); } else if (!Util.isStringEquals(currentContactEntry.getValue().getRawDisplayName(), currentContactEntry.getValue().getAggregateDisplayName())) { - Log.w(TAG, "Updating display name: " + currentContactEntry.getKey()); + Log.i(TAG, "Updating display name: " + currentContactEntry.getKey()); updateDisplayName(operations, currentContactEntry.getValue().getAggregateDisplayName(), currentContactEntry.getValue().getId(), currentContactEntry.getValue().getDisplayNameSource()); } } diff --git a/src/org/thoughtcrime/securesms/contacts/ContactsSyncAdapter.java b/src/org/thoughtcrime/securesms/contacts/ContactsSyncAdapter.java index 9c60a8a6e9..71d3b790d1 100644 --- a/src/org/thoughtcrime/securesms/contacts/ContactsSyncAdapter.java +++ b/src/org/thoughtcrime/securesms/contacts/ContactsSyncAdapter.java @@ -25,7 +25,7 @@ public class ContactsSyncAdapter extends AbstractThreadedSyncAdapter { public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { - Log.w(TAG, "onPerformSync(" + authority +")"); + Log.i(TAG, "onPerformSync(" + authority +")"); if (TextSecurePreferences.isPushRegistered(getContext())) { try { diff --git a/src/org/thoughtcrime/securesms/crypto/MasterCipher.java b/src/org/thoughtcrime/securesms/crypto/MasterCipher.java index 3198ed7c40..c3549c1c7c 100644 --- a/src/org/thoughtcrime/securesms/crypto/MasterCipher.java +++ b/src/org/thoughtcrime/securesms/crypto/MasterCipher.java @@ -55,6 +55,8 @@ import javax.crypto.spec.SecretKeySpec; public class MasterCipher { + private static final String TAG = MasterCipher.class.getSimpleName(); + private final MasterSecret masterSecret; private final Cipher encryptingCipher; private final Cipher decryptingCipher; @@ -125,13 +127,13 @@ public class MasterCipher { public boolean verifyMacFor(String content, byte[] theirMac) { byte[] ourMac = getMacFor(content); - Log.w("MasterCipher", "Our Mac: " + Hex.toString(ourMac)); - Log.w("MasterCipher", "Thr Mac: " + Hex.toString(theirMac)); + Log.i(TAG, "Our Mac: " + Hex.toString(ourMac)); + Log.i(TAG, "Thr Mac: " + Hex.toString(theirMac)); return Arrays.equals(ourMac, theirMac); } public byte[] getMacFor(String content) { - Log.w("MasterCipher", "Macing: " + content); + Log.w(TAG, "Macing: " + content); try { Mac mac = getMac(masterSecret.getMacKey()); return mac.doFinal(content.getBytes()); diff --git a/src/org/thoughtcrime/securesms/crypto/PRNGFixes.java b/src/org/thoughtcrime/securesms/crypto/PRNGFixes.java index 280e99631a..9bcb7084e4 100644 --- a/src/org/thoughtcrime/securesms/crypto/PRNGFixes.java +++ b/src/org/thoughtcrime/securesms/crypto/PRNGFixes.java @@ -47,6 +47,8 @@ import java.security.Security; */ public final class PRNGFixes { + private static final String TAG = PRNGFixes.class.getSimpleName(); + private static final int VERSION_CODE_JELLY_BEAN = 16; private static final int VERSION_CODE_JELLY_BEAN_MR2 = 18; private static final byte[] BUILD_FINGERPRINT_AND_DEVICE_SERIAL = @@ -226,8 +228,7 @@ public final class PRNGFixes { } catch (IOException e) { // On a small fraction of devices /dev/urandom is not writable. // Log and ignore. - Log.w(PRNGFixes.class.getSimpleName(), - "Failed to mix seed into " + URANDOM_FILE); + Log.w(TAG, "Failed to mix seed into " + URANDOM_FILE); } finally { mSeeded = true; } diff --git a/src/org/thoughtcrime/securesms/crypto/PublicKey.java b/src/org/thoughtcrime/securesms/crypto/PublicKey.java index 83138f2e30..c0a5c2679e 100644 --- a/src/org/thoughtcrime/securesms/crypto/PublicKey.java +++ b/src/org/thoughtcrime/securesms/crypto/PublicKey.java @@ -30,6 +30,8 @@ import java.security.NoSuchAlgorithmException; public class PublicKey { + private static final String TAG = PublicKey.class.getSimpleName(); + public static final int KEY_SIZE = 3 + ECPublicKey.KEY_SIZE; private final ECPublicKey publicKey; @@ -48,7 +50,7 @@ public class PublicKey { } public PublicKey(byte[] bytes, int offset) throws InvalidKeyException { - Log.w("PublicKey", "PublicKey Length: " + (bytes.length - offset)); + Log.i(TAG, "PublicKey Length: " + (bytes.length - offset)); if ((bytes.length - offset) < KEY_SIZE) throw new InvalidKeyException("Provided bytes are too short."); @@ -95,7 +97,7 @@ public class PublicKey { byte[] keyIdBytes = Conversions.mediumToByteArray(id); byte[] serializedPoint = publicKey.serialize(); - Log.w("PublicKey", "Serializing public key point: " + Hex.toString(serializedPoint)); + Log.i(TAG, "Serializing public key point: " + Hex.toString(serializedPoint)); return Util.combine(keyIdBytes, serializedPoint); } diff --git a/src/org/thoughtcrime/securesms/crypto/storage/TextSecureIdentityKeyStore.java b/src/org/thoughtcrime/securesms/crypto/storage/TextSecureIdentityKeyStore.java index fedfbc0c19..679ab27efb 100644 --- a/src/org/thoughtcrime/securesms/crypto/storage/TextSecureIdentityKeyStore.java +++ b/src/org/thoughtcrime/securesms/crypto/storage/TextSecureIdentityKeyStore.java @@ -51,13 +51,13 @@ public class TextSecureIdentityKeyStore implements IdentityKeyStore { Optional identityRecord = identityDatabase.getIdentity(signalAddress); if (!identityRecord.isPresent()) { - Log.w(TAG, "Saving new identity..."); + Log.i(TAG, "Saving new identity..."); identityDatabase.saveIdentity(signalAddress, identityKey, VerifiedStatus.DEFAULT, true, System.currentTimeMillis(), nonBlockingApproval); return false; } if (!identityRecord.get().getIdentityKey().equals(identityKey)) { - Log.w(TAG, "Replacing existing identity..."); + Log.i(TAG, "Replacing existing identity..."); VerifiedStatus verifiedStatus; if (identityRecord.get().getVerifiedStatus() == VerifiedStatus.VERIFIED || @@ -75,7 +75,7 @@ public class TextSecureIdentityKeyStore implements IdentityKeyStore { } if (isNonBlockingApprovalRequired(identityRecord.get())) { - Log.w(TAG, "Setting approval status..."); + Log.i(TAG, "Setting approval status..."); identityDatabase.setApproval(signalAddress, nonBlockingApproval); return false; } diff --git a/src/org/thoughtcrime/securesms/database/ApnDatabase.java b/src/org/thoughtcrime/securesms/database/ApnDatabase.java index 353b199fad..3cf7f5721a 100644 --- a/src/org/thoughtcrime/securesms/database/ApnDatabase.java +++ b/src/org/thoughtcrime/securesms/database/ApnDatabase.java @@ -123,7 +123,7 @@ public class ApnDatabase { try { if (apn != null) { - Log.w(TAG, "Querying table for MCC+MNC " + mccmnc + " and APN name " + apn); + Log.d(TAG, "Querying table for MCC+MNC " + mccmnc + " and APN name " + apn); cursor = db.query(TABLE_NAME, null, BASE_SELECTION + " AND " + APN_COLUMN + " = ?", new String[] {mccmnc, apn}, @@ -132,7 +132,7 @@ public class ApnDatabase { if (cursor == null || !cursor.moveToFirst()) { if (cursor != null) cursor.close(); - Log.w(TAG, "Querying table for MCC+MNC " + mccmnc + " without APN name"); + Log.d(TAG, "Querying table for MCC+MNC " + mccmnc + " without APN name"); cursor = db.query(TABLE_NAME, null, BASE_SELECTION, new String[] {mccmnc}, @@ -145,7 +145,7 @@ public class ApnDatabase { cursor.getString(cursor.getColumnIndexOrThrow(MMS_PORT_COLUMN)), cursor.getString(cursor.getColumnIndexOrThrow(USER_COLUMN)), cursor.getString(cursor.getColumnIndexOrThrow(PASSWORD_COLUMN))); - Log.w(TAG, "Returning preferred APN " + params); + Log.d(TAG, "Returning preferred APN " + params); return params; } diff --git a/src/org/thoughtcrime/securesms/database/AttachmentDatabase.java b/src/org/thoughtcrime/securesms/database/AttachmentDatabase.java index 3adad6eabd..16634cebcd 100644 --- a/src/org/thoughtcrime/securesms/database/AttachmentDatabase.java +++ b/src/org/thoughtcrime/securesms/database/AttachmentDatabase.java @@ -151,7 +151,7 @@ public class AttachmentDatabase extends Database { public @NonNull InputStream getThumbnailStream(@NonNull AttachmentId attachmentId) throws IOException { - Log.w(TAG, "getThumbnailStream(" + attachmentId + ")"); + Log.d(TAG, "getThumbnailStream(" + attachmentId + ")"); InputStream dataStream = getDataStream(attachmentId, THUMBNAIL, 0); if (dataStream != null) { @@ -351,20 +351,20 @@ public class AttachmentDatabase extends Database { @NonNull Map insertAttachmentsForMessage(long mmsId, @NonNull List attachments, @NonNull List quoteAttachment) throws MmsException { - Log.w(TAG, "insertParts(" + attachments.size() + ")"); + Log.d(TAG, "insertParts(" + attachments.size() + ")"); Map insertedAttachments = new HashMap<>(); for (Attachment attachment : attachments) { AttachmentId attachmentId = insertAttachment(mmsId, attachment, attachment.isQuote()); insertedAttachments.put(attachment, attachmentId); - Log.w(TAG, "Inserted attachment at ID: " + attachmentId); + Log.i(TAG, "Inserted attachment at ID: " + attachmentId); } for (Attachment attachment : quoteAttachment) { AttachmentId attachmentId = insertAttachment(mmsId, attachment, true); insertedAttachments.put(attachment, attachmentId); - Log.w(TAG, "Inserted quoted attachment at ID: " + attachmentId); + Log.i(TAG, "Inserted quoted attachment at ID: " + attachmentId); } return insertedAttachments; @@ -616,7 +616,7 @@ public class AttachmentDatabase extends Database { private AttachmentId insertAttachment(long mmsId, Attachment attachment, boolean quote) throws MmsException { - Log.w(TAG, "Inserting attachment for mms id: " + mmsId); + Log.d(TAG, "Inserting attachment for mms id: " + mmsId); SQLiteDatabase database = databaseHelper.getWritableDatabase(); DataInfo dataInfo = null; @@ -624,7 +624,7 @@ public class AttachmentDatabase extends Database { if (attachment.getDataUri() != null) { dataInfo = setAttachmentData(attachment.getDataUri()); - Log.w(TAG, "Wrote part to file: " + dataInfo.file.getAbsolutePath()); + Log.d(TAG, "Wrote part to file: " + dataInfo.file.getAbsolutePath()); } ContentValues contentValues = new ContentValues(); @@ -679,7 +679,7 @@ public class AttachmentDatabase extends Database { thumbnailExecutor.submit(new ThumbnailFetchCallable(attachmentId)); } } else { - Log.w(TAG, "Submitting thumbnail generation job..."); + Log.i(TAG, "Submitting thumbnail generation job..."); thumbnailExecutor.submit(new ThumbnailFetchCallable(attachmentId)); } } @@ -692,7 +692,7 @@ public class AttachmentDatabase extends Database { protected void updateAttachmentThumbnail(AttachmentId attachmentId, InputStream in, float aspectRatio) throws MmsException { - Log.w(TAG, "updating part thumbnail for #" + attachmentId); + Log.i(TAG, "updating part thumbnail for #" + attachmentId); DataInfo thumbnailFile = setAttachmentData(in); @@ -728,7 +728,7 @@ public class AttachmentDatabase extends Database { @Override public @Nullable InputStream call() throws Exception { - Log.w(TAG, "Executing thumbnail job..."); + Log.d(TAG, "Executing thumbnail job..."); final InputStream stream = getDataStream(attachmentId, THUMBNAIL, 0); if (stream != null) { @@ -776,7 +776,7 @@ public class AttachmentDatabase extends Database { Bitmap bitmap = retriever.getFrameAtTime(1000); - Log.w(TAG, "Generated video thumbnail..."); + Log.i(TAG, "Generated video thumbnail..."); return new ThumbnailData(bitmap); } } diff --git a/src/org/thoughtcrime/securesms/database/EarlyReceiptCache.java b/src/org/thoughtcrime/securesms/database/EarlyReceiptCache.java index 811d55ac03..d29eee9ec4 100644 --- a/src/org/thoughtcrime/securesms/database/EarlyReceiptCache.java +++ b/src/org/thoughtcrime/securesms/database/EarlyReceiptCache.java @@ -13,8 +13,8 @@ public class EarlyReceiptCache { private final LRUCache> cache = new LRUCache<>(100); public synchronized void increment(long timestamp, Address origin) { - Log.w(TAG, this+""); - Log.w(TAG, String.format("Early receipt: (%d, %s)", timestamp, origin.serialize())); + Log.i(TAG, this+""); + Log.i(TAG, String.format("Early receipt: (%d, %s)", timestamp, origin.serialize())); Map receipts = cache.get(timestamp); @@ -36,8 +36,8 @@ public class EarlyReceiptCache { public synchronized Map remove(long timestamp) { Map receipts = cache.remove(timestamp); - Log.w(TAG, this+""); - Log.w(TAG, String.format("Checking early receipts (%d): %d", timestamp, receipts == null ? 0 : receipts.size())); + Log.i(TAG, this+""); + Log.i(TAG, String.format("Checking early receipts (%d): %d", timestamp, receipts == null ? 0 : receipts.size())); return receipts != null ? receipts : new HashMap<>(); } diff --git a/src/org/thoughtcrime/securesms/database/MmsDatabase.java b/src/org/thoughtcrime/securesms/database/MmsDatabase.java index 7c8dcc0912..9b6357927a 100644 --- a/src/org/thoughtcrime/securesms/database/MmsDatabase.java +++ b/src/org/thoughtcrime/securesms/database/MmsDatabase.java @@ -800,7 +800,7 @@ public class MmsDatabase extends MessagingDatabase { ContentValues contentValues = new ContentValues(); ContentValuesBuilder contentBuilder = new ContentValuesBuilder(contentValues); - Log.w(TAG, "Message received type: " + notification.getMessageType()); + Log.i(TAG, "Message received type: " + notification.getMessageType()); contentBuilder.add(CONTENT_LOCATION, notification.getContentLocation()); @@ -1056,11 +1056,11 @@ public class MmsDatabase extends MessagingDatabase { where += (" ELSE " + DATE_RECEIVED + " < " + date + " END)"); - Log.w("MmsDatabase", "Executing trim query: " + where); + Log.i("MmsDatabase", "Executing trim query: " + where); cursor = db.query(TABLE_NAME, new String[] {ID}, where, new String[] {threadId+""}, null, null, null); while (cursor != null && cursor.moveToNext()) { - Log.w("MmsDatabase", "Trimming: " + cursor.getLong(0)); + Log.i("MmsDatabase", "Trimming: " + cursor.getLong(0)); delete(cursor.getLong(0)); } diff --git a/src/org/thoughtcrime/securesms/database/MmsSmsDatabase.java b/src/org/thoughtcrime/securesms/database/MmsSmsDatabase.java index 1af0802915..be6cda38b3 100644 --- a/src/org/thoughtcrime/securesms/database/MmsSmsDatabase.java +++ b/src/org/thoughtcrime/securesms/database/MmsSmsDatabase.java @@ -362,7 +362,7 @@ public class MmsSmsDatabase extends Database { @SuppressWarnings("deprecation") String query = outerQueryBuilder.buildQuery(projection, null, null, null, null, null, null); - Log.w("MmsSmsDatabase", "Executing query: " + query); + Log.d(TAG, "Executing query: " + query); SQLiteDatabase db = databaseHelper.getReadableDatabase(); return db.rawQuery(query, null); } diff --git a/src/org/thoughtcrime/securesms/database/SmsDatabase.java b/src/org/thoughtcrime/securesms/database/SmsDatabase.java index 0fac077110..acac8c500c 100644 --- a/src/org/thoughtcrime/securesms/database/SmsDatabase.java +++ b/src/org/thoughtcrime/securesms/database/SmsDatabase.java @@ -117,7 +117,7 @@ public class SmsDatabase extends MessagingDatabase { } private void updateTypeBitmask(long id, long maskOff, long maskOn) { - Log.w("MessageDatabase", "Updating ID: " + id + " to base type: " + maskOn); + Log.i("MessageDatabase", "Updating ID: " + id + " to base type: " + maskOn); SQLiteDatabase db = databaseHelper.getWritableDatabase(); db.execSQL("UPDATE " + TABLE_NAME + @@ -263,7 +263,7 @@ public class SmsDatabase extends MessagingDatabase { } public void markStatus(long id, int status) { - Log.w("MessageDatabase", "Updating ID: " + id + " to status: " + status); + Log.i("MessageDatabase", "Updating ID: " + id + " to status: " + status); ContentValues contentValues = new ContentValues(); contentValues.put(STATUS, status); @@ -690,7 +690,7 @@ public class SmsDatabase extends MessagingDatabase { } public boolean deleteMessage(long messageId) { - Log.w("MessageDatabase", "Deleting: " + messageId); + Log.i("MessageDatabase", "Deleting: " + messageId); SQLiteDatabase db = databaseHelper.getWritableDatabase(); long threadId = getThreadIdForMessage(messageId); db.delete(TABLE_NAME, ID_WHERE, new String[] {messageId+""}); diff --git a/src/org/thoughtcrime/securesms/database/ThreadDatabase.java b/src/org/thoughtcrime/securesms/database/ThreadDatabase.java index 981a58b46e..500f6c04f7 100644 --- a/src/org/thoughtcrime/securesms/database/ThreadDatabase.java +++ b/src/org/thoughtcrime/securesms/database/ThreadDatabase.java @@ -220,7 +220,7 @@ public class ThreadDatabase extends Database { } public void trimThread(long threadId, int length) { - Log.w("ThreadDatabase", "Trimming thread: " + threadId + " to: " + length); + Log.i("ThreadDatabase", "Trimming thread: " + threadId + " to: " + length); Cursor cursor = null; try { @@ -232,7 +232,7 @@ public class ThreadDatabase extends Database { long lastTweetDate = cursor.getLong(cursor.getColumnIndexOrThrow(MmsSmsColumns.NORMALIZED_DATE_RECEIVED)); - Log.w("ThreadDatabase", "Cut off tweet date: " + lastTweetDate); + Log.i("ThreadDatabase", "Cut off tweet date: " + lastTweetDate); DatabaseFactory.getSmsDatabase(context).deleteMessagesInThreadBeforeDate(threadId, lastTweetDate); DatabaseFactory.getMmsDatabase(context).deleteMessagesInThreadBeforeDate(threadId, lastTweetDate); diff --git a/src/org/thoughtcrime/securesms/database/helpers/ClassicOpenHelper.java b/src/org/thoughtcrime/securesms/database/helpers/ClassicOpenHelper.java index f389b5d7a0..821befc565 100644 --- a/src/org/thoughtcrime/securesms/database/helpers/ClassicOpenHelper.java +++ b/src/org/thoughtcrime/securesms/database/helpers/ClassicOpenHelper.java @@ -180,10 +180,10 @@ public class ClassicOpenHelper extends SQLiteOpenHelper { Cursor smsCursor = null; - Log.w("DatabaseFactory", "Upgrade count: " + (smsCount + threadCount)); + Log.i("DatabaseFactory", "Upgrade count: " + (smsCount + threadCount)); do { - Log.w("DatabaseFactory", "Looping SMS cursor..."); + Log.i("DatabaseFactory", "Looping SMS cursor..."); if (smsCursor != null) smsCursor.close(); @@ -235,7 +235,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper { skip = 0; do { - Log.w("DatabaseFactory", "Looping thread cursor..."); + Log.i("DatabaseFactory", "Looping thread cursor..."); if (threadCursor != null) threadCursor.close(); @@ -294,13 +294,13 @@ public class ClassicOpenHelper extends SQLiteOpenHelper { } if (fromVersion < DatabaseUpgradeActivity.MMS_BODY_VERSION) { - Log.w("DatabaseFactory", "Update MMS bodies..."); + Log.i("DatabaseFactory", "Update MMS bodies..."); MasterCipher masterCipher = new MasterCipher(masterSecret); Cursor mmsCursor = db.query("mms", new String[] {"_id"}, "msg_box & " + 0x80000000L + " != 0", null, null, null, null); - Log.w("DatabaseFactory", "Got MMS rows: " + (mmsCursor == null ? "null" : mmsCursor.getCount())); + Log.i("DatabaseFactory", "Got MMS rows: " + (mmsCursor == null ? "null" : mmsCursor.getCount())); while (mmsCursor != null && mmsCursor.moveToNext()) { listener.setProgress(mmsCursor.getPosition(), mmsCursor.getCount()); @@ -353,7 +353,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper { new String[] {partCount+"", mmsId+""}); } - Log.w("DatabaseFactory", "Updated body: " + body + " and part_count: " + partCount); + Log.i("DatabaseFactory", "Updated body: " + body + " and part_count: " + partCount); } } diff --git a/src/org/thoughtcrime/securesms/database/helpers/PreKeyMigrationHelper.java b/src/org/thoughtcrime/securesms/database/helpers/PreKeyMigrationHelper.java index 748e230f1a..c392bc8345 100644 --- a/src/org/thoughtcrime/securesms/database/helpers/PreKeyMigrationHelper.java +++ b/src/org/thoughtcrime/securesms/database/helpers/PreKeyMigrationHelper.java @@ -50,7 +50,7 @@ class PreKeyMigrationHelper { contentValues.put(OneTimePreKeyDatabase.PUBLIC_KEY, Base64.encodeBytes(preKey.getKeyPair().getPublicKey().serialize())); contentValues.put(OneTimePreKeyDatabase.PRIVATE_KEY, Base64.encodeBytes(preKey.getKeyPair().getPrivateKey().serialize())); database.insert(OneTimePreKeyDatabase.TABLE_NAME, null, contentValues); - Log.w(TAG, "Migrated one-time prekey: " + preKey.getId()); + Log.i(TAG, "Migrated one-time prekey: " + preKey.getId()); } catch (IOException | InvalidMessageException e) { Log.w(TAG, e); clean = false; @@ -74,7 +74,7 @@ class PreKeyMigrationHelper { contentValues.put(SignedPreKeyDatabase.SIGNATURE, Base64.encodeBytes(signedPreKey.getSignature())); contentValues.put(SignedPreKeyDatabase.TIMESTAMP, signedPreKey.getTimestamp()); database.insert(SignedPreKeyDatabase.TABLE_NAME, null, contentValues); - Log.w(TAG, "Migrated signed prekey: " + signedPreKey.getId()); + Log.i(TAG, "Migrated signed prekey: " + signedPreKey.getId()); } catch (IOException | InvalidMessageException e) { Log.w(TAG, e); clean = false; @@ -92,7 +92,7 @@ class PreKeyMigrationHelper { PreKeyIndex index = JsonUtils.fromJson(reader, PreKeyIndex.class); reader.close(); - Log.w(TAG, "Setting next prekey id: " + index.nextPreKeyId); + Log.i(TAG, "Setting next prekey id: " + index.nextPreKeyId); TextSecurePreferences.setNextPreKeyId(context, index.nextPreKeyId); } catch (IOException e) { Log.w(TAG, e); @@ -105,8 +105,8 @@ class PreKeyMigrationHelper { SignedPreKeyIndex index = JsonUtils.fromJson(reader, SignedPreKeyIndex.class); reader.close(); - Log.w(TAG, "Setting next signed prekey id: " + index.nextSignedPreKeyId); - Log.w(TAG, "Setting active signed prekey id: " + index.activeSignedPreKeyId); + Log.i(TAG, "Setting next signed prekey id: " + index.nextSignedPreKeyId); + Log.i(TAG, "Setting active signed prekey id: " + index.activeSignedPreKeyId); TextSecurePreferences.setNextSignedPreKeyId(context, index.nextSignedPreKeyId); TextSecurePreferences.setActiveSignedPreKeyId(context, index.activeSignedPreKeyId); } catch (IOException e) { @@ -123,11 +123,11 @@ class PreKeyMigrationHelper { if (preKeyFiles != null) { for (File preKeyFile : preKeyFiles) { - Log.w(TAG, "Deleting: " + preKeyFile.getAbsolutePath()); + Log.i(TAG, "Deleting: " + preKeyFile.getAbsolutePath()); preKeyFile.delete(); } - Log.w(TAG, "Deleting: " + preKeyDirectory.getAbsolutePath()); + Log.i(TAG, "Deleting: " + preKeyDirectory.getAbsolutePath()); preKeyDirectory.delete(); } @@ -136,11 +136,11 @@ class PreKeyMigrationHelper { if (signedPreKeyFiles != null) { for (File signedPreKeyFile : signedPreKeyFiles) { - Log.w(TAG, "Deleting: " + signedPreKeyFile.getAbsolutePath()); + Log.i(TAG, "Deleting: " + signedPreKeyFile.getAbsolutePath()); signedPreKeyFile.delete(); } - Log.w(TAG, "Deleting: " + signedPreKeyDirectory.getAbsolutePath()); + Log.i(TAG, "Deleting: " + signedPreKeyDirectory.getAbsolutePath()); signedPreKeyDirectory.delete(); } } diff --git a/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java b/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java index 9f8c3ba7cd..74dba2bdf0 100644 --- a/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java +++ b/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java @@ -125,7 +125,7 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper { @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - Log.w(TAG, "Upgrading database: " + oldVersion + ", " + newVersion); + Log.i(TAG, "Upgrading database: " + oldVersion + ", " + newVersion); db.beginTransaction(); diff --git a/src/org/thoughtcrime/securesms/database/helpers/SessionStoreMigrationHelper.java b/src/org/thoughtcrime/securesms/database/helpers/SessionStoreMigrationHelper.java index 8aeddc9190..6d37b13909 100644 --- a/src/org/thoughtcrime/securesms/database/helpers/SessionStoreMigrationHelper.java +++ b/src/org/thoughtcrime/securesms/database/helpers/SessionStoreMigrationHelper.java @@ -65,13 +65,13 @@ class SessionStoreMigrationHelper { SessionRecord sessionRecord; if (versionMarker == SINGLE_STATE_VERSION) { - Log.w(TAG, "Migrating single state version: " + sessionFile.getAbsolutePath()); + Log.i(TAG, "Migrating single state version: " + sessionFile.getAbsolutePath()); SessionStructure sessionStructure = SessionStructure.parseFrom(serialized); SessionState sessionState = new SessionState(sessionStructure); sessionRecord = new SessionRecord(sessionState); } else if (versionMarker >= ARCHIVE_STATES_VERSION) { - Log.w(TAG, "Migrating session: " + sessionFile.getAbsolutePath()); + Log.i(TAG, "Migrating session: " + sessionFile.getAbsolutePath()); sessionRecord = new SessionRecord(serialized); } else { throw new AssertionError("Unknown version: " + versionMarker + ", " + sessionFile.getAbsolutePath()); diff --git a/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java b/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java index d3770a5ed6..e68126c6cb 100644 --- a/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java +++ b/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java @@ -161,12 +161,12 @@ public class SignalCommunicationModule { @Override public void onConnected() { - Log.w(TAG, "onConnected()"); + Log.i(TAG, "onConnected()"); } @Override public void onConnecting() { - Log.w(TAG, "onConnecting()"); + Log.i(TAG, "onConnecting()"); } @Override diff --git a/src/org/thoughtcrime/securesms/gcm/GcmBroadcastReceiver.java b/src/org/thoughtcrime/securesms/gcm/GcmBroadcastReceiver.java index 7d803de572..ef17a35c7e 100644 --- a/src/org/thoughtcrime/securesms/gcm/GcmBroadcastReceiver.java +++ b/src/org/thoughtcrime/securesms/gcm/GcmBroadcastReceiver.java @@ -23,7 +23,7 @@ public class GcmBroadcastReceiver extends WakefulBroadcastReceiver { String messageType = gcm.getMessageType(intent); if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) { - Log.w(TAG, "GCM message..."); + Log.i(TAG, "GCM message..."); if (!TextSecurePreferences.isPushRegistered(context)) { Log.w(TAG, "Not push registered!"); diff --git a/src/org/thoughtcrime/securesms/glide/cache/EncryptedBitmapCacheDecoder.java b/src/org/thoughtcrime/securesms/glide/cache/EncryptedBitmapCacheDecoder.java index 8f3dba4005..2f5cfdfb14 100644 --- a/src/org/thoughtcrime/securesms/glide/cache/EncryptedBitmapCacheDecoder.java +++ b/src/org/thoughtcrime/securesms/glide/cache/EncryptedBitmapCacheDecoder.java @@ -31,7 +31,7 @@ public class EncryptedBitmapCacheDecoder extends EncryptedCoder implements Resou public boolean handles(@NonNull File source, @NonNull Options options) throws IOException { - Log.w(TAG, "Checking item for encrypted Bitmap cache decoder: " + source.toString()); + Log.i(TAG, "Checking item for encrypted Bitmap cache decoder: " + source.toString()); try (InputStream inputStream = createEncryptedInputStream(secret, source)) { return streamBitmapDecoder.handles(inputStream, options); @@ -46,7 +46,7 @@ public class EncryptedBitmapCacheDecoder extends EncryptedCoder implements Resou public Resource decode(@NonNull File source, int width, int height, @NonNull Options options) throws IOException { - Log.w(TAG, "Encrypted Bitmap cache decoder running: " + source.toString()); + Log.i(TAG, "Encrypted Bitmap cache decoder running: " + source.toString()); try (InputStream inputStream = createEncryptedInputStream(secret, source)) { return streamBitmapDecoder.decode(inputStream, width, height, options); } diff --git a/src/org/thoughtcrime/securesms/glide/cache/EncryptedBitmapResourceEncoder.java b/src/org/thoughtcrime/securesms/glide/cache/EncryptedBitmapResourceEncoder.java index 7ca8ae9d15..507392e69f 100644 --- a/src/org/thoughtcrime/securesms/glide/cache/EncryptedBitmapResourceEncoder.java +++ b/src/org/thoughtcrime/securesms/glide/cache/EncryptedBitmapResourceEncoder.java @@ -33,7 +33,7 @@ public class EncryptedBitmapResourceEncoder extends EncryptedCoder implements Re @SuppressWarnings("EmptyCatchBlock") @Override public boolean encode(@NonNull Resource data, @NonNull File file, @NonNull Options options) { - Log.w(TAG, "Encrypted resource encoder running: " + file.toString()); + Log.i(TAG, "Encrypted resource encoder running: " + file.toString()); Bitmap bitmap = data.get(); Bitmap.CompressFormat format = getFormat(bitmap, options); diff --git a/src/org/thoughtcrime/securesms/glide/cache/EncryptedCacheEncoder.java b/src/org/thoughtcrime/securesms/glide/cache/EncryptedCacheEncoder.java index f966087ec1..db18927ec5 100644 --- a/src/org/thoughtcrime/securesms/glide/cache/EncryptedCacheEncoder.java +++ b/src/org/thoughtcrime/securesms/glide/cache/EncryptedCacheEncoder.java @@ -29,7 +29,7 @@ public class EncryptedCacheEncoder extends EncryptedCoder implements Encoder decode(@NonNull File source, int width, int height, @NonNull Options options) throws IOException { - Log.w(TAG, "Encrypted GIF cache decoder running..."); + Log.i(TAG, "Encrypted GIF cache decoder running..."); try (InputStream inputStream = createEncryptedInputStream(secret, source)) { return gifDecoder.decode(inputStream, width, height, options); } diff --git a/src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java b/src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java index 905168dcb4..e3333145e8 100644 --- a/src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java +++ b/src/org/thoughtcrime/securesms/jobs/AttachmentDownloadJob.java @@ -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, diff --git a/src/org/thoughtcrime/securesms/jobs/AvatarDownloadJob.java b/src/org/thoughtcrime/securesms/jobs/AvatarDownloadJob.java index 273107f007..327504f1e5 100644 --- a/src/org/thoughtcrime/securesms/jobs/AvatarDownloadJob.java +++ b/src/org/thoughtcrime/securesms/jobs/AvatarDownloadJob.java @@ -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()); diff --git a/src/org/thoughtcrime/securesms/jobs/CleanPreKeysJob.java b/src/org/thoughtcrime/securesms/jobs/CleanPreKeysJob.java index d5922c030a..a78379584e 100644 --- a/src/org/thoughtcrime/securesms/jobs/CleanPreKeysJob.java +++ b/src/org/thoughtcrime/securesms/jobs/CleanPreKeysJob.java @@ -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()); } } diff --git a/src/org/thoughtcrime/securesms/jobs/DirectoryRefreshJob.java b/src/org/thoughtcrime/securesms/jobs/DirectoryRefreshJob.java index 601efc745b..f03362461d 100644 --- a/src/org/thoughtcrime/securesms/jobs/DirectoryRefreshJob.java +++ b/src/org/thoughtcrime/securesms/jobs/DirectoryRefreshJob.java @@ -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"); diff --git a/src/org/thoughtcrime/securesms/jobs/GcmRefreshJob.java b/src/org/thoughtcrime/securesms/jobs/GcmRefreshJob.java index f27351e9e1..892d75ad81 100644 --- a/src/org/thoughtcrime/securesms/jobs/GcmRefreshJob.java +++ b/src/org/thoughtcrime/securesms/jobs/GcmRefreshJob.java @@ -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) { diff --git a/src/org/thoughtcrime/securesms/jobs/LocalBackupJob.java b/src/org/thoughtcrime/securesms/jobs/LocalBackupJob.java index 29dc6b56d8..1621870098 100644 --- a/src/org/thoughtcrime/securesms/jobs/LocalBackupJob.java +++ b/src/org/thoughtcrime/securesms/jobs/LocalBackupJob.java @@ -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!"); diff --git a/src/org/thoughtcrime/securesms/jobs/MmsDownloadJob.java b/src/org/thoughtcrime/securesms/jobs/MmsDownloadJob.java index 40b40aba27..95a4d22e1f 100644 --- a/src/org/thoughtcrime/securesms/jobs/MmsDownloadJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MmsDownloadJob.java @@ -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()); diff --git a/src/org/thoughtcrime/securesms/jobs/MmsReceiveJob.java b/src/org/thoughtcrime/securesms/jobs/MmsReceiveJob.java index 4e74fa65a5..5efa378ce0 100644 --- a/src/org/thoughtcrime/securesms/jobs/MmsReceiveJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MmsReceiveJob.java @@ -60,7 +60,7 @@ public class MmsReceiveJob extends ContextJob { MmsDatabase database = DatabaseFactory.getMmsDatabase(context); Pair messageAndThreadId = database.insertMessageInbox((NotificationInd)pdu, subscriptionId); - Log.w(TAG, "Inserted received MMS notification..."); + Log.i(TAG, "Inserted received MMS notification..."); ApplicationContext.getInstance(context) .getJobManager() diff --git a/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java b/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java index 32e4ab0f1f..25e7efc005 100644 --- a/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java @@ -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()); } diff --git a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java index 29ae88d662..f7aebe16da 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java @@ -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 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 attachments = new LinkedList<>(); diff --git a/src/org/thoughtcrime/securesms/jobs/PushReceivedJob.java b/src/org/thoughtcrime/securesms/jobs/PushReceivedJob.java index c7a06aaf38..fa73592bfd 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushReceivedJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushReceivedJob.java @@ -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()); } diff --git a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java index 20faeab2a1..7dc134ae37 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java @@ -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); diff --git a/src/org/thoughtcrime/securesms/jobs/RefreshPreKeysJob.java b/src/org/thoughtcrime/securesms/jobs/RefreshPreKeysJob.java index 94c23b19b4..1ebd5243c4 100644 --- a/src/org/thoughtcrime/securesms/jobs/RefreshPreKeysJob.java +++ b/src/org/thoughtcrime/securesms/jobs/RefreshPreKeysJob.java @@ -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); diff --git a/src/org/thoughtcrime/securesms/jobs/RotateSignedPreKeyJob.java b/src/org/thoughtcrime/securesms/jobs/RotateSignedPreKeyJob.java index 43a1d48a1a..c23bd42bfb 100644 --- a/src/org/thoughtcrime/securesms/jobs/RotateSignedPreKeyJob.java +++ b/src/org/thoughtcrime/securesms/jobs/RotateSignedPreKeyJob.java @@ -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); diff --git a/src/org/thoughtcrime/securesms/jobs/SmsReceiveJob.java b/src/org/thoughtcrime/securesms/jobs/SmsReceiveJob.java index efa00ceb27..f11113580e 100644 --- a/src/org/thoughtcrime/securesms/jobs/SmsReceiveJob.java +++ b/src/org/thoughtcrime/securesms/jobs/SmsReceiveJob.java @@ -45,7 +45,7 @@ public class SmsReceiveJob extends ContextJob { @Override public void onRun() throws MigrationPendingException { - Log.w(TAG, "onRun()"); + Log.i(TAG, "onRun()"); Optional message = assembleMessageFragments(pdus, subscriptionId); diff --git a/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java b/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java index b6d5dfd91a..d3ffec6896 100644 --- a/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java @@ -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 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); } } diff --git a/src/org/thoughtcrime/securesms/mms/AttachmentManager.java b/src/org/thoughtcrime/securesms/mms/AttachmentManager.java index 7d70553fe6..80d75a8224 100644 --- a/src/org/thoughtcrime/securesms/mms/AttachmentManager.java +++ b/src/org/thoughtcrime/securesms/mms/AttachmentManager.java @@ -162,14 +162,14 @@ public class AttachmentManager { private void cleanup(final @Nullable Uri uri) { if (uri != null && PersistentBlobProvider.isAuthority(context, uri)) { - Log.w(TAG, "cleaning up " + uri); + Log.d(TAG, "cleaning up " + uri); PersistentBlobProvider.getInstance(context).delete(context, uri); } } private void markGarbage(@Nullable Uri uri) { if (uri != null && PersistentBlobProvider.isAuthority(context, uri)) { - Log.w(TAG, "Marking garbage that needs cleaning: " + uri); + Log.d(TAG, "Marking garbage that needs cleaning: " + uri); garbage.add(uri); } } @@ -301,7 +301,7 @@ public class AttachmentManager { height = dimens.second; } - Log.w(TAG, "remote slide with size " + fileSize + " took " + (System.currentTimeMillis() - start) + "ms"); + Log.d(TAG, "remote slide with size " + fileSize + " took " + (System.currentTimeMillis() - start) + "ms"); return mediaType.createSlide(context, uri, fileName, mimeType, fileSize, width, height); } } finally { @@ -337,7 +337,7 @@ public class AttachmentManager { height = dimens.second; } - Log.w(TAG, "local slide with size " + mediaSize + " took " + (System.currentTimeMillis() - start) + "ms"); + Log.d(TAG, "local slide with size " + mediaSize + " took " + (System.currentTimeMillis() - start) + "ms"); return mediaType.createSlide(context, uri, fileName, mimeType, mediaSize, width, height); } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); @@ -435,7 +435,7 @@ public class AttachmentManager { if (captureUri == null) { captureUri = PersistentBlobProvider.getInstance(context).createForExternal(context, MediaUtil.IMAGE_JPEG); } - Log.w(TAG, "captureUri path is " + captureUri.getPath()); + Log.d(TAG, "captureUri path is " + captureUri.getPath()); captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, captureUri); activity.startActivityForResult(captureIntent, requestCode); } diff --git a/src/org/thoughtcrime/securesms/mms/CompatMmsConnection.java b/src/org/thoughtcrime/securesms/mms/CompatMmsConnection.java index 12a0771eba..9f648e80df 100644 --- a/src/org/thoughtcrime/securesms/mms/CompatMmsConnection.java +++ b/src/org/thoughtcrime/securesms/mms/CompatMmsConnection.java @@ -31,17 +31,17 @@ public class CompatMmsConnection implements OutgoingMmsConnection, IncomingMmsCo { if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) { try { - Log.w(TAG, "Sending via Lollipop API"); + Log.i(TAG, "Sending via Lollipop API"); return new OutgoingLollipopMmsConnection(context).send(pduBytes, subscriptionId); } catch (UndeliverableMessageException e) { Log.w(TAG, e); } - Log.w(TAG, "Falling back to legacy connection..."); + Log.i(TAG, "Falling back to legacy connection..."); } if (subscriptionId == -1) { - Log.w(TAG, "Sending via legacy connection"); + Log.i(TAG, "Sending via legacy connection"); try { SendConf result = new OutgoingLegacyMmsConnection(context).send(pduBytes, subscriptionId); @@ -56,7 +56,7 @@ public class CompatMmsConnection implements OutgoingMmsConnection, IncomingMmsCo } if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP && VERSION.SDK_INT < VERSION_CODES.LOLLIPOP_MR1) { - Log.w(TAG, "Falling back to sending via Lollipop API"); + Log.i(TAG, "Falling back to sending via Lollipop API"); return new OutgoingLollipopMmsConnection(context).send(pduBytes, subscriptionId); } @@ -71,18 +71,18 @@ public class CompatMmsConnection implements OutgoingMmsConnection, IncomingMmsCo throws MmsException, MmsRadioException, ApnUnavailableException, IOException { if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) { - Log.w(TAG, "Receiving via Lollipop API"); + Log.i(TAG, "Receiving via Lollipop API"); try { return new IncomingLollipopMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId); } catch (MmsException e) { Log.w(TAG, e); } - Log.w(TAG, "Falling back to receiving via legacy connection"); + Log.i(TAG, "Falling back to receiving via legacy connection"); } if (VERSION.SDK_INT < 22 || subscriptionId == -1) { - Log.w(TAG, "Receiving via legacy API"); + Log.i(TAG, "Receiving via legacy API"); try { return new IncomingLegacyMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId); } catch (MmsRadioException | ApnUnavailableException | IOException e) { @@ -91,7 +91,7 @@ public class CompatMmsConnection implements OutgoingMmsConnection, IncomingMmsCo } if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP && VERSION.SDK_INT < VERSION_CODES.LOLLIPOP_MR1) { - Log.w(TAG, "Falling back to receiving via Lollipop API"); + Log.i(TAG, "Falling back to receiving via Lollipop API"); return new IncomingLollipopMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId); } diff --git a/src/org/thoughtcrime/securesms/mms/IncomingLegacyMmsConnection.java b/src/org/thoughtcrime/securesms/mms/IncomingLegacyMmsConnection.java index 00f86f45df..3ba8f3b369 100644 --- a/src/org/thoughtcrime/securesms/mms/IncomingLegacyMmsConnection.java +++ b/src/org/thoughtcrime/securesms/mms/IncomingLegacyMmsConnection.java @@ -78,7 +78,7 @@ public class IncomingLegacyMmsConnection extends LegacyMmsConnection implements Apn contentApn = new Apn(contentLocation, apn.getProxy(), Integer.toString(apn.getPort()), apn.getUsername(), apn.getPassword()); if (isDirectConnect()) { - Log.w(TAG, "Connecting directly..."); + Log.i(TAG, "Connecting directly..."); try { return retrieve(contentApn, transactionId, false, false); } catch (IOException | ApnUnavailableException e) { @@ -86,11 +86,11 @@ public class IncomingLegacyMmsConnection extends LegacyMmsConnection implements } } - Log.w(TAG, "Changing radio to MMS mode.."); + Log.i(TAG, "Changing radio to MMS mode.."); radio.connect(); try { - Log.w(TAG, "Downloading in MMS mode with proxy..."); + Log.i(TAG, "Downloading in MMS mode with proxy..."); try { return retrieve(contentApn, transactionId, true, true); @@ -98,7 +98,7 @@ public class IncomingLegacyMmsConnection extends LegacyMmsConnection implements Log.w(TAG, e); } - Log.w(TAG, "Downloading in MMS mode without proxy..."); + Log.i(TAG, "Downloading in MMS mode without proxy..."); return retrieve(contentApn, transactionId, true, false); @@ -117,7 +117,7 @@ public class IncomingLegacyMmsConnection extends LegacyMmsConnection implements ? contentApn.getProxy() : Uri.parse(contentApn.getMmsc()).getHost(); if (checkRouteToHost(context, targetHost, usingMmsRadio)) { - Log.w(TAG, "got successful route to host " + targetHost); + Log.i(TAG, "got successful route to host " + targetHost); pdu = execute(constructRequest(contentApn, useProxy)); } diff --git a/src/org/thoughtcrime/securesms/mms/IncomingLollipopMmsConnection.java b/src/org/thoughtcrime/securesms/mms/IncomingLollipopMmsConnection.java index 8b3bc4e983..f86b52e897 100644 --- a/src/org/thoughtcrime/securesms/mms/IncomingLollipopMmsConnection.java +++ b/src/org/thoughtcrime/securesms/mms/IncomingLollipopMmsConnection.java @@ -54,9 +54,9 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme @Override public synchronized void onResult(Context context, Intent intent) { if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) { - Log.w(TAG, "HTTP status: " + intent.getIntExtra(SmsManager.EXTRA_MMS_HTTP_STATUS, -1)); + Log.i(TAG, "HTTP status: " + intent.getIntExtra(SmsManager.EXTRA_MMS_HTTP_STATUS, -1)); } - Log.w(TAG, "code: " + getResultCode() + ", result string: " + getResultData()); + Log.i(TAG, "code: " + getResultCode() + ", result string: " + getResultData()); } @Override @@ -70,7 +70,7 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme try { MmsBodyProvider.Pointer pointer = MmsBodyProvider.makeTemporaryPointer(getContext()); - Log.w(TAG, "downloading multimedia from " + contentLocation + " to " + pointer.getUri()); + Log.i(TAG, "downloading multimedia from " + contentLocation + " to " + pointer.getUri()); SmsManager smsManager; @@ -92,7 +92,7 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme Util.copy(pointer.getInputStream(), baos); pointer.close(); - Log.w(TAG, baos.size() + "-byte response: ");// + Hex.dump(baos.toByteArray())); + Log.i(TAG, baos.size() + "-byte response: ");// + Hex.dump(baos.toByteArray())); RetrieveConf retrieved = (RetrieveConf) new PduParser(baos.toByteArray()).parse(); diff --git a/src/org/thoughtcrime/securesms/mms/LegacyMmsConnection.java b/src/org/thoughtcrime/securesms/mms/LegacyMmsConnection.java index 319da0844f..1067978b76 100644 --- a/src/org/thoughtcrime/securesms/mms/LegacyMmsConnection.java +++ b/src/org/thoughtcrime/securesms/mms/LegacyMmsConnection.java @@ -127,13 +127,13 @@ public abstract class LegacyMmsConnection { return true; } - Log.w(TAG, "Checking route to address: " + host + ", " + inetAddress.getHostAddress()); + Log.i(TAG, "Checking route to address: " + host + ", " + inetAddress.getHostAddress()); ConnectivityManager manager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); try { final Method requestRouteMethod = manager.getClass().getMethod("requestRouteToHostAddress", Integer.TYPE, InetAddress.class); final boolean routeToHostObtained = (Boolean) requestRouteMethod.invoke(manager, MmsRadio.TYPE_MOBILE_MMS, inetAddress); - Log.w(TAG, "requestRouteToHostAddress(" + inetAddress + ") -> " + routeToHostObtained); + Log.i(TAG, "requestRouteToHostAddress(" + inetAddress + ") -> " + routeToHostObtained); return routeToHostObtained; } catch (NoSuchMethodException nsme) { Log.w(TAG, nsme); @@ -151,7 +151,7 @@ public abstract class LegacyMmsConnection { ByteArrayOutputStream baos = new ByteArrayOutputStream(); Util.copy(in, baos); - Log.w(TAG, "Received full server response, " + baos.size() + " bytes"); + Log.i(TAG, "Received full server response, " + baos.size() + " bytes"); return baos.toByteArray(); } @@ -183,7 +183,7 @@ public abstract class LegacyMmsConnection { } protected byte[] execute(HttpUriRequest request) throws IOException { - Log.w(TAG, "connecting to " + apn.getMmsc()); + Log.i(TAG, "connecting to " + apn.getMmsc()); CloseableHttpClient client = null; CloseableHttpResponse response = null; @@ -191,7 +191,7 @@ public abstract class LegacyMmsConnection { client = constructHttpClient(); response = client.execute(request); - Log.w(TAG, "* response code: " + response.getStatusLine()); + Log.i(TAG, "* response code: " + response.getStatusLine()); if (response.getStatusLine().getStatusCode() == 200) { return parseResponse(response.getEntity().getContent()); diff --git a/src/org/thoughtcrime/securesms/mms/LollipopMmsConnection.java b/src/org/thoughtcrime/securesms/mms/LollipopMmsConnection.java index 9324ecccd7..2a834dc275 100644 --- a/src/org/thoughtcrime/securesms/mms/LollipopMmsConnection.java +++ b/src/org/thoughtcrime/securesms/mms/LollipopMmsConnection.java @@ -45,7 +45,7 @@ public abstract class LollipopMmsConnection extends BroadcastReceiver { @Override public synchronized void onReceive(Context context, Intent intent) { - Log.w(TAG, "onReceive()"); + Log.i(TAG, "onReceive()"); if (!action.equals(intent.getAction())) { Log.w(TAG, "received broadcast with unexpected action " + intent.getAction()); return; diff --git a/src/org/thoughtcrime/securesms/mms/MmsRadio.java b/src/org/thoughtcrime/securesms/mms/MmsRadio.java index 80380c4f7d..1d5325631a 100644 --- a/src/org/thoughtcrime/securesms/mms/MmsRadio.java +++ b/src/org/thoughtcrime/securesms/mms/MmsRadio.java @@ -49,14 +49,14 @@ public class MmsRadio { } public synchronized void disconnect() { - Log.w("MmsRadio", "MMS Radio Disconnect Called..."); + Log.i(TAG, "MMS Radio Disconnect Called..."); wakeLock.release(); connectedCounter--; - Log.w("MmsRadio", "Reference count: " + connectedCounter); + Log.i(TAG, "Reference count: " + connectedCounter); if (connectedCounter == 0) { - Log.w("MmsRadio", "Turning off MMS radio..."); + Log.i(TAG, "Turning off MMS radio..."); try { final Method stopUsingNetworkFeatureMethod = connectivityManager.getClass().getMethod("stopUsingNetworkFeature", Integer.TYPE, String.class); stopUsingNetworkFeatureMethod.invoke(connectivityManager, ConnectivityManager.TYPE_MOBILE, FEATURE_ENABLE_MMS); @@ -69,7 +69,7 @@ public class MmsRadio { } if (connectivityListener != null) { - Log.w("MmsRadio", "Unregistering receiver..."); + Log.i(TAG, "Unregistering receiver..."); context.unregisterReceiver(connectivityListener); connectivityListener = null; } @@ -90,7 +90,7 @@ public class MmsRadio { throw new MmsRadioException(ite); } - Log.w("MmsRadio", "startUsingNetworkFeature status: " + status); + Log.i(TAG, "startUsingNetworkFeature status: " + status); if (status == APN_ALREADY_ACTIVE) { wakeLock.acquire(); @@ -109,7 +109,7 @@ public class MmsRadio { Util.wait(this, 30000); if (!isConnected()) { - Log.w("MmsRadio", "Got back from connectivity wait, and not connected..."); + Log.w(TAG, "Got back from connectivity wait, and not connected..."); disconnect(); throw new MmsRadioException("Unable to successfully enable MMS radio."); } @@ -119,7 +119,7 @@ public class MmsRadio { private boolean isConnected() { NetworkInfo info = connectivityManager.getNetworkInfo(TYPE_MOBILE_MMS); - Log.w("MmsRadio", "Connected: " + info); + Log.i(TAG, "Connected: " + info); if ((info == null) || (info.getType() != TYPE_MOBILE_MMS) || !info.isConnected()) return false; @@ -141,13 +141,13 @@ public class MmsRadio { private synchronized void issueConnectivityChange() { if (isConnected()) { - Log.w("MmsRadio", "Notifying connected..."); + Log.i(TAG, "Notifying connected..."); notifyAll(); return; } if (!isConnected() && (isConnectivityFailure() || !isConnectivityPossible())) { - Log.w("MmsRadio", "Notifying not connected..."); + Log.i(TAG, "Notifying not connected..."); notifyAll(); return; } @@ -156,7 +156,7 @@ public class MmsRadio { private class ConnectivityListener extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Log.w("MmsRadio", "Got connectivity change..."); + Log.i(TAG, "Got connectivity change..."); issueConnectivityChange(); } } diff --git a/src/org/thoughtcrime/securesms/mms/OutgoingLegacyMmsConnection.java b/src/org/thoughtcrime/securesms/mms/OutgoingLegacyMmsConnection.java index f68e9ffe6f..1412daeddf 100644 --- a/src/org/thoughtcrime/securesms/mms/OutgoingLegacyMmsConnection.java +++ b/src/org/thoughtcrime/securesms/mms/OutgoingLegacyMmsConnection.java @@ -78,7 +78,7 @@ public class OutgoingLegacyMmsConnection extends LegacyMmsConnection implements MmsRadio radio = MmsRadio.getInstance(context); if (isDirectConnect()) { - Log.w(TAG, "Sending MMS directly without radio change..."); + Log.i(TAG, "Sending MMS directly without radio change..."); try { return send(pduBytes, false, false); } catch (IOException e) { @@ -86,7 +86,7 @@ public class OutgoingLegacyMmsConnection extends LegacyMmsConnection implements } } - Log.w(TAG, "Sending MMS with radio change and proxy..."); + Log.i(TAG, "Sending MMS with radio change and proxy..."); radio.connect(); try { @@ -96,7 +96,7 @@ public class OutgoingLegacyMmsConnection extends LegacyMmsConnection implements Log.w(TAG, e); } - Log.w(TAG, "Sending MMS with radio change and without proxy..."); + Log.i(TAG, "Sending MMS with radio change and without proxy..."); try { return send(pduBytes, true, false); @@ -126,13 +126,13 @@ public class OutgoingLegacyMmsConnection extends LegacyMmsConnection implements ? apn.getProxy() : Uri.parse(apn.getMmsc()).getHost(); - Log.w(TAG, "Sending MMS of length: " + pduBytes.length + Log.i(TAG, "Sending MMS of length: " + pduBytes.length + (useMmsRadio ? ", using mms radio" : "") + (useProxy ? ", using proxy" : "")); try { if (checkRouteToHost(context, targetHost, useMmsRadio)) { - Log.w(TAG, "got successful route to host " + targetHost); + Log.i(TAG, "got successful route to host " + targetHost); byte[] response = execute(constructRequest(pduBytes, useProxy)); if (response != null) return response; } diff --git a/src/org/thoughtcrime/securesms/mms/OutgoingLollipopMmsConnection.java b/src/org/thoughtcrime/securesms/mms/OutgoingLollipopMmsConnection.java index 512a99ed5e..89a2f51fd6 100644 --- a/src/org/thoughtcrime/securesms/mms/OutgoingLollipopMmsConnection.java +++ b/src/org/thoughtcrime/securesms/mms/OutgoingLollipopMmsConnection.java @@ -53,7 +53,7 @@ public class OutgoingLollipopMmsConnection extends LollipopMmsConnection impleme @Override public synchronized void onResult(Context context, Intent intent) { if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) { - Log.w(TAG, "HTTP status: " + intent.getIntExtra(SmsManager.EXTRA_MMS_HTTP_STATUS, -1)); + Log.i(TAG, "HTTP status: " + intent.getIntExtra(SmsManager.EXTRA_MMS_HTTP_STATUS, -1)); } response = intent.getByteArrayExtra(SmsManager.EXTRA_MMS_DATA); @@ -96,7 +96,7 @@ public class OutgoingLollipopMmsConnection extends LollipopMmsConnection impleme waitForResult(); - Log.w(TAG, "MMS broadcast received and processed."); + Log.i(TAG, "MMS broadcast received and processed."); pointer.close(); if (response == null) { diff --git a/src/org/thoughtcrime/securesms/notifications/MarkReadReceiver.java b/src/org/thoughtcrime/securesms/notifications/MarkReadReceiver.java index f8cc3fe3a0..7182921790 100644 --- a/src/org/thoughtcrime/securesms/notifications/MarkReadReceiver.java +++ b/src/org/thoughtcrime/securesms/notifications/MarkReadReceiver.java @@ -50,7 +50,7 @@ public class MarkReadReceiver extends BroadcastReceiver { List messageIdsCollection = new LinkedList<>(); for (long threadId : threadIds) { - Log.w(TAG, "Marking as read: " + threadId); + Log.i(TAG, "Marking as read: " + threadId); List messageIds = DatabaseFactory.getThreadDatabase(context).setRead(threadId, true); messageIdsCollection.addAll(messageIds); } diff --git a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java index 44db38086d..87390b0676 100644 --- a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java +++ b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java @@ -196,7 +196,7 @@ public class MessageNotifier { public static void updateNotification(@NonNull Context context, long threadId) { if (System.currentTimeMillis() - lastDesktopActivityTimestamp < DESKTOP_ACTIVITY_PERIOD) { - Log.w(TAG, "Scheduling delayed notification..."); + Log.i(TAG, "Scheduling delayed notification..."); executor.execute(new DelayedNotification(context, threadId)); } else { updateNotification(context, threadId, true); @@ -526,14 +526,14 @@ public class MessageNotifier { MessageNotifier.updateNotification(context); long delayMillis = delayUntil - System.currentTimeMillis(); - Log.w(TAG, "Waiting to notify: " + delayMillis); + Log.i(TAG, "Waiting to notify: " + delayMillis); if (delayMillis > 0) { Util.sleep(delayMillis); } if (!canceled.get()) { - Log.w(TAG, "Not canceled, notifying..."); + Log.i(TAG, "Not canceled, notifying..."); MessageNotifier.updateNotification(context, threadId, true); MessageNotifier.cancelDelayedNotifications(); } else { diff --git a/src/org/thoughtcrime/securesms/notifications/NotificationState.java b/src/org/thoughtcrime/securesms/notifications/NotificationState.java index ba2168d901..eb5e828242 100644 --- a/src/org/thoughtcrime/securesms/notifications/NotificationState.java +++ b/src/org/thoughtcrime/securesms/notifications/NotificationState.java @@ -19,6 +19,8 @@ import java.util.List; public class NotificationState { + private static final String TAG = NotificationState.class.getSimpleName(); + private final LinkedList notifications = new LinkedList<>(); private final LinkedHashSet threads = new LinkedHashSet<>(); @@ -102,7 +104,7 @@ public class NotificationState { int index = 0; for (long thread : threads) { - Log.w("NotificationState", "Added thread: " + thread); + Log.i(TAG, "Added thread: " + thread); threadArray[index++] = thread; } @@ -145,7 +147,7 @@ public class NotificationState { long[] threadArray = new long[threads.size()]; int index = 0; for (long thread : threads) { - Log.w("NotificationState", "getAndroidAutoHeardIntent Added thread: " + thread); + Log.i(TAG, "getAndroidAutoHeardIntent Added thread: " + thread); threadArray[index++] = thread; } diff --git a/src/org/thoughtcrime/securesms/preferences/AdvancedPreferenceFragment.java b/src/org/thoughtcrime/securesms/preferences/AdvancedPreferenceFragment.java index cae3e32d8d..d2d1ec08e1 100644 --- a/src/org/thoughtcrime/securesms/preferences/AdvancedPreferenceFragment.java +++ b/src/org/thoughtcrime/securesms/preferences/AdvancedPreferenceFragment.java @@ -70,7 +70,7 @@ public class AdvancedPreferenceFragment extends CorrectedPreferenceFragment { public void onActivityResult(int reqCode, int resultCode, Intent data) { super.onActivityResult(reqCode, resultCode, data); - Log.w(TAG, "Got result: " + resultCode + " for req: " + reqCode); + Log.i(TAG, "Got result: " + resultCode + " for req: " + reqCode); if (resultCode == Activity.RESULT_OK && reqCode == PICK_IDENTITY_CONTACT) { handleIdentitySelection(data); } diff --git a/src/org/thoughtcrime/securesms/preferences/ChatsPreferenceFragment.java b/src/org/thoughtcrime/securesms/preferences/ChatsPreferenceFragment.java index 1a4209ae85..3b950703b5 100644 --- a/src/org/thoughtcrime/securesms/preferences/ChatsPreferenceFragment.java +++ b/src/org/thoughtcrime/securesms/preferences/ChatsPreferenceFragment.java @@ -160,7 +160,7 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment { .request(Manifest.permission.WRITE_EXTERNAL_STORAGE) .ifNecessary() .onAllGranted(() -> { - Log.w(TAG, "Queing backup..."); + Log.i(TAG, "Queing backup..."); ApplicationContext.getInstance(getContext()) .getJobManager() .add(new LocalBackupJob(getContext())); @@ -198,7 +198,7 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment { private class MediaDownloadChangeListener implements Preference.OnPreferenceChangeListener { @SuppressWarnings("unchecked") @Override public boolean onPreferenceChange(Preference preference, Object newValue) { - Log.w(TAG, "onPreferenceChange"); + Log.i(TAG, "onPreferenceChange"); preference.setSummary(getSummaryForMediaPreference((Set)newValue)); return true; } diff --git a/src/org/thoughtcrime/securesms/providers/MmsBodyProvider.java b/src/org/thoughtcrime/securesms/providers/MmsBodyProvider.java index 3f1175549f..05c0094664 100644 --- a/src/org/thoughtcrime/securesms/providers/MmsBodyProvider.java +++ b/src/org/thoughtcrime/securesms/providers/MmsBodyProvider.java @@ -57,11 +57,11 @@ public class MmsBodyProvider extends ContentProvider { @Override public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { - Log.w(TAG, "openFile(" + uri + ", " + mode + ")"); + Log.i(TAG, "openFile(" + uri + ", " + mode + ")"); switch (uriMatcher.match(uri)) { case SINGLE_ROW: - Log.w(TAG, "Fetching message body for a single row..."); + Log.i(TAG, "Fetching message body for a single row..."); File tmpFile = getFile(uri); final int fileMode; @@ -73,7 +73,7 @@ public class MmsBodyProvider extends ContentProvider { default: throw new IllegalArgumentException("requested file mode unsupported"); } - Log.w(TAG, "returning file " + tmpFile.getAbsolutePath()); + Log.i(TAG, "returning file " + tmpFile.getAbsolutePath()); return ParcelFileDescriptor.open(tmpFile, fileMode); } diff --git a/src/org/thoughtcrime/securesms/providers/PartProvider.java b/src/org/thoughtcrime/securesms/providers/PartProvider.java index 5750b33dc1..0468e7a307 100644 --- a/src/org/thoughtcrime/securesms/providers/PartProvider.java +++ b/src/org/thoughtcrime/securesms/providers/PartProvider.java @@ -59,7 +59,7 @@ public class PartProvider extends ContentProvider { @Override public boolean onCreate() { - Log.w(TAG, "onCreate()"); + Log.i(TAG, "onCreate()"); return true; } @@ -70,7 +70,7 @@ public class PartProvider extends ContentProvider { @Override public ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode) throws FileNotFoundException { - Log.w(TAG, "openFile() called!"); + Log.i(TAG, "openFile() called!"); if (KeyCachingService.isLocked(getContext())) { Log.w(TAG, "masterSecret was null, abandoning."); @@ -79,7 +79,7 @@ public class PartProvider extends ContentProvider { switch (uriMatcher.match(uri)) { case SINGLE_ROW: - Log.w(TAG, "Parting out a single row..."); + Log.i(TAG, "Parting out a single row..."); try { final PartUriParser partUri = new PartUriParser(uri); return getParcelStreamForAttachment(partUri.getPartId()); @@ -94,13 +94,13 @@ public class PartProvider extends ContentProvider { @Override public int delete(@NonNull Uri arg0, String arg1, String[] arg2) { - Log.w(TAG, "delete() called"); + Log.i(TAG, "delete() called"); return 0; } @Override public String getType(@NonNull Uri uri) { - Log.w(TAG, "getType() called: " + uri); + Log.i(TAG, "getType() called: " + uri); switch (uriMatcher.match(uri)) { case SINGLE_ROW: @@ -118,13 +118,13 @@ public class PartProvider extends ContentProvider { @Override public Uri insert(@NonNull Uri arg0, ContentValues arg1) { - Log.w(TAG, "insert() called"); + Log.i(TAG, "insert() called"); return null; } @Override public Cursor query(@NonNull Uri url, String[] projection, String selection, String[] selectionArgs, String sortOrder) { - Log.w(TAG, "query() called: " + url); + Log.i(TAG, "query() called: " + url); if (projection == null || projection.length <= 0) return null; @@ -153,7 +153,7 @@ public class PartProvider extends ContentProvider { @Override public int update(@NonNull Uri arg0, ContentValues arg1, String arg2, String[] arg3) { - Log.w(TAG, "update() called"); + Log.i(TAG, "update() called"); return 0; } diff --git a/src/org/thoughtcrime/securesms/scribbles/multitouch/TwoFingerGestureDetector.java b/src/org/thoughtcrime/securesms/scribbles/multitouch/TwoFingerGestureDetector.java index dfbec8def0..5ae6cd6359 100644 --- a/src/org/thoughtcrime/securesms/scribbles/multitouch/TwoFingerGestureDetector.java +++ b/src/org/thoughtcrime/securesms/scribbles/multitouch/TwoFingerGestureDetector.java @@ -29,6 +29,8 @@ import org.thoughtcrime.securesms.logging.Log; */ public abstract class TwoFingerGestureDetector extends BaseGestureDetector { + private static final String TAG = TwoFingerGestureDetector.class.getSimpleName(); + private final float mEdgeSlop; protected float mPrevFingerDiffX; protected float mPrevFingerDiffY; @@ -134,7 +136,7 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector { final float y1 = getRawY(event, 1); - Log.w("TwoFinger", + Log.d(TAG, String.format("x0: %f, y0: %f, x1: %f, y1: %f, EdgeSlop: %f, RightSlop: %f, BottomSlop: %f", x0, y0, x1, y1, edgeSlop, rightSlop, bottomSlop)); diff --git a/src/org/thoughtcrime/securesms/scribbles/viewmodel/Layer.java b/src/org/thoughtcrime/securesms/scribbles/viewmodel/Layer.java index ed15d2ccd4..06d99941d0 100644 --- a/src/org/thoughtcrime/securesms/scribbles/viewmodel/Layer.java +++ b/src/org/thoughtcrime/securesms/scribbles/viewmodel/Layer.java @@ -60,7 +60,7 @@ public class Layer { } public void postScale(float scaleDiff) { - Log.w("Layer", "ScaleDiff: " + scaleDiff); + Log.i("Layer", "ScaleDiff: " + scaleDiff); float newVal = scale + scaleDiff; if (newVal >= getMinScale() && newVal <= getMaxScale()) { scale = newVal; diff --git a/src/org/thoughtcrime/securesms/scribbles/widget/MotionView.java b/src/org/thoughtcrime/securesms/scribbles/widget/MotionView.java index 1fe3731049..ea974e656b 100644 --- a/src/org/thoughtcrime/securesms/scribbles/widget/MotionView.java +++ b/src/org/thoughtcrime/securesms/scribbles/widget/MotionView.java @@ -444,7 +444,7 @@ public class MotionView extends FrameLayout implements TextWatcher { public boolean onScale(ScaleGestureDetector detector) { if (selectedEntity != null) { float scaleFactorDiff = detector.getScaleFactor(); - Log.w(TAG, "ScaleFactorDiff: " + scaleFactorDiff); + Log.d(TAG, "ScaleFactorDiff: " + scaleFactorDiff); selectedEntity.getLayer().postScale(scaleFactorDiff - 1.0F); selectedEntity.updateEntity(); updateUI(); diff --git a/src/org/thoughtcrime/securesms/service/KeyCachingService.java b/src/org/thoughtcrime/securesms/service/KeyCachingService.java index c023d63410..3b6ffcf25a 100644 --- a/src/org/thoughtcrime/securesms/service/KeyCachingService.java +++ b/src/org/thoughtcrime/securesms/service/KeyCachingService.java @@ -126,7 +126,7 @@ public class KeyCachingService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { if (intent == null) return START_NOT_STICKY; - Log.w("KeyCachingService", "onStartCommand, " + intent.getAction()); + Log.d(TAG, "onStartCommand, " + intent.getAction()); if (intent.getAction() != null) { switch (intent.getAction()) { @@ -145,7 +145,7 @@ public class KeyCachingService extends Service { @Override public void onCreate() { - Log.w("KeyCachingService", "onCreate()"); + Log.i(TAG, "onCreate()"); super.onCreate(); this.pending = PendingIntent.getService(this, 0, new Intent(PASSPHRASE_EXPIRED_EVENT, null, this, KeyCachingService.class), 0); @@ -163,7 +163,7 @@ public class KeyCachingService extends Service { @Override public void onDestroy() { super.onDestroy(); - Log.w("KeyCachingService", "KCS Is Being Destroyed!"); + Log.w(TAG, "KCS Is Being Destroyed!"); handleClearKey(); } @@ -179,7 +179,7 @@ public class KeyCachingService extends Service { } private void handleActivityStarted() { - Log.w("KeyCachingService", "Incrementing activity count..."); + Log.d(TAG, "Incrementing activity count..."); AlarmManager alarmManager = ServiceUtil.getAlarmManager(this); alarmManager.cancel(pending); @@ -187,7 +187,7 @@ public class KeyCachingService extends Service { } private void handleActivityStopped() { - Log.w("KeyCachingService", "Decrementing activity count..."); + Log.d(TAG, "Decrementing activity count..."); activitiesRunning--; startTimeoutIfAppropriate(); @@ -195,7 +195,7 @@ public class KeyCachingService extends Service { @SuppressLint("StaticFieldLeak") private void handleClearKey() { - Log.w("KeyCachingService", "handleClearKey()"); + Log.i(TAG, "handleClearKey()"); KeyCachingService.masterSecret = null; stopForeground(true); @@ -253,7 +253,7 @@ public class KeyCachingService extends Service { if (!TextSecurePreferences.isPasswordDisabled(this)) timeoutMillis = TimeUnit.MINUTES.toMillis(passphraseTimeoutMinutes); else timeoutMillis = TimeUnit.SECONDS.toMillis(screenLockTimeoutSeconds); - Log.w("KeyCachingService", "Starting timeout: " + timeoutMillis); + Log.i(TAG, "Starting timeout: " + timeoutMillis); AlarmManager alarmManager = ServiceUtil.getAlarmManager(this); alarmManager.cancel(pending); @@ -263,7 +263,7 @@ public class KeyCachingService extends Service { @TargetApi(Build.VERSION_CODES.JELLY_BEAN) private void foregroundServiceModern() { - Log.w("KeyCachingService", "foregrounding KCS"); + Log.i(TAG, "foregrounding KCS"); NotificationCompat.Builder builder = new NotificationCompat.Builder(this); builder.setContentTitle(getString(R.string.KeyCachingService_passphrase_cached)); @@ -322,7 +322,7 @@ public class KeyCachingService extends Service { } private void broadcastNewSecret() { - Log.w("service", "Broadcasting new secret..."); + Log.i(TAG, "Broadcasting new secret..."); Intent intent = new Intent(NEW_KEY_EVENT); intent.setPackage(getApplicationContext().getPackageName()); diff --git a/src/org/thoughtcrime/securesms/service/MessageRetrievalService.java b/src/org/thoughtcrime/securesms/service/MessageRetrievalService.java index 2375cb7519..04cb2b05bf 100644 --- a/src/org/thoughtcrime/securesms/service/MessageRetrievalService.java +++ b/src/org/thoughtcrime/securesms/service/MessageRetrievalService.java @@ -116,13 +116,13 @@ public class MessageRetrievalService extends Service implements InjectableType, private synchronized void incrementActive() { activeActivities++; - Log.w(TAG, "Active Count: " + activeActivities); + Log.d(TAG, "Active Count: " + activeActivities); notifyAll(); } private synchronized void decrementActive() { activeActivities--; - Log.w(TAG, "Active Count: " + activeActivities); + Log.d(TAG, "Active Count: " + activeActivities); notifyAll(); } @@ -142,7 +142,7 @@ public class MessageRetrievalService extends Service implements InjectableType, private synchronized boolean isConnectionNecessary() { boolean isGcmDisabled = TextSecurePreferences.isGcmDisabled(this); - Log.w(TAG, String.format("Network requirement: %s, active activities: %s, push pending: %s, gcm disabled: %b", + Log.d(TAG, String.format("Network requirement: %s, active activities: %s, push pending: %s, gcm disabled: %b", networkRequirement.isPresent(), activeActivities, pushPending.size(), isGcmDisabled)); return TextSecurePreferences.isPushRegistered(this) && @@ -195,10 +195,10 @@ public class MessageRetrievalService extends Service implements InjectableType, @Override public void run() { while (!stopThread.get()) { - Log.w(TAG, "Waiting for websocket state change...."); + Log.i(TAG, "Waiting for websocket state change...."); waitForConnectionNecessary(); - Log.w(TAG, "Making websocket connection...."); + Log.i(TAG, "Making websocket connection...."); pipe = receiver.createMessagePipe(); SignalServiceMessagePipe localPipe = pipe; @@ -206,10 +206,10 @@ public class MessageRetrievalService extends Service implements InjectableType, try { while (isConnectionNecessary() && !stopThread.get()) { try { - Log.w(TAG, "Reading message..."); + Log.i(TAG, "Reading message..."); localPipe.read(REQUEST_TIMEOUT_MINUTES, TimeUnit.MINUTES, envelope -> { - Log.w(TAG, "Retrieved envelope! " + envelope.getSource()); + Log.i(TAG, "Retrieved envelope! " + envelope.getSource()); PushContentReceiveJob receiveJob = new PushContentReceiveJob(MessageRetrievalService.this); receiveJob.handle(envelope); @@ -229,10 +229,10 @@ public class MessageRetrievalService extends Service implements InjectableType, shutdown(localPipe); } - Log.w(TAG, "Looping..."); + Log.i(TAG, "Looping..."); } - Log.w(TAG, "Exiting..."); + Log.i(TAG, "Exiting..."); } private void stopThread() { diff --git a/src/org/thoughtcrime/securesms/service/MmsListener.java b/src/org/thoughtcrime/securesms/service/MmsListener.java index 44454704ba..397a151e21 100644 --- a/src/org/thoughtcrime/securesms/service/MmsListener.java +++ b/src/org/thoughtcrime/securesms/service/MmsListener.java @@ -55,14 +55,14 @@ public class MmsListener extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Log.w(TAG, "Got MMS broadcast..." + intent.getAction()); + Log.i(TAG, "Got MMS broadcast..." + intent.getAction()); if ((Telephony.Sms.Intents.WAP_PUSH_DELIVER_ACTION.equals(intent.getAction()) && Util.isDefaultSmsProvider(context)) || (Telephony.Sms.Intents.WAP_PUSH_RECEIVED_ACTION.equals(intent.getAction()) && isRelevant(context, intent))) { - Log.w(TAG, "Relevant!"); + Log.i(TAG, "Relevant!"); int subscriptionId = intent.getExtras().getInt("subscription", -1); ApplicationContext.getInstance(context) diff --git a/src/org/thoughtcrime/securesms/service/PersistentAlarmManagerListener.java b/src/org/thoughtcrime/securesms/service/PersistentAlarmManagerListener.java index a0be1cd87a..a967795cbc 100644 --- a/src/org/thoughtcrime/securesms/service/PersistentAlarmManagerListener.java +++ b/src/org/thoughtcrime/securesms/service/PersistentAlarmManagerListener.java @@ -26,7 +26,7 @@ public abstract class PersistentAlarmManagerListener extends BroadcastReceiver { scheduledTime = onAlarm(context, scheduledTime); } - Log.w(TAG, getClass() + " scheduling for: " + scheduledTime); + Log.i(TAG, getClass() + " scheduling for: " + scheduledTime); alarmManager.cancel(pendingIntent); alarmManager.set(AlarmManager.RTC_WAKEUP, scheduledTime, pendingIntent); diff --git a/src/org/thoughtcrime/securesms/service/SmsDeliveryListener.java b/src/org/thoughtcrime/securesms/service/SmsDeliveryListener.java index 901ebac0e8..62b6714a75 100644 --- a/src/org/thoughtcrime/securesms/service/SmsDeliveryListener.java +++ b/src/org/thoughtcrime/securesms/service/SmsDeliveryListener.java @@ -46,7 +46,7 @@ public class SmsDeliveryListener extends BroadcastReceiver { int status = message.getStatus(); - Log.w(TAG, "Original status: " + status); + Log.i(TAG, "Original status: " + status); // Note: https://developer.android.com/reference/android/telephony/SmsMessage.html#getStatus() // " CDMA: For not interfering with status codes from GSM, the value is shifted to the bits 31-16" diff --git a/src/org/thoughtcrime/securesms/service/SmsListener.java b/src/org/thoughtcrime/securesms/service/SmsListener.java index 71a641a8d5..2282642f75 100644 --- a/src/org/thoughtcrime/securesms/service/SmsListener.java +++ b/src/org/thoughtcrime/securesms/service/SmsListener.java @@ -142,7 +142,7 @@ public class SmsListener extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Log.w("SMSListener", "Got SMS broadcast..."); + Log.i("SMSListener", "Got SMS broadcast..."); String messageBody = getSmsMessageBodyFromIntent(intent); if (SMS_RECEIVED_ACTION.equals(intent.getAction()) && isChallenge(context, messageBody)) { @@ -155,7 +155,7 @@ public class SmsListener extends BroadcastReceiver { } else if ((intent.getAction().equals(SMS_DELIVERED_ACTION)) || (intent.getAction().equals(SMS_RECEIVED_ACTION)) && isRelevant(context, intent)) { - Log.w("SmsListener", "Constructing SmsReceiveJob..."); + Log.i("SmsListener", "Constructing SmsReceiveJob..."); Object[] pdus = (Object[]) intent.getExtras().get("pdus"); int subscriptionId = intent.getExtras().getInt("subscription", -1); diff --git a/src/org/thoughtcrime/securesms/service/UpdateApkReadyListener.java b/src/org/thoughtcrime/securesms/service/UpdateApkReadyListener.java index 9e41f6f0ef..378a22c980 100644 --- a/src/org/thoughtcrime/securesms/service/UpdateApkReadyListener.java +++ b/src/org/thoughtcrime/securesms/service/UpdateApkReadyListener.java @@ -31,7 +31,7 @@ public class UpdateApkReadyListener extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Log.w(TAG, "onReceive()"); + Log.i(TAG, "onReceive()"); if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(intent.getAction())) { long downloadId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -2); diff --git a/src/org/thoughtcrime/securesms/service/UpdateApkRefreshListener.java b/src/org/thoughtcrime/securesms/service/UpdateApkRefreshListener.java index f0e87de064..4d4d7bdbd7 100644 --- a/src/org/thoughtcrime/securesms/service/UpdateApkRefreshListener.java +++ b/src/org/thoughtcrime/securesms/service/UpdateApkRefreshListener.java @@ -25,10 +25,10 @@ public class UpdateApkRefreshListener extends PersistentAlarmManagerListener { @Override protected long onAlarm(Context context, long scheduledTime) { - Log.w(TAG, "onAlarm..."); + Log.i(TAG, "onAlarm..."); if (scheduledTime != 0 && BuildConfig.PLAY_STORE_DISABLED) { - Log.w(TAG, "Queueing APK update job..."); + Log.i(TAG, "Queueing APK update job..."); ApplicationContext.getInstance(context) .getJobManager() .add(new UpdateApkJob(context)); diff --git a/src/org/thoughtcrime/securesms/service/WebRtcCallService.java b/src/org/thoughtcrime/securesms/service/WebRtcCallService.java index f37c6939aa..85b9f20cae 100644 --- a/src/org/thoughtcrime/securesms/service/WebRtcCallService.java +++ b/src/org/thoughtcrime/securesms/service/WebRtcCallService.java @@ -199,7 +199,7 @@ public class WebRtcCallService extends Service implements InjectableType, @Override public int onStartCommand(final Intent intent, int flags, int startId) { - Log.w(TAG, "onStartCommand..."); + Log.i(TAG, "onStartCommand..."); if (intent == null || intent.getAction() == null) return START_NOT_STICKY; serviceExecutor.execute(() -> { @@ -259,7 +259,7 @@ public class WebRtcCallService extends Service implements InjectableType, @Override public void onBluetoothStateChanged(boolean isAvailable) { - Log.w(TAG, "onBluetoothStateChanged: " + isAvailable); + Log.i(TAG, "onBluetoothStateChanged: " + isAvailable); Intent intent = new Intent(this, WebRtcCallService.class); intent.setAction(ACTION_BLUETOOTH_CHANGE); @@ -334,7 +334,7 @@ public class WebRtcCallService extends Service implements InjectableType, // Handlers private void handleIncomingCall(final Intent intent) { - Log.w(TAG, "handleIncomingCall()"); + Log.i(TAG, "handleIncomingCall()"); if (callState != CallState.STATE_IDLE) throw new IllegalStateException("Incoming on non-idle"); final String offer = intent.getStringExtra(EXTRA_REMOTE_DESCRIPTION); @@ -376,7 +376,7 @@ public class WebRtcCallService extends Service implements InjectableType, WebRtcCallService.this.lockManager.updatePhoneState(LockManager.PhoneState.PROCESSING); SessionDescription sdp = WebRtcCallService.this.peerConnection.createAnswer(new MediaConstraints()); - Log.w(TAG, "Answer SDP: " + sdp.description); + Log.i(TAG, "Answer SDP: " + sdp.description); WebRtcCallService.this.peerConnection.setLocalDescription(sdp); ListenableFutureTask listenableFutureTask = sendMessage(recipient, SignalServiceCallMessage.forAnswer(new AnswerMessage(WebRtcCallService.this.callId, sdp.description))); @@ -405,7 +405,7 @@ public class WebRtcCallService extends Service implements InjectableType, } private void handleOutgoingCall(Intent intent) { - Log.w(TAG, "handleOutgoingCall..."); + Log.i(TAG, "handleOutgoingCall..."); if (callState != CallState.STATE_IDLE) throw new IllegalStateException("Dialing from non-idle?"); @@ -442,7 +442,7 @@ public class WebRtcCallService extends Service implements InjectableType, SessionDescription sdp = WebRtcCallService.this.peerConnection.createOffer(new MediaConstraints()); WebRtcCallService.this.peerConnection.setLocalDescription(sdp); - Log.w(TAG, "Sending offer: " + sdp.description); + Log.i(TAG, "Sending offer: " + sdp.description); ListenableFutureTask listenableFutureTask = sendMessage(recipient, SignalServiceCallMessage.forOffer(new OfferMessage(WebRtcCallService.this.callId, sdp.description))); @@ -479,7 +479,7 @@ public class WebRtcCallService extends Service implements InjectableType, private void handleResponseMessage(Intent intent) { try { - Log.w(TAG, "Got response: " + intent.getStringExtra(EXTRA_REMOTE_DESCRIPTION)); + Log.i(TAG, "Got response: " + intent.getStringExtra(EXTRA_REMOTE_DESCRIPTION)); if (callState != CallState.STATE_DIALING || !getRemoteRecipient(intent).equals(recipient) || !Util.isEquals(this.callId, getCallId(intent))) { Log.w(TAG, "Got answer for recipient and call id we're not currently dialing: " + getCallId(intent) + ", " + getRemoteRecipient(intent)); @@ -513,7 +513,7 @@ public class WebRtcCallService extends Service implements InjectableType, } private void handleRemoteIceCandidate(Intent intent) { - Log.w(TAG, "handleRemoteIceCandidate..."); + Log.i(TAG, "handleRemoteIceCandidate..."); if (Util.isEquals(this.callId, getCallId(intent))) { IceCandidate candidate = new IceCandidate(intent.getStringExtra(EXTRA_ICE_SDP_MID), @@ -540,7 +540,7 @@ public class WebRtcCallService extends Service implements InjectableType, intent.getStringExtra(EXTRA_ICE_SDP)); if (pendingOutgoingIceUpdates != null) { - Log.w(TAG, "Adding to pending ice candidates..."); + Log.i(TAG, "Adding to pending ice candidates..."); this.pendingOutgoingIceUpdates.add(iceUpdateMessage); return; } @@ -656,7 +656,7 @@ public class WebRtcCallService extends Service implements InjectableType, } private void handleBusyMessage(Intent intent) { - Log.w(TAG, "handleBusyMessage..."); + Log.i(TAG, "handleBusyMessage..."); final Recipient recipient = getRemoteRecipient(intent); final long callId = getCallId(intent); @@ -829,7 +829,7 @@ public class WebRtcCallService extends Service implements InjectableType, } private void handleSetCameraFlip(Intent intent) { - Log.w(TAG, "handleSetCameraFlip()..."); + Log.i(TAG, "handleSetCameraFlip()..."); if (localCameraState.isEnabled() && peerConnection != null) { peerConnection.flipCamera(); @@ -849,7 +849,7 @@ public class WebRtcCallService extends Service implements InjectableType, } private void handleWiredHeadsetChange(Intent intent) { - Log.w(TAG, "handleWiredHeadsetChange..."); + Log.i(TAG, "handleWiredHeadsetChange..."); if (callState == CallState.STATE_CONNECTED || callState == CallState.STATE_DIALING || @@ -875,7 +875,7 @@ public class WebRtcCallService extends Service implements InjectableType, if (callState == CallState.STATE_ANSWERING || callState == CallState.STATE_LOCAL_RINGING) { - Log.w(TAG, "Silencing incoming ringer..."); + Log.i(TAG, "Silencing incoming ringer..."); audioManager.silenceIncomingRinger(); } } @@ -1033,12 +1033,12 @@ public class WebRtcCallService extends Service implements InjectableType, /// PeerConnection Observer @Override public void onSignalingChange(PeerConnection.SignalingState newState) { - Log.w(TAG, "onSignalingChange: " + newState); + Log.i(TAG, "onSignalingChange: " + newState); } @Override public void onIceConnectionChange(PeerConnection.IceConnectionState newState) { - Log.w(TAG, "onIceConnectionChange:" + newState); + Log.i(TAG, "onIceConnectionChange:" + newState); if (newState == PeerConnection.IceConnectionState.CONNECTED || newState == PeerConnection.IceConnectionState.COMPLETED) @@ -1058,18 +1058,18 @@ public class WebRtcCallService extends Service implements InjectableType, @Override public void onIceConnectionReceivingChange(boolean receiving) { - Log.w(TAG, "onIceConnectionReceivingChange:" + receiving); + Log.i(TAG, "onIceConnectionReceivingChange:" + receiving); } @Override public void onIceGatheringChange(PeerConnection.IceGatheringState newState) { - Log.w(TAG, "onIceGatheringChange:" + newState); + Log.i(TAG, "onIceGatheringChange:" + newState); } @Override public void onIceCandidate(IceCandidate candidate) { - Log.w(TAG, "onIceCandidate:" + candidate); + Log.i(TAG, "onIceCandidate:" + candidate); Intent intent = new Intent(this, WebRtcCallService.class); intent.setAction(ACTION_ICE_CANDIDATE); @@ -1083,12 +1083,12 @@ public class WebRtcCallService extends Service implements InjectableType, @Override public void onIceCandidatesRemoved(IceCandidate[] candidates) { - Log.w(TAG, "onIceCandidatesRemoved:" + (candidates != null ? candidates.length : null)); + Log.i(TAG, "onIceCandidatesRemoved:" + (candidates != null ? candidates.length : null)); } @Override public void onAddStream(MediaStream stream) { - Log.w(TAG, "onAddStream:" + stream); + Log.i(TAG, "onAddStream:" + stream); for (AudioTrack audioTrack : stream.audioTracks) { audioTrack.setEnabled(true); @@ -1103,17 +1103,17 @@ public class WebRtcCallService extends Service implements InjectableType, @Override public void onAddTrack(RtpReceiver rtpReceiver, MediaStream[] mediaStreams) { - Log.w(TAG, "onAddTrack: " + mediaStreams); + Log.i(TAG, "onAddTrack: " + mediaStreams); } @Override public void onRemoveStream(MediaStream stream) { - Log.w(TAG, "onRemoveStream:" + stream); + Log.i(TAG, "onRemoveStream:" + stream); } @Override public void onDataChannel(DataChannel dataChannel) { - Log.w(TAG, "onDataChannel:" + dataChannel.label()); + Log.i(TAG, "onDataChannel:" + dataChannel.label()); if (dataChannel.label().equals(DATA_CHANNEL_NAME)) { this.dataChannel = dataChannel; @@ -1123,23 +1123,23 @@ public class WebRtcCallService extends Service implements InjectableType, @Override public void onRenegotiationNeeded() { - Log.w(TAG, "onRenegotiationNeeded"); + Log.i(TAG, "onRenegotiationNeeded"); // TODO renegotiate } @Override public void onBufferedAmountChange(long l) { - Log.w(TAG, "onBufferedAmountChange: " + l); + Log.i(TAG, "onBufferedAmountChange: " + l); } @Override public void onStateChange() { - Log.w(TAG, "onStateChange"); + Log.i(TAG, "onStateChange"); } @Override public void onMessage(DataChannel.Buffer buffer) { - Log.w(TAG, "onMessage..."); + Log.i(TAG, "onMessage..."); try { byte[] data = new byte[buffer.data.remaining()]; @@ -1148,19 +1148,19 @@ public class WebRtcCallService extends Service implements InjectableType, Data dataMessage = Data.parseFrom(data); if (dataMessage.hasConnected()) { - Log.w(TAG, "hasConnected..."); + Log.i(TAG, "hasConnected..."); Intent intent = new Intent(this, WebRtcCallService.class); intent.setAction(ACTION_CALL_CONNECTED); intent.putExtra(EXTRA_CALL_ID, dataMessage.getConnected().getId()); startService(intent); } else if (dataMessage.hasHangup()) { - Log.w(TAG, "hasHangup..."); + Log.i(TAG, "hasHangup..."); Intent intent = new Intent(this, WebRtcCallService.class); intent.setAction(ACTION_REMOTE_HANGUP); intent.putExtra(EXTRA_CALL_ID, dataMessage.getHangup().getId()); startService(intent); } else if (dataMessage.hasVideoStreamingStatus()) { - Log.w(TAG, "hasVideoStreamingStatus..."); + Log.i(TAG, "hasVideoStreamingStatus..."); Intent intent = new Intent(this, WebRtcCallService.class); intent.setAction(ACTION_REMOTE_VIDEO_MUTE); intent.putExtra(EXTRA_CALL_ID, dataMessage.getVideoStreamingStatus().getId()); @@ -1331,7 +1331,7 @@ public class WebRtcCallService extends Service implements InjectableType, @WorkerThread public static boolean isCallActive(Context context) { - Log.w(TAG, "isCallActive()"); + Log.i(TAG, "isCallActive()"); HandlerThread handlerThread = null; @@ -1343,7 +1343,7 @@ public class WebRtcCallService extends Service implements InjectableType, ResultReceiver resultReceiver = new ResultReceiver(new Handler(handlerThread.getLooper())) { protected void onReceiveResult(int resultCode, Bundle resultData) { - Log.w(TAG, "Got result..."); + Log.i(TAG, "Got result..."); future.set(resultCode == 1); } }; @@ -1354,7 +1354,7 @@ public class WebRtcCallService extends Service implements InjectableType, context.startService(intent); - Log.w(TAG, "Blocking on result..."); + Log.i(TAG, "Blocking on result..."); return future.get(); } catch (InterruptedException | ExecutionException e) { Log.w(TAG, e); diff --git a/src/org/thoughtcrime/securesms/util/BackupUtil.java b/src/org/thoughtcrime/securesms/util/BackupUtil.java index f1a6a2c7be..87e3c6e1e4 100644 --- a/src/org/thoughtcrime/securesms/util/BackupUtil.java +++ b/src/org/thoughtcrime/securesms/util/BackupUtil.java @@ -80,7 +80,7 @@ public class BackupUtil { }); for (int i=2;i quality " + Math.min(quality, MAX_COMPRESSION_QUALITY) + ", " + attempts + " attempt(s)"); + Log.i(TAG, "createScaledBytes(" + model.toString() + ") -> quality " + Math.min(quality, MAX_COMPRESSION_QUALITY) + ", " + attempts + " attempt(s)"); + return new ScaleResult(bytes, scaledBitmap.getWidth(), scaledBitmap.getHeight()); } finally { if (scaledBitmap != null) scaledBitmap.recycle(); diff --git a/src/org/thoughtcrime/securesms/util/DirectoryHelper.java b/src/org/thoughtcrime/securesms/util/DirectoryHelper.java index 2e6ea3510b..2b615363fd 100644 --- a/src/org/thoughtcrime/securesms/util/DirectoryHelper.java +++ b/src/org/thoughtcrime/securesms/util/DirectoryHelper.java @@ -231,7 +231,7 @@ public class DirectoryHelper { Account account = new Account(context.getString(R.string.app_name), "org.thoughtcrime.securesms"); if (accountManager.addAccountExplicitly(account, null, null)) { - Log.w(TAG, "Created new account..."); + Log.i(TAG, "Created new account..."); ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1); return Optional.of(new AccountHolder(account, true)); } else { diff --git a/src/org/thoughtcrime/securesms/util/IdentityUtil.java b/src/org/thoughtcrime/securesms/util/IdentityUtil.java index e98096d1aa..7c773f9f39 100644 --- a/src/org/thoughtcrime/securesms/util/IdentityUtil.java +++ b/src/org/thoughtcrime/securesms/util/IdentityUtil.java @@ -116,7 +116,7 @@ public class IdentityUtil { long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipient); - Log.w(TAG, "Inserting verified outbox..."); + Log.i(TAG, "Inserting verified outbox..."); DatabaseFactory.getSmsDatabase(context).insertMessageOutbox(threadId, outgoing, false, time, null); } } diff --git a/src/org/thoughtcrime/securesms/util/MediaUtil.java b/src/org/thoughtcrime/securesms/util/MediaUtil.java index 2dd9e72c22..afdb952f01 100644 --- a/src/org/thoughtcrime/securesms/util/MediaUtil.java +++ b/src/org/thoughtcrime/securesms/util/MediaUtil.java @@ -230,7 +230,7 @@ public class MediaUtil { } public static boolean hasVideoThumbnail(Uri uri) { - Log.w(TAG, "Checking: " + uri); + Log.i(TAG, "Checking: " + uri); if (uri == null || !ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) { return false; diff --git a/src/org/thoughtcrime/securesms/util/PlayServicesUtil.java b/src/org/thoughtcrime/securesms/util/PlayServicesUtil.java index 75eb05465a..fe629ba904 100644 --- a/src/org/thoughtcrime/securesms/util/PlayServicesUtil.java +++ b/src/org/thoughtcrime/securesms/util/PlayServicesUtil.java @@ -30,7 +30,7 @@ public class PlayServicesUtil { return PlayServicesStatus.MISSING; } - Log.w(TAG, "Play Services: " + gcmStatus); + Log.i(TAG, "Play Services: " + gcmStatus); switch (gcmStatus) { case ConnectionResult.SUCCESS: diff --git a/src/org/thoughtcrime/securesms/util/TelephonyUtil.java b/src/org/thoughtcrime/securesms/util/TelephonyUtil.java index 87346cd16d..949ef46ca5 100644 --- a/src/org/thoughtcrime/securesms/util/TelephonyUtil.java +++ b/src/org/thoughtcrime/securesms/util/TelephonyUtil.java @@ -20,13 +20,13 @@ public class TelephonyUtil { final int configMcc = context.getResources().getConfiguration().mcc; final int configMnc = context.getResources().getConfiguration().mnc; if (tm.getSimState() == TelephonyManager.SIM_STATE_READY) { - Log.w(TAG, "Choosing MCC+MNC info from TelephonyManager.getSimOperator()"); + Log.i(TAG, "Choosing MCC+MNC info from TelephonyManager.getSimOperator()"); return tm.getSimOperator(); } else if (tm.getPhoneType() != TelephonyManager.PHONE_TYPE_CDMA) { - Log.w(TAG, "Choosing MCC+MNC info from TelephonyManager.getNetworkOperator()"); + Log.i(TAG, "Choosing MCC+MNC info from TelephonyManager.getNetworkOperator()"); return tm.getNetworkOperator(); } else if (configMcc != 0 && configMnc != 0) { - Log.w(TAG, "Choosing MCC+MNC info from current context's Configuration"); + Log.i(TAG, "Choosing MCC+MNC info from current context's Configuration"); return String.format(Locale.ROOT, "%03d%d", configMcc, configMnc == Configuration.MNC_ZERO ? 0 : configMnc); diff --git a/src/org/thoughtcrime/securesms/util/TextSecurePreferences.java b/src/org/thoughtcrime/securesms/util/TextSecurePreferences.java index 8abf14e1e2..90fc664a16 100644 --- a/src/org/thoughtcrime/securesms/util/TextSecurePreferences.java +++ b/src/org/thoughtcrime/securesms/util/TextSecurePreferences.java @@ -736,7 +736,7 @@ public class TextSecurePreferences { } public static void setPushRegistered(Context context, boolean registered) { - Log.w("TextSecurePreferences", "Setting push registered: " + registered); + Log.i(TAG, "Setting push registered: " + registered); setBooleanPreference(context, REGISTERED_GCM_PREF, registered); } diff --git a/src/org/thoughtcrime/securesms/video/VideoPlayer.java b/src/org/thoughtcrime/securesms/video/VideoPlayer.java index e9ba5fb5aa..2e63ee8508 100644 --- a/src/org/thoughtcrime/securesms/video/VideoPlayer.java +++ b/src/org/thoughtcrime/securesms/video/VideoPlayer.java @@ -154,14 +154,14 @@ public class VideoPlayer extends FrameLayout { } if (videoSource.getUri() != null && PartAuthority.isLocalUri(videoSource.getUri())) { - Log.w(TAG, "Starting video attachment server for part provider Uri..."); + Log.i(TAG, "Starting video attachment server for part provider Uri..."); this.attachmentServer = new AttachmentServer(getContext(), videoSource.asAttachment()); this.attachmentServer.start(); //noinspection ConstantConditions this.videoView.setVideoURI(this.attachmentServer.getUri()); } else if (videoSource.getUri() != null) { - Log.w(TAG, "Playing video directly from non-local Uri..."); + Log.i(TAG, "Playing video directly from non-local Uri..."); //noinspection ConstantConditions this.videoView.setVideoURI(videoSource.getUri()); } else { diff --git a/src/org/thoughtcrime/securesms/webrtc/IncomingPstnCallReceiver.java b/src/org/thoughtcrime/securesms/webrtc/IncomingPstnCallReceiver.java index a1f9d70bf2..c5819f0979 100644 --- a/src/org/thoughtcrime/securesms/webrtc/IncomingPstnCallReceiver.java +++ b/src/org/thoughtcrime/securesms/webrtc/IncomingPstnCallReceiver.java @@ -26,7 +26,7 @@ public class IncomingPstnCallReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Log.w(TAG, "Checking incoming call..."); + Log.i(TAG, "Checking incoming call..."); if (intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER) == null) { Log.w(TAG, "Telephony event does not contain number..."); @@ -34,7 +34,7 @@ public class IncomingPstnCallReceiver extends BroadcastReceiver { } if (!intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_RINGING)) { - Log.w(TAG, "Telephony event is not state rining..."); + Log.w(TAG, "Telephony event is not state ringing..."); return; } @@ -54,7 +54,7 @@ public class IncomingPstnCallReceiver extends BroadcastReceiver { protected void onReceiveResult(int resultCode, Bundle resultData) { if (resultCode == 1) { - Log.w(TAG, "Attempting to deny incoming PSTN call."); + Log.i(TAG, "Attempting to deny incoming PSTN call."); TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); @@ -64,7 +64,7 @@ public class IncomingPstnCallReceiver extends BroadcastReceiver { Object telephonyService = getTelephony.invoke(tm); Method endCall = telephonyService.getClass().getDeclaredMethod("endCall"); endCall.invoke(telephonyService); - Log.w(TAG, "Denied Incoming Call."); + Log.i(TAG, "Denied Incoming Call."); } catch (NoSuchMethodException e) { Log.w(TAG, "Unable to access ITelephony API", e); } catch (IllegalAccessException e) { diff --git a/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java b/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java index f6b3fbff9f..427e6eaf2e 100644 --- a/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java +++ b/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java @@ -394,7 +394,7 @@ public class PeerConnectionWrapper { Log.w(TAG, "Camera2Enumator.isSupport() threw.", throwable); } - Log.w(TAG, "Camera2 enumerator supported: " + camera2EnumeratorIsSupported); + Log.i(TAG, "Camera2 enumerator supported: " + camera2EnumeratorIsSupported); return camera2EnumeratorIsSupported ? new Camera2Enumerator(context) : new Camera1Enumerator(true); diff --git a/src/org/thoughtcrime/securesms/webrtc/audio/BluetoothStateManager.java b/src/org/thoughtcrime/securesms/webrtc/audio/BluetoothStateManager.java index c883c70c45..b49a6fb358 100644 --- a/src/org/thoughtcrime/securesms/webrtc/audio/BluetoothStateManager.java +++ b/src/org/thoughtcrime/securesms/webrtc/audio/BluetoothStateManager.java @@ -159,7 +159,7 @@ public class BluetoothStateManager { @Override public void onServiceDisconnected(int profile) { - Log.w(TAG, "onServiceDisconnected"); + Log.i(TAG, "onServiceDisconnected"); if (profile == BluetoothProfile.HEADSET) { bluetoothHeadset = null; handleBluetoothStateChange(); @@ -172,7 +172,7 @@ public class BluetoothStateManager { @Override public void onReceive(Context context, Intent intent) { if (intent == null) return; - Log.w(TAG, "onReceive"); + Log.i(TAG, "onReceive"); synchronized (LOCK) { if (getScoChangeIntent().equals(intent.getAction())) { @@ -212,7 +212,7 @@ public class BluetoothStateManager { private class BluetoothConnectionReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Log.w(TAG, "onReceive"); + Log.i(TAG, "onReceive"); handleBluetoothStateChange(); } } diff --git a/src/org/thoughtcrime/securesms/webrtc/audio/IncomingRinger.java b/src/org/thoughtcrime/securesms/webrtc/audio/IncomingRinger.java index d2e5b7e481..a88683c0cb 100644 --- a/src/org/thoughtcrime/securesms/webrtc/audio/IncomingRinger.java +++ b/src/org/thoughtcrime/securesms/webrtc/audio/IncomingRinger.java @@ -50,7 +50,7 @@ public class IncomingRinger { if (!player.isPlaying()) { player.prepare(); player.start(); - Log.w(TAG, "Playing ringtone now..."); + Log.i(TAG, "Playing ringtone now..."); } else { Log.w(TAG, "Ringtone is already playing, declining to restart."); } @@ -65,12 +65,12 @@ public class IncomingRinger { public void stop() { if (player != null) { - Log.w(TAG, "Stopping ringer"); + Log.i(TAG, "Stopping ringer"); player.release(); player = null; } - Log.w(TAG, "Cancelling vibrator"); + Log.i(TAG, "Cancelling vibrator"); vibrator.cancel(); }