mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 23:33:39 +00:00
Add some debug logging
This commit is contained in:
parent
50ae2dd1b8
commit
e56e55363d
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.thoughtcrime.securesms;
|
package org.thoughtcrime.securesms;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
@ -179,6 +180,7 @@ import static org.whispersystems.signalservice.internal.push.SignalServiceProtos
|
|||||||
* @author Moxie Marlinspike
|
* @author Moxie Marlinspike
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||||
implements ConversationFragment.ConversationFragmentListener,
|
implements ConversationFragment.ConversationFragmentListener,
|
||||||
AttachmentManager.AttachmentListener,
|
AttachmentManager.AttachmentListener,
|
||||||
@ -938,6 +940,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleSecurityChange(boolean isSecureText, boolean isDefaultSms) {
|
private void handleSecurityChange(boolean isSecureText, boolean isDefaultSms) {
|
||||||
|
Log.w(TAG, "handleSecurityChange(" + isSecureText + ", " + isDefaultSms + ")");
|
||||||
if (isSecurityInitialized && isSecureText == this.isSecureText && isDefaultSms == this.isDefaultSms) {
|
if (isSecurityInitialized && isSecureText == this.isSecureText && isDefaultSms == this.isDefaultSms) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1035,17 +1038,21 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
protected boolean[] doInBackground(Recipient... params) {
|
protected boolean[] doInBackground(Recipient... params) {
|
||||||
Context context = ConversationActivity.this;
|
Context context = ConversationActivity.this;
|
||||||
Recipient recipient = params[0];
|
Recipient recipient = params[0];
|
||||||
|
Log.w(TAG, "Resolving registered state...");
|
||||||
RegisteredState registeredState = recipient.resolve().getRegistered();
|
RegisteredState registeredState = recipient.resolve().getRegistered();
|
||||||
|
Log.w(TAG, "Resolved registered state: " + registeredState);
|
||||||
boolean signalEnabled = TextSecurePreferences.isPushRegistered(context);
|
boolean signalEnabled = TextSecurePreferences.isPushRegistered(context);
|
||||||
|
|
||||||
if (registeredState == RegisteredState.UNKNOWN) {
|
if (registeredState == RegisteredState.UNKNOWN) {
|
||||||
try {
|
try {
|
||||||
|
Log.w(TAG, "Refreshing directory for user: " + recipient.getAddress().serialize());
|
||||||
registeredState = DirectoryHelper.refreshDirectoryFor(context, masterSecret, recipient);
|
registeredState = DirectoryHelper.refreshDirectoryFor(context, masterSecret, recipient);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.w(TAG, "Returning registered state...");
|
||||||
return new boolean[] {registeredState == RegisteredState.REGISTERED && signalEnabled,
|
return new boolean[] {registeredState == RegisteredState.REGISTERED && signalEnabled,
|
||||||
Util.isDefaultSmsProvider(context)};
|
Util.isDefaultSmsProvider(context)};
|
||||||
}
|
}
|
||||||
@ -1053,6 +1060,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(boolean[] result) {
|
protected void onPostExecute(boolean[] result) {
|
||||||
if (result[0] != currentSecureText || result[1] != currentIsDefaultSms) {
|
if (result[0] != currentSecureText || result[1] != currentIsDefaultSms) {
|
||||||
|
Log.w(TAG, "onPostExecute() handleSecurityChange: " + result[0] + " , " + result[1]);
|
||||||
handleSecurityChange(result[0], result[1]);
|
handleSecurityChange(result[0], result[1]);
|
||||||
}
|
}
|
||||||
future.set(true);
|
future.set(true);
|
||||||
@ -1064,6 +1072,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onSecurityUpdated() {
|
private void onSecurityUpdated() {
|
||||||
|
Log.w(TAG, "onSecurityUpdated()");
|
||||||
updateInviteReminder(recipient.hasSeenInviteReminder());
|
updateInviteReminder(recipient.hasSeenInviteReminder());
|
||||||
updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId());
|
updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId());
|
||||||
}
|
}
|
||||||
@ -1279,7 +1288,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onModified(final Recipient recipient) {
|
public void onModified(final Recipient recipient) {
|
||||||
|
Log.w(TAG, "onModified(" + recipient.getAddress().serialize() + ")");
|
||||||
Util.runOnMain(() -> {
|
Util.runOnMain(() -> {
|
||||||
|
Log.w(TAG, "onModifiedRun(): " + recipient.getRegistered());
|
||||||
titleView.setTitle(glideRequests, recipient);
|
titleView.setTitle(glideRequests, recipient);
|
||||||
titleView.setVerified(identityRecords.isVerified());
|
titleView.setVerified(identityRecords.isVerified());
|
||||||
setBlockedUserState(recipient, isSecureText, isDefaultSms);
|
setBlockedUserState(recipient, isSecureText, isDefaultSms);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user