mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Reduce usage of Log.w()
This commit is contained in:
@@ -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<Integer> 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<IdentityRecordList, String> 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<IdentityRecord> 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());
|
||||
|
||||
Reference in New Issue
Block a user