mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Reduce usage of Log.w()
This commit is contained in:
parent
a498176043
commit
43068e0613
@ -274,7 +274,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle state, boolean ready) {
|
protected void onCreate(Bundle state, boolean ready) {
|
||||||
Log.w(TAG, "onCreate()");
|
Log.i(TAG, "onCreate()");
|
||||||
|
|
||||||
supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
|
supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY);
|
||||||
setContentView(R.layout.conversation_activity);
|
setContentView(R.layout.conversation_activity);
|
||||||
@ -316,7 +316,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
Log.w(TAG, "onNewIntent()");
|
Log.i(TAG, "onNewIntent()");
|
||||||
|
|
||||||
if (isFinishing()) {
|
if (isFinishing()) {
|
||||||
Log.w(TAG, "Activity is finishing...");
|
Log.w(TAG, "Activity is finishing...");
|
||||||
@ -370,7 +370,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
MessageNotifier.setVisibleThread(threadId);
|
MessageNotifier.setVisibleThread(threadId);
|
||||||
markThreadAsRead();
|
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
|
@Override
|
||||||
@ -395,7 +395,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
Log.w(TAG, "onConfigurationChanged(" + newConfig.orientation + ")");
|
Log.i(TAG, "onConfigurationChanged(" + newConfig.orientation + ")");
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
composeText.setTransport(sendButton.getSelectedTransport());
|
composeText.setTransport(sendButton.getSelectedTransport());
|
||||||
quickAttachmentDrawer.onConfigurationChanged();
|
quickAttachmentDrawer.onConfigurationChanged();
|
||||||
@ -415,7 +415,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(final int reqCode, int resultCode, Intent data) {
|
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);
|
super.onActivityResult(reqCode, resultCode, data);
|
||||||
|
|
||||||
if ((data == null && reqCode != TAKE_PHOTO && reqCode != SMS_DEFAULT) ||
|
if ((data == null && reqCode != TAKE_PHOTO && reqCode != SMS_DEFAULT) ||
|
||||||
@ -589,7 +589,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
Log.w(TAG, "onBackPressed()");
|
Log.d(TAG, "onBackPressed()");
|
||||||
if (container.isInputOpen()) container.hideCurrentInput(composeText);
|
if (container.isInputOpen()) container.hideCurrentInput(composeText);
|
||||||
else super.onBackPressed();
|
else super.onBackPressed();
|
||||||
}
|
}
|
||||||
@ -972,7 +972,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 + ")");
|
Log.i(TAG, "handleSecurityChange(" + isSecureText + ", " + isDefaultSms + ")");
|
||||||
if (isSecurityInitialized && isSecureText == this.isSecureText && isDefaultSms == this.isDefaultSms) {
|
if (isSecurityInitialized && isSecureText == this.isSecureText && isDefaultSms == this.isDefaultSms) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1108,33 +1108,33 @@ 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...");
|
Log.i(TAG, "Resolving registered state...");
|
||||||
RegisteredState registeredState;
|
RegisteredState registeredState;
|
||||||
|
|
||||||
if (recipient.isPushGroupRecipient()) {
|
if (recipient.isPushGroupRecipient()) {
|
||||||
Log.w(TAG, "Push group recipient...");
|
Log.i(TAG, "Push group recipient...");
|
||||||
registeredState = RegisteredState.REGISTERED;
|
registeredState = RegisteredState.REGISTERED;
|
||||||
} else if (recipient.isResolving()) {
|
} 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());
|
registeredState = DatabaseFactory.getRecipientDatabase(ConversationActivity.this).isRegistered(recipient.getAddress());
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "Checking through resolved recipient");
|
Log.i(TAG, "Checking through resolved recipient");
|
||||||
registeredState = recipient.resolve().getRegistered();
|
registeredState = recipient.resolve().getRegistered();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Resolved registered state: " + registeredState);
|
Log.i(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());
|
Log.i(TAG, "Refreshing directory for user: " + recipient.getAddress().serialize());
|
||||||
registeredState = DirectoryHelper.refreshDirectoryFor(context, recipient);
|
registeredState = DirectoryHelper.refreshDirectoryFor(context, recipient);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Returning registered state...");
|
Log.i(TAG, "Returning registered state...");
|
||||||
return new boolean[] {registeredState == RegisteredState.REGISTERED && signalEnabled,
|
return new boolean[] {registeredState == RegisteredState.REGISTERED && signalEnabled,
|
||||||
Util.isDefaultSmsProvider(context)};
|
Util.isDefaultSmsProvider(context)};
|
||||||
}
|
}
|
||||||
@ -1142,7 +1142,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]);
|
Log.i(TAG, "onPostExecute() handleSecurityChange: " + result[0] + " , " + result[1]);
|
||||||
handleSecurityChange(result[0], result[1]);
|
handleSecurityChange(result[0], result[1]);
|
||||||
}
|
}
|
||||||
future.set(true);
|
future.set(true);
|
||||||
@ -1154,13 +1154,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onSecurityUpdated() {
|
private void onSecurityUpdated() {
|
||||||
Log.w(TAG, "onSecurityUpdated()");
|
Log.i(TAG, "onSecurityUpdated()");
|
||||||
updateReminders(recipient.hasSeenInviteReminder());
|
updateReminders(recipient.hasSeenInviteReminder());
|
||||||
updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId());
|
updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateReminders(boolean seenInvite) {
|
protected void updateReminders(boolean seenInvite) {
|
||||||
Log.w(TAG, "updateReminders(" + seenInvite + ")");
|
Log.i(TAG, "updateReminders(" + seenInvite + ")");
|
||||||
|
|
||||||
if (UnauthorizedReminder.isEligible(this)) {
|
if (UnauthorizedReminder.isEligible(this)) {
|
||||||
reminderView.get().showReminder(new UnauthorizedReminder(this));
|
reminderView.get().showReminder(new UnauthorizedReminder(this));
|
||||||
@ -1187,7 +1187,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateDefaultSubscriptionId(Optional<Integer> defaultSubscriptionId) {
|
private void updateDefaultSubscriptionId(Optional<Integer> defaultSubscriptionId) {
|
||||||
Log.w(TAG, "updateDefaultSubscriptionId(" + defaultSubscriptionId.orNull() + ")");
|
Log.i(TAG, "updateDefaultSubscriptionId(" + defaultSubscriptionId.orNull() + ")");
|
||||||
sendButton.setDefaultSubscriptionId(defaultSubscriptionId);
|
sendButton.setDefaultSubscriptionId(defaultSubscriptionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1223,7 +1223,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Recipient recipient : recipients) {
|
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()));
|
identityRecordList.add(identityDatabase.getIdentity(recipient.getAddress()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1238,16 +1238,16 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(@NonNull Pair<IdentityRecordList, String> result) {
|
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);
|
identityRecords.replaceWith(result.first);
|
||||||
|
|
||||||
if (result.second != null) {
|
if (result.second != null) {
|
||||||
Log.w(TAG, "Replacing banner...");
|
Log.d(TAG, "Replacing banner...");
|
||||||
unverifiedBannerView.get().display(result.second, result.first.getUnverifiedRecords(),
|
unverifiedBannerView.get().display(result.second, result.first.getUnverifiedRecords(),
|
||||||
new UnverifiedClickedListener(),
|
new UnverifiedClickedListener(),
|
||||||
new UnverifiedDismissedListener());
|
new UnverifiedDismissedListener());
|
||||||
} else if (unverifiedBannerView.resolved()) {
|
} else if (unverifiedBannerView.resolved()) {
|
||||||
Log.w(TAG, "Clearing banner...");
|
Log.d(TAG, "Clearing banner...");
|
||||||
unverifiedBannerView.get().hide();
|
unverifiedBannerView.get().hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1362,7 +1362,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
private void initializeProfiles() {
|
private void initializeProfiles() {
|
||||||
if (!isSecureText) {
|
if (!isSecureText) {
|
||||||
Log.w(TAG, "SMS contact, no profile fetch needed.");
|
Log.i(TAG, "SMS contact, no profile fetch needed.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1373,9 +1373,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() + ")");
|
Log.i(TAG, "onModified(" + recipient.getAddress().serialize() + ")");
|
||||||
Util.runOnMain(() -> {
|
Util.runOnMain(() -> {
|
||||||
Log.w(TAG, "onModifiedRun(): " + recipient.getRegistered());
|
Log.i(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);
|
||||||
@ -1410,7 +1410,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
//////// Helper Methods
|
//////// Helper Methods
|
||||||
|
|
||||||
private void addAttachment(int type) {
|
private void addAttachment(int type) {
|
||||||
Log.w("ComposeMessageActivity", "Selected: " + type);
|
Log.i(TAG, "Selected: " + type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case AttachmentTypeSelector.ADD_GALLERY:
|
case AttachmentTypeSelector.ADD_GALLERY:
|
||||||
AttachmentManager.selectGallery(this, PICK_GALLERY); break;
|
AttachmentManager.selectGallery(this, PICK_GALLERY); break;
|
||||||
@ -1718,8 +1718,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
long expiresIn = recipient.getExpireMessages() * 1000L;
|
long expiresIn = recipient.getExpireMessages() * 1000L;
|
||||||
boolean initiating = threadId == -1;
|
boolean initiating = threadId == -1;
|
||||||
|
|
||||||
Log.w(TAG, "isManual Selection: " + sendButton.isManualSelection());
|
Log.i(TAG, "isManual Selection: " + sendButton.isManualSelection());
|
||||||
Log.w(TAG, "forceSms: " + forceSms);
|
Log.i(TAG, "forceSms: " + forceSms);
|
||||||
|
|
||||||
if ((recipient.isMmsGroupRecipient() || recipient.getAddress().isEmail()) && !isMmsEnabled) {
|
if ((recipient.isMmsGroupRecipient() || recipient.getAddress().isEmail()) && !isMmsEnabled) {
|
||||||
handleManualMmsRequired();
|
handleManualMmsRequired();
|
||||||
@ -1747,7 +1747,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private void sendMediaMessage(final boolean forceSms, final long expiresIn, final int subscriptionId, boolean initiating)
|
private void sendMediaMessage(final boolean forceSms, final long expiresIn, final int subscriptionId, boolean initiating)
|
||||||
throws InvalidMessageException
|
throws InvalidMessageException
|
||||||
{
|
{
|
||||||
Log.w(TAG, "Sending media message...");
|
Log.i(TAG, "Sending media message...");
|
||||||
sendMediaMessage(forceSms, getMessage(), attachmentManager.buildSlideDeck(), Collections.emptyList(), expiresIn, subscriptionId, initiating);
|
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 {
|
private class UnverifiedClickedListener implements UnverifiedBannerView.ClickListener {
|
||||||
@Override
|
@Override
|
||||||
public void onClicked(final List<IdentityRecord> unverifiedIdentities) {
|
public void onClicked(final List<IdentityRecord> unverifiedIdentities) {
|
||||||
Log.w(TAG, "onClicked: " + unverifiedIdentities.size());
|
Log.i(TAG, "onClicked: " + unverifiedIdentities.size());
|
||||||
if (unverifiedIdentities.size() == 1) {
|
if (unverifiedIdentities.size() == 1) {
|
||||||
Intent intent = new Intent(ConversationActivity.this, VerifyIdentityActivity.class);
|
Intent intent = new Intent(ConversationActivity.this, VerifyIdentityActivity.class);
|
||||||
intent.putExtra(VerifyIdentityActivity.ADDRESS_EXTRA, unverifiedIdentities.get(0).getAddress());
|
intent.putExtra(VerifyIdentityActivity.ADDRESS_EXTRA, unverifiedIdentities.get(0).getAddress());
|
||||||
|
@ -209,7 +209,7 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
|
|||||||
recordToPulseHighlight = null;
|
recordToPulseHighlight = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Bind time: " + (System.currentTimeMillis() - start));
|
Log.d(TAG, "Bind time: " + (System.currentTimeMillis() - start));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -228,7 +228,7 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
itemView.setEventListener(clickListener);
|
itemView.setEventListener(clickListener);
|
||||||
Log.w(TAG, "Inflate time: " + (System.currentTimeMillis() - start));
|
Log.d(TAG, "Inflate time: " + (System.currentTimeMillis() - start));
|
||||||
return new ViewHolder(itemView);
|
return new ViewHolder(itemView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ public class ConversationFragment extends Fragment
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
||||||
Log.w(TAG, "onCreateLoader");
|
Log.i(TAG, "onCreateLoader");
|
||||||
loaderStartTime = System.currentTimeMillis();
|
loaderStartTime = System.currentTimeMillis();
|
||||||
|
|
||||||
int limit = args.getInt(KEY_LIMIT, PARTIAL_CONVERSATION_LIMIT);
|
int limit = args.getInt(KEY_LIMIT, PARTIAL_CONVERSATION_LIMIT);
|
||||||
@ -477,7 +477,7 @@ public class ConversationFragment extends Fragment
|
|||||||
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
|
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
|
||||||
long loadTime = System.currentTimeMillis() - loaderStartTime;
|
long loadTime = System.currentTimeMillis() - loaderStartTime;
|
||||||
int count = cursor.getCount();
|
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;
|
ConversationLoader loader = (ConversationLoader)cursorLoader;
|
||||||
|
|
||||||
ConversationAdapter adapter = getListAdapter();
|
ConversationAdapter adapter = getListAdapter();
|
||||||
|
@ -890,9 +890,9 @@ public class ConversationItem extends LinearLayout
|
|||||||
|
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
} else if (slide.getUri() != null) {
|
} 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());
|
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 intent = new Intent(Intent.ACTION_VIEW);
|
||||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
intent.setDataAndType(PartAuthority.getAttachmentPublicUri(slide.getUri()), slide.getContentType());
|
intent.setDataAndType(PartAuthority.getAttachmentPublicUri(slide.getUri()), slide.getContentType());
|
||||||
|
@ -115,7 +115,7 @@ public class DatabaseUpgradeActivity extends BaseActivity {
|
|||||||
this.masterSecret = KeyCachingService.getMasterSecret(this);
|
this.masterSecret = KeyCachingService.getMasterSecret(this);
|
||||||
|
|
||||||
if (needsUpgradeTask()) {
|
if (needsUpgradeTask()) {
|
||||||
Log.w("DatabaseUpgradeActivity", "Upgrading...");
|
Log.i("DatabaseUpgradeActivity", "Upgrading...");
|
||||||
setContentView(R.layout.database_upgrade_activity);
|
setContentView(R.layout.database_upgrade_activity);
|
||||||
|
|
||||||
ProgressBar indeterminateProgress = findViewById(R.id.indeterminate_progress);
|
ProgressBar indeterminateProgress = findViewById(R.id.indeterminate_progress);
|
||||||
@ -135,13 +135,13 @@ public class DatabaseUpgradeActivity extends BaseActivity {
|
|||||||
int currentVersionCode = Util.getCurrentApkReleaseVersion(this);
|
int currentVersionCode = Util.getCurrentApkReleaseVersion(this);
|
||||||
int lastSeenVersion = VersionTracker.getLastSeenVersion(this);
|
int lastSeenVersion = VersionTracker.getLastSeenVersion(this);
|
||||||
|
|
||||||
Log.w("DatabaseUpgradeActivity", "LastSeenVersion: " + lastSeenVersion);
|
Log.i("DatabaseUpgradeActivity", "LastSeenVersion: " + lastSeenVersion);
|
||||||
|
|
||||||
if (lastSeenVersion >= currentVersionCode)
|
if (lastSeenVersion >= currentVersionCode)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (int version : UPGRADE_VERSIONS) {
|
for (int version : UPGRADE_VERSIONS) {
|
||||||
Log.w("DatabaseUpgradeActivity", "Comparing: " + version);
|
Log.i("DatabaseUpgradeActivity", "Comparing: " + version);
|
||||||
if (lastSeenVersion < version)
|
if (lastSeenVersion < version)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ public class DatabaseUpgradeActivity extends BaseActivity {
|
|||||||
protected Void doInBackground(Integer... params) {
|
protected Void doInBackground(Integer... params) {
|
||||||
Context context = DatabaseUpgradeActivity.this.getApplicationContext();
|
Context context = DatabaseUpgradeActivity.this.getApplicationContext();
|
||||||
|
|
||||||
Log.w("DatabaseUpgradeActivity", "Running background upgrade..");
|
Log.i("DatabaseUpgradeActivity", "Running background upgrade..");
|
||||||
DatabaseFactory.getInstance(DatabaseUpgradeActivity.this)
|
DatabaseFactory.getInstance(DatabaseUpgradeActivity.this)
|
||||||
.onApplicationLevelUpgrade(context, masterSecret, params[0], this);
|
.onApplicationLevelUpgrade(context, masterSecret, params[0], this);
|
||||||
|
|
||||||
@ -314,16 +314,16 @@ public class DatabaseUpgradeActivity extends BaseActivity {
|
|||||||
final MmsDatabase mmsDb = DatabaseFactory.getMmsDatabase(context);
|
final MmsDatabase mmsDb = DatabaseFactory.getMmsDatabase(context);
|
||||||
final List<DatabaseAttachment> pendingAttachments = DatabaseFactory.getAttachmentDatabase(context).getPendingAttachments();
|
final List<DatabaseAttachment> pendingAttachments = DatabaseFactory.getAttachmentDatabase(context).getPendingAttachments();
|
||||||
|
|
||||||
Log.w(TAG, pendingAttachments.size() + " pending parts.");
|
Log.i(TAG, pendingAttachments.size() + " pending parts.");
|
||||||
for (DatabaseAttachment attachment : pendingAttachments) {
|
for (DatabaseAttachment attachment : pendingAttachments) {
|
||||||
final Reader reader = mmsDb.readerFor(mmsDb.getMessage(attachment.getMmsId()));
|
final Reader reader = mmsDb.readerFor(mmsDb.getMessage(attachment.getMmsId()));
|
||||||
final MessageRecord record = reader.getNext();
|
final MessageRecord record = reader.getNext();
|
||||||
|
|
||||||
if (attachment.hasData()) {
|
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);
|
attachmentDb.setTransferState(attachment.getMmsId(), attachment.getAttachmentId(), AttachmentDatabase.TRANSFER_PROGRESS_DONE);
|
||||||
} else if (record != null && !record.isOutgoing() && record.isPush()) {
|
} 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)
|
ApplicationContext.getInstance(context)
|
||||||
.getJobManager()
|
.getJobManager()
|
||||||
.add(new AttachmentDownloadJob(context, attachment.getMmsId(), attachment.getAttachmentId(), false));
|
.add(new AttachmentDownloadJob(context, attachment.getMmsId(), attachment.getAttachmentId(), false));
|
||||||
|
@ -172,7 +172,7 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity {
|
|||||||
public static Optional<ExperienceUpgrade> getExperienceUpgrade(Context context) {
|
public static Optional<ExperienceUpgrade> getExperienceUpgrade(Context context) {
|
||||||
final int currentVersionCode = Util.getCurrentApkReleaseVersion(context);
|
final int currentVersionCode = Util.getCurrentApkReleaseVersion(context);
|
||||||
final int lastSeenVersion = TextSecurePreferences.getLastExperienceVersionCode(context);
|
final int lastSeenVersion = TextSecurePreferences.getLastExperienceVersionCode(context);
|
||||||
Log.w(TAG, "getExperienceUpgrade(" + lastSeenVersion + ")");
|
Log.i(TAG, "getExperienceUpgrade(" + lastSeenVersion + ")");
|
||||||
|
|
||||||
if (lastSeenVersion >= currentVersionCode) {
|
if (lastSeenVersion >= currentVersionCode) {
|
||||||
TextSecurePreferences.setLastExperienceVersionCode(context, currentVersionCode);
|
TextSecurePreferences.setLastExperienceVersionCode(context, currentVersionCode);
|
||||||
|
@ -197,7 +197,7 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Loading Part URI: " + initialMediaUri);
|
Log.i(TAG, "Loading Part URI: " + initialMediaUri);
|
||||||
|
|
||||||
if (conversationRecipient != null) {
|
if (conversationRecipient != null) {
|
||||||
getSupportLoaderManager().restartLoader(0, null, this);
|
getSupportLoaderManager().restartLoader(0, null, this);
|
||||||
|
@ -34,6 +34,8 @@ import org.thoughtcrime.securesms.service.KeyCachingService;
|
|||||||
*/
|
*/
|
||||||
public abstract class PassphraseActivity extends BaseActionBarActivity {
|
public abstract class PassphraseActivity extends BaseActionBarActivity {
|
||||||
|
|
||||||
|
private static final String TAG = PassphraseActivity.class.getSimpleName();
|
||||||
|
|
||||||
private KeyCachingService keyCachingService;
|
private KeyCachingService keyCachingService;
|
||||||
private MasterSecret masterSecret;
|
private MasterSecret masterSecret;
|
||||||
|
|
||||||
@ -62,8 +64,7 @@ public abstract class PassphraseActivity extends BaseActionBarActivity {
|
|||||||
try {
|
try {
|
||||||
startActivity(nextIntent);
|
startActivity(nextIntent);
|
||||||
} catch (java.lang.SecurityException e) {
|
} catch (java.lang.SecurityException e) {
|
||||||
Log.w("PassphraseActivity",
|
Log.w(TAG, "Access permission not passed from PassphraseActivity, retry sharing.");
|
||||||
"Access permission not passed from PassphraseActivity, retry sharing.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
|
@ -88,7 +88,7 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
Log.w(TAG, "onCreate()");
|
Log.i(TAG, "onCreate()");
|
||||||
dynamicTheme.onCreate(this);
|
dynamicTheme.onCreate(this);
|
||||||
dynamicLanguage.onCreate(this);
|
dynamicLanguage.onCreate(this);
|
||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
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()) {
|
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();
|
fingerprintCancellationSignal = new CancellationSignal();
|
||||||
fingerprintManager.authenticate(null, 0, fingerprintCancellationSignal, fingerprintListener, null);
|
fingerprintManager.authenticate(null, 0, fingerprintCancellationSignal, fingerprintListener, null);
|
||||||
} else if (Build.VERSION.SDK_INT >= 21){
|
} else if (Build.VERSION.SDK_INT >= 21){
|
||||||
Log.w(TAG, "firing intent...");
|
Log.i(TAG, "firing intent...");
|
||||||
Intent intent = keyguardManager.createConfirmDeviceCredentialIntent("Unlock Signal", "");
|
Intent intent = keyguardManager.createConfirmDeviceCredentialIntent("Unlock Signal", "");
|
||||||
startActivityForResult(intent, 1);
|
startActivityForResult(intent, 1);
|
||||||
} else {
|
} else {
|
||||||
@ -345,7 +345,7 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAuthenticationSucceeded(FingerprintManagerCompat.AuthenticationResult result) {
|
public void onAuthenticationSucceeded(FingerprintManagerCompat.AuthenticationResult result) {
|
||||||
Log.w(TAG, "onAuthenticationSucceeded");
|
Log.i(TAG, "onAuthenticationSucceeded");
|
||||||
fingerprintPrompt.setImageResource(R.drawable.ic_check_white_48dp);
|
fingerprintPrompt.setImageResource(R.drawable.ic_check_white_48dp);
|
||||||
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.green_500), PorterDuff.Mode.SRC_IN);
|
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() {
|
fingerprintPrompt.animate().setInterpolator(new BounceInterpolator()).scaleX(1.1f).scaleY(1.1f).setDuration(500).setListener(new AnimationCompleteListener() {
|
||||||
|
@ -38,7 +38,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected final void onCreate(Bundle savedInstanceState) {
|
protected final void onCreate(Bundle savedInstanceState) {
|
||||||
Log.w(TAG, "onCreate(" + savedInstanceState + ")");
|
Log.i(TAG, "onCreate(" + savedInstanceState + ")");
|
||||||
this.networkAccess = new SignalServiceNetworkAccess(this);
|
this.networkAccess = new SignalServiceNetworkAccess(this);
|
||||||
onPreCreate();
|
onPreCreate();
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
Log.w(TAG, "onResume()");
|
Log.i(TAG, "onResume()");
|
||||||
super.onResume();
|
super.onResume();
|
||||||
KeyCachingService.registerPassphraseActivityStarted(this);
|
KeyCachingService.registerPassphraseActivityStarted(this);
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
Log.w(TAG, "onPause()");
|
Log.i(TAG, "onPause()");
|
||||||
super.onPause();
|
super.onPause();
|
||||||
KeyCachingService.registerPassphraseActivityStopped(this);
|
KeyCachingService.registerPassphraseActivityStopped(this);
|
||||||
|
|
||||||
@ -81,14 +81,14 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
Log.w(TAG, "onDestroy()");
|
Log.i(TAG, "onDestroy()");
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
removeClearKeyReceiver(this);
|
removeClearKeyReceiver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMasterSecretCleared() {
|
public void onMasterSecretCleared() {
|
||||||
Log.w(TAG, "onMasterSecretCleared()");
|
Log.i(TAG, "onMasterSecretCleared()");
|
||||||
if (isVisible) routeApplicationState(true);
|
if (isVisible) routeApplicationState(true);
|
||||||
else finish();
|
else finish();
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Intent getIntentForState(int state) {
|
private Intent getIntentForState(int state) {
|
||||||
Log.w(TAG, "routeApplicationState(), state: " + state);
|
Log.i(TAG, "routeApplicationState(), state: " + state);
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case STATE_CREATE_PASSPHRASE: return getCreatePassphraseIntent();
|
case STATE_CREATE_PASSPHRASE: return getCreatePassphraseIntent();
|
||||||
@ -200,11 +200,11 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initializeClearKeyReceiver() {
|
private void initializeClearKeyReceiver() {
|
||||||
Log.w(TAG, "initializeClearKeyReceiver()");
|
Log.i(TAG, "initializeClearKeyReceiver()");
|
||||||
this.clearKeyReceiver = new BroadcastReceiver() {
|
this.clearKeyReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
Log.w(TAG, "onReceive() for clear key event");
|
Log.i(TAG, "onReceive() for clear key event");
|
||||||
onMasterSecretCleared();
|
onMasterSecretCleared();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -247,7 +247,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle icicle) {
|
public void onCreate(Bundle icicle) {
|
||||||
Log.w(TAG, "onCreate (fragment)");
|
Log.i(TAG, "onCreate (fragment)");
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
|
|
||||||
initializeRecipients();
|
initializeRecipients();
|
||||||
@ -279,7 +279,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) {
|
public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) {
|
||||||
Log.w(TAG, "onCreatePreferences...");
|
Log.i(TAG, "onCreatePreferences...");
|
||||||
addPreferencesFromResource(R.xml.recipient_preferences);
|
addPreferencesFromResource(R.xml.recipient_preferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,7 +591,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
|||||||
private final IdentityRecord identityKey;
|
private final IdentityRecord identityKey;
|
||||||
|
|
||||||
private IdentityClickedListener(IdentityRecord identityKey) {
|
private IdentityClickedListener(IdentityRecord identityKey) {
|
||||||
Log.w(TAG, "Identity record: " + identityKey);
|
Log.i(TAG, "Identity record: " + identityKey);
|
||||||
this.identityKey = identityKey;
|
this.identityKey = identityKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1006,7 +1006,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
|||||||
private class ChallengeReceiver extends BroadcastReceiver {
|
private class ChallengeReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
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));
|
handleChallengeReceived(intent.getStringExtra(CHALLENGE_EXTRA));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
Log.w(TAG, "onNewIntent()");
|
Log.i(TAG, "onNewIntent()");
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
setIntent(intent);
|
setIntent(intent);
|
||||||
initializeMedia();
|
initializeMedia();
|
||||||
@ -118,7 +118,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
Log.w(TAG, "onResume()");
|
Log.i(TAG, "onResume()");
|
||||||
super.onResume();
|
super.onResume();
|
||||||
dynamicTheme.onResume(this);
|
dynamicTheme.onResume(this);
|
||||||
dynamicLanguage.onResume(this);
|
dynamicLanguage.onResume(this);
|
||||||
|
@ -592,7 +592,7 @@ public class VerifyIdentityActivity extends PassphraseRequiredActionBarActivity
|
|||||||
protected Void doInBackground(Recipient... params) {
|
protected Void doInBackground(Recipient... params) {
|
||||||
synchronized (SESSION_LOCK) {
|
synchronized (SESSION_LOCK) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
Log.w(TAG, "Saving identity: " + params[0].getAddress());
|
Log.i(TAG, "Saving identity: " + params[0].getAddress());
|
||||||
DatabaseFactory.getIdentityDatabase(getActivity())
|
DatabaseFactory.getIdentityDatabase(getActivity())
|
||||||
.saveIdentity(params[0].getAddress(),
|
.saveIdentity(params[0].getAddress(),
|
||||||
remoteIdentity,
|
remoteIdentity,
|
||||||
|
@ -70,7 +70,7 @@ public class WebRtcCallActivity extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
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_SHOW_WHEN_LOCKED);
|
||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -86,7 +86,7 @@ public class WebRtcCallActivity extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
Log.w(TAG, "onResume()");
|
Log.i(TAG, "onResume()");
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if (!networkAccess.isCensored(this)) MessageRetrievalService.registerActivityStarted(this);
|
if (!networkAccess.isCensored(this)) MessageRetrievalService.registerActivityStarted(this);
|
||||||
initializeScreenshotSecurity();
|
initializeScreenshotSecurity();
|
||||||
@ -95,7 +95,7 @@ public class WebRtcCallActivity extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNewIntent(Intent intent){
|
public void onNewIntent(Intent intent){
|
||||||
Log.w(TAG, "onNewIntent");
|
Log.i(TAG, "onNewIntent");
|
||||||
if (ANSWER_ACTION.equals(intent.getAction())) {
|
if (ANSWER_ACTION.equals(intent.getAction())) {
|
||||||
handleAnswerCall();
|
handleAnswerCall();
|
||||||
} else if (DENY_ACTION.equals(intent.getAction())) {
|
} else if (DENY_ACTION.equals(intent.getAction())) {
|
||||||
@ -107,7 +107,7 @@ public class WebRtcCallActivity extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
Log.w(TAG, "onPause");
|
Log.i(TAG, "onPause");
|
||||||
super.onPause();
|
super.onPause();
|
||||||
if (!networkAccess.isCensored(this)) MessageRetrievalService.registerActivityStopped(this);
|
if (!networkAccess.isCensored(this)) MessageRetrievalService.registerActivityStopped(this);
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
@ -202,7 +202,7 @@ public class WebRtcCallActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleEndCall() {
|
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 intent = new Intent(WebRtcCallActivity.this, WebRtcCallService.class);
|
||||||
intent.setAction(WebRtcCallService.ACTION_LOCAL_HANGUP);
|
intent.setAction(WebRtcCallService.ACTION_LOCAL_HANGUP);
|
||||||
startService(intent);
|
startService(intent);
|
||||||
@ -217,7 +217,7 @@ public class WebRtcCallActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleTerminate(@NonNull Recipient recipient /*, int terminationType */) {
|
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));
|
callScreen.setActiveCall(recipient, getString(R.string.RedPhone_ending_call));
|
||||||
EventBus.getDefault().removeStickyEvent(WebRtcViewModel.class);
|
EventBus.getDefault().removeStickyEvent(WebRtcViewModel.class);
|
||||||
@ -314,7 +314,7 @@ public class WebRtcCallActivity extends Activity {
|
|||||||
|
|
||||||
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
|
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
|
||||||
public void onEventMainThread(final WebRtcViewModel event) {
|
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()) {
|
switch (event.getState()) {
|
||||||
case CALL_CONNECTED: handleCallConnected(event); break;
|
case CALL_CONNECTED: handleCallConnected(event); break;
|
||||||
|
@ -276,15 +276,13 @@ public class AttachmentServer implements Runnable {
|
|||||||
return;
|
return;
|
||||||
StringTokenizer st = new StringTokenizer(inLine);
|
StringTokenizer st = new StringTokenizer(inLine);
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
Log.e(TAG,
|
Log.e(TAG, "BAD REQUEST: Syntax error. Usage: GET /example/file.html");
|
||||||
"BAD REQUEST: Syntax error. Usage: GET /example/file.html");
|
|
||||||
|
|
||||||
String method = st.nextToken();
|
String method = st.nextToken();
|
||||||
pre.put("method", method);
|
pre.put("method", method);
|
||||||
|
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
Log.e(TAG,
|
Log.e(TAG, "BAD REQUEST: Missing URI. Usage: GET /example/file.html");
|
||||||
"BAD REQUEST: Missing URI. Usage: GET /example/file.html");
|
|
||||||
|
|
||||||
String uri = st.nextToken();
|
String uri = st.nextToken();
|
||||||
|
|
||||||
@ -313,8 +311,7 @@ public class AttachmentServer implements Runnable {
|
|||||||
|
|
||||||
pre.put("uri", uri);
|
pre.put("uri", uri);
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
Log.e(TAG,
|
Log.e(TAG, "SERVER INTERNAL ERROR: IOException: " + ioe.getMessage());
|
||||||
"SERVER INTERNAL ERROR: IOException: " + ioe.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ public class AudioRecorder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void startRecording() {
|
public void startRecording() {
|
||||||
Log.w(TAG, "startRecording()");
|
Log.i(TAG, "startRecording()");
|
||||||
|
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
Log.w(TAG, "Running startRecording() + " + Thread.currentThread().getId());
|
Log.i(TAG, "Running startRecording() + " + Thread.currentThread().getId());
|
||||||
try {
|
try {
|
||||||
if (audioCodec != null) {
|
if (audioCodec != null) {
|
||||||
throw new AssertionError("We can only record once at a time.");
|
throw new AssertionError("We can only record once at a time.");
|
||||||
@ -61,7 +61,7 @@ public class AudioRecorder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull ListenableFuture<Pair<Uri, Long>> stopRecording() {
|
public @NonNull ListenableFuture<Pair<Uri, Long>> stopRecording() {
|
||||||
Log.w(TAG, "stopRecording()");
|
Log.i(TAG, "stopRecording()");
|
||||||
|
|
||||||
final SettableFuture<Pair<Uri, Long>> future = new SettableFuture<>();
|
final SettableFuture<Pair<Uri, Long>> future = new SettableFuture<>();
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ public class AudioSlidePlayer implements SensorEventListener {
|
|||||||
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPrepared(MediaPlayer mp) {
|
public void onPrepared(MediaPlayer mp) {
|
||||||
Log.w(TAG, "onPrepared");
|
Log.i(TAG, "onPrepared");
|
||||||
synchronized (AudioSlidePlayer.this) {
|
synchronized (AudioSlidePlayer.this) {
|
||||||
if (mediaPlayer == null) return;
|
if (mediaPlayer == null) return;
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ public class AudioSlidePlayer implements SensorEventListener {
|
|||||||
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCompletion(MediaPlayer mp) {
|
public void onCompletion(MediaPlayer mp) {
|
||||||
Log.w(TAG, "onComplete");
|
Log.i(TAG, "onComplete");
|
||||||
synchronized (AudioSlidePlayer.this) {
|
synchronized (AudioSlidePlayer.this) {
|
||||||
mediaPlayer = null;
|
mediaPlayer = null;
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ public class AudioSlidePlayer implements SensorEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void stop() {
|
public synchronized void stop() {
|
||||||
Log.w(TAG, "Stop called!");
|
Log.i(TAG, "Stop called!");
|
||||||
|
|
||||||
removePlaying(this);
|
removePlaying(this);
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
try {
|
try {
|
||||||
Log.w(TAG, "playbutton onClick");
|
Log.d(TAG, "playbutton onClick");
|
||||||
if (audioSlidePlayer != null) {
|
if (audioSlidePlayer != null) {
|
||||||
togglePlayToPause();
|
togglePlayToPause();
|
||||||
audioSlidePlayer.play(getProgress());
|
audioSlidePlayer.play(getProgress());
|
||||||
@ -272,7 +272,7 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener
|
|||||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Log.w(TAG, "pausebutton onClick");
|
Log.d(TAG, "pausebutton onClick");
|
||||||
if (audioSlidePlayer != null) {
|
if (audioSlidePlayer != null) {
|
||||||
togglePauseToPlay();
|
togglePauseToPlay();
|
||||||
audioSlidePlayer.stop();
|
audioSlidePlayer.stop();
|
||||||
|
@ -122,7 +122,7 @@ public class CustomDefaultPreference extends DialogPreference {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onBindDialogView(@NonNull View view) {
|
protected void onBindDialogView(@NonNull View view) {
|
||||||
Log.w(TAG, "onBindDialogView");
|
Log.i(TAG, "onBindDialogView");
|
||||||
super.onBindDialogView(view);
|
super.onBindDialogView(view);
|
||||||
|
|
||||||
CustomDefaultPreference preference = (CustomDefaultPreference)getPreference();
|
CustomDefaultPreference preference = (CustomDefaultPreference)getPreference();
|
||||||
|
@ -164,7 +164,7 @@ public class InputPanel extends LinearLayout
|
|||||||
long elapsedTime = onRecordHideEvent(x);
|
long elapsedTime = onRecordHideEvent(x);
|
||||||
|
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
Log.w(TAG, "Elapsed time: " + elapsedTime);
|
Log.d(TAG, "Elapsed time: " + elapsedTime);
|
||||||
if (elapsedTime > 1000) {
|
if (elapsedTime > 1000) {
|
||||||
listener.onRecorderFinished();
|
listener.onRecorderFinished();
|
||||||
} else {
|
} else {
|
||||||
|
@ -86,7 +86,7 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat {
|
|||||||
int oldRotation = rotation;
|
int oldRotation = rotation;
|
||||||
rotation = getDeviceRotation();
|
rotation = getDeviceRotation();
|
||||||
if (oldRotation != rotation) {
|
if (oldRotation != rotation) {
|
||||||
Log.w(TAG, "rotation changed");
|
Log.i(TAG, "rotation changed");
|
||||||
onKeyboardClose();
|
onKeyboardClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,14 +132,14 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void onKeyboardOpen(int keyboardHeight) {
|
protected void onKeyboardOpen(int keyboardHeight) {
|
||||||
Log.w(TAG, "onKeyboardOpen(" + keyboardHeight + ")");
|
Log.i(TAG, "onKeyboardOpen(" + keyboardHeight + ")");
|
||||||
keyboardOpen = true;
|
keyboardOpen = true;
|
||||||
|
|
||||||
notifyShownListeners();
|
notifyShownListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onKeyboardClose() {
|
protected void onKeyboardClose() {
|
||||||
Log.w(TAG, "onKeyboardClose()");
|
Log.i(TAG, "onKeyboardClose()");
|
||||||
keyboardOpen = false;
|
keyboardOpen = false;
|
||||||
notifyHiddenListeners();
|
notifyHiddenListeners();
|
||||||
}
|
}
|
||||||
|
@ -249,19 +249,19 @@ public class ThumbnailView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Util.equals(slide, this.slide)) {
|
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);
|
return new SettableFuture<>(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.slide != null && this.slide.getFastPreflightId() != null &&
|
if (this.slide != null && this.slide.getFastPreflightId() != null &&
|
||||||
this.slide.getFastPreflightId().equals(slide.getFastPreflightId()))
|
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;
|
this.slide = slide;
|
||||||
return new SettableFuture<>(false);
|
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: " +
|
+ ", progress " + slide.getTransferState() + ", fast preflight id: " +
|
||||||
slide.asAttachment().getFastPreflightId());
|
slide.asAttachment().getFastPreflightId());
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public class ZoomingImageView extends FrameLayout {
|
|||||||
final Context context = getContext();
|
final Context context = getContext();
|
||||||
final int maxTextureSize = BitmapUtil.getMaxTextureSize();
|
final int maxTextureSize = BitmapUtil.getMaxTextureSize();
|
||||||
|
|
||||||
Log.w(TAG, "Max texture size: " + maxTextureSize);
|
Log.i(TAG, "Max texture size: " + maxTextureSize);
|
||||||
|
|
||||||
new AsyncTask<Void, Void, Pair<Integer, Integer>>() {
|
new AsyncTask<Void, Void, Pair<Integer, Integer>>() {
|
||||||
@Override
|
@Override
|
||||||
@ -82,13 +82,13 @@ public class ZoomingImageView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void onPostExecute(@Nullable Pair<Integer, Integer> dimensions) {
|
protected void onPostExecute(@Nullable Pair<Integer, Integer> 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)) {
|
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);
|
setImageViewUri(glideRequests, uri);
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "Loading in subsampling image view...");
|
Log.i(TAG, "Loading in subsampling image view...");
|
||||||
setSubsamplingImageViewUri(uri);
|
setSubsamplingImageViewUri(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class CameraUtils {
|
|||||||
final int targetHeight = displayOrientation % 180 == 90 ? width : height;
|
final int targetHeight = displayOrientation % 180 == 90 ? width : height;
|
||||||
final double targetRatio = (double) targetWidth / targetHeight;
|
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,
|
displayOrientation, width, height,
|
||||||
targetWidth, targetHeight, targetRatio));
|
targetWidth, targetHeight, targetRatio));
|
||||||
|
|
||||||
@ -39,14 +39,14 @@ public class CameraUtils {
|
|||||||
List<Size> bigEnough = new LinkedList<>();
|
List<Size> bigEnough = new LinkedList<>();
|
||||||
|
|
||||||
for (Size size : sizes) {
|
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) {
|
if (size.height == size.width * targetRatio && size.height >= targetHeight && size.width >= targetWidth) {
|
||||||
ideals.add(size);
|
ideals.add(size);
|
||||||
Log.w(TAG, " (ideal ratio)");
|
Log.d(TAG, " (ideal ratio)");
|
||||||
} else if (size.width >= targetWidth && size.height >= targetHeight) {
|
} else if (size.width >= targetWidth && size.height >= targetHeight) {
|
||||||
bigEnough.add(size);
|
bigEnough.add(size);
|
||||||
Log.w(TAG, " (good size, suboptimal ratio)");
|
Log.d(TAG, " (good size, suboptimal ratio)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ public class CameraView extends ViewGroup {
|
|||||||
public void onResume() {
|
public void onResume() {
|
||||||
if (state != State.PAUSED) return;
|
if (state != State.PAUSED) return;
|
||||||
state = State.RESUMED;
|
state = State.RESUMED;
|
||||||
Log.w(TAG, "onResume() queued");
|
Log.i(TAG, "onResume() queued");
|
||||||
enqueueTask(new SerialAsyncTask<Void>() {
|
enqueueTask(new SerialAsyncTask<Void>() {
|
||||||
@Override
|
@Override
|
||||||
protected
|
protected
|
||||||
@ -106,7 +106,7 @@ public class CameraView extends ViewGroup {
|
|||||||
try {
|
try {
|
||||||
long openStartMillis = System.currentTimeMillis();
|
long openStartMillis = System.currentTimeMillis();
|
||||||
camera = Optional.fromNullable(Camera.open(cameraId));
|
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) {
|
synchronized (CameraView.this) {
|
||||||
CameraView.this.notifyAll();
|
CameraView.this.notifyAll();
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ public class CameraView extends ViewGroup {
|
|||||||
if (getActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
|
if (getActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
|
||||||
onOrientationChange.enable();
|
onOrientationChange.enable();
|
||||||
}
|
}
|
||||||
Log.w(TAG, "onResume() completed");
|
Log.i(TAG, "onResume() completed");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ public class CameraView extends ViewGroup {
|
|||||||
public void onPause() {
|
public void onPause() {
|
||||||
if (state == State.PAUSED) return;
|
if (state == State.PAUSED) return;
|
||||||
state = State.PAUSED;
|
state = State.PAUSED;
|
||||||
Log.w(TAG, "onPause() queued");
|
Log.i(TAG, "onPause() queued");
|
||||||
|
|
||||||
enqueueTask(new SerialAsyncTask<Void>() {
|
enqueueTask(new SerialAsyncTask<Void>() {
|
||||||
private Optional<Camera> cameraToDestroy;
|
private Optional<Camera> cameraToDestroy;
|
||||||
@ -170,7 +170,7 @@ public class CameraView extends ViewGroup {
|
|||||||
outputOrientation = -1;
|
outputOrientation = -1;
|
||||||
removeView(surface);
|
removeView(surface);
|
||||||
addView(surface);
|
addView(surface);
|
||||||
Log.w(TAG, "onPause() completed");
|
Log.i(TAG, "onPause() completed");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ public class CameraView extends ViewGroup {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
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);
|
super.onSizeChanged(w, h, oldw, oldh);
|
||||||
if (camera.isPresent()) startPreview(camera.get().getParameters());
|
if (camera.isPresent()) startPreview(camera.get().getParameters());
|
||||||
}
|
}
|
||||||
@ -310,7 +310,7 @@ public class CameraView extends ViewGroup {
|
|||||||
final Size preferredPreviewSize = getPreferredPreviewSize(parameters);
|
final Size preferredPreviewSize = getPreferredPreviewSize(parameters);
|
||||||
|
|
||||||
if (preferredPreviewSize != null && !parameters.getPreviewSize().equals(preferredPreviewSize)) {
|
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();
|
if (state == State.ACTIVE) stopPreview();
|
||||||
previewSize = preferredPreviewSize;
|
previewSize = preferredPreviewSize;
|
||||||
parameters.setPreviewSize(preferredPreviewSize.width, preferredPreviewSize.height);
|
parameters.setPreviewSize(preferredPreviewSize.width, preferredPreviewSize.height);
|
||||||
@ -320,7 +320,7 @@ public class CameraView extends ViewGroup {
|
|||||||
}
|
}
|
||||||
long previewStartMillis = System.currentTimeMillis();
|
long previewStartMillis = System.currentTimeMillis();
|
||||||
camera.startPreview();
|
camera.startPreview();
|
||||||
Log.w(TAG, "camera.startPreview() -> " + (System.currentTimeMillis() - previewStartMillis) + "ms");
|
Log.i(TAG, "camera.startPreview() -> " + (System.currentTimeMillis() - previewStartMillis) + "ms");
|
||||||
state = State.ACTIVE;
|
state = State.ACTIVE;
|
||||||
Util.runOnMain(new Runnable() {
|
Util.runOnMain(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -445,11 +445,11 @@ public class CameraView extends ViewGroup {
|
|||||||
final Size previewSize = camera.getParameters().getPreviewSize();
|
final Size previewSize = camera.getParameters().getPreviewSize();
|
||||||
final Rect croppingRect = getCroppedRect(previewSize, previewRect, rotation);
|
final Rect croppingRect = getCroppedRect(previewSize, previewRect, rotation);
|
||||||
|
|
||||||
Log.w(TAG, "previewSize: " + previewSize.width + "x" + previewSize.height);
|
Log.i(TAG, "previewSize: " + previewSize.width + "x" + previewSize.height);
|
||||||
Log.w(TAG, "data bytes: " + data.length);
|
Log.i(TAG, "data bytes: " + data.length);
|
||||||
Log.w(TAG, "previewFormat: " + camera.getParameters().getPreviewFormat());
|
Log.i(TAG, "previewFormat: " + camera.getParameters().getPreviewFormat());
|
||||||
Log.w(TAG, "croppingRect: " + croppingRect.toString());
|
Log.i(TAG, "croppingRect: " + croppingRect.toString());
|
||||||
Log.w(TAG, "rotation: " + rotation);
|
Log.i(TAG, "rotation: " + rotation);
|
||||||
new CaptureTask(previewSize, rotation, croppingRect).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, data);
|
new CaptureTask(previewSize, rotation, croppingRect).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -536,7 +536,7 @@ public class CameraView extends ViewGroup {
|
|||||||
throw new PreconditionsNotMetException();
|
throw new PreconditionsNotMetException();
|
||||||
}
|
}
|
||||||
while (getMeasuredHeight() <= 0 || getMeasuredWidth() <= 0 || !surface.isReady()) {
|
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);
|
Util.wait(CameraView.this, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class QuickAttachmentDrawer extends ViewGroup implements InputView, Camer
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateControlsView() {
|
private void updateControlsView() {
|
||||||
Log.w(TAG, "updateControlsView()");
|
Log.i(TAG, "updateControlsView()");
|
||||||
View controls = LayoutInflater.from(getContext()).inflate(isLandscape() ? R.layout.quick_camera_controls_land
|
View controls = LayoutInflater.from(getContext()).inflate(isLandscape() ? R.layout.quick_camera_controls_land
|
||||||
: R.layout.quick_camera_controls,
|
: R.layout.quick_camera_controls,
|
||||||
this, false);
|
this, false);
|
||||||
|
@ -28,6 +28,9 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class EmojiDrawer extends LinearLayout implements InputView {
|
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 static final KeyEvent DELETE_KEY_EVENT = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL);
|
||||||
|
|
||||||
private ViewPager pager;
|
private ViewPager pager;
|
||||||
@ -62,7 +65,7 @@ public class EmojiDrawer extends LinearLayout implements InputView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initializeResources(View v) {
|
private void initializeResources(View v) {
|
||||||
Log.w("EmojiDrawer", "initializeResources()");
|
Log.i(TAG, "initializeResources()");
|
||||||
this.pager = (ViewPager) v.findViewById(R.id.emoji_pager);
|
this.pager = (ViewPager) v.findViewById(R.id.emoji_pager);
|
||||||
this.strip = (PagerSlidingTabStrip) v.findViewById(R.id.tabs);
|
this.strip = (PagerSlidingTabStrip) v.findViewById(R.id.tabs);
|
||||||
|
|
||||||
@ -85,7 +88,7 @@ public class EmojiDrawer extends LinearLayout implements InputView {
|
|||||||
if (this.pager == null) initView();
|
if (this.pager == null) initView();
|
||||||
ViewGroup.LayoutParams params = getLayoutParams();
|
ViewGroup.LayoutParams params = getLayoutParams();
|
||||||
params.height = height;
|
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);
|
setLayoutParams(params);
|
||||||
setVisibility(VISIBLE);
|
setVisibility(VISIBLE);
|
||||||
if (drawerListener != null) drawerListener.onShown();
|
if (drawerListener != null) drawerListener.onShown();
|
||||||
@ -95,7 +98,7 @@ public class EmojiDrawer extends LinearLayout implements InputView {
|
|||||||
public void hide(boolean immediate) {
|
public void hide(boolean immediate) {
|
||||||
setVisibility(GONE);
|
setVisibility(GONE);
|
||||||
if (drawerListener != null) drawerListener.onHidden();
|
if (drawerListener != null) drawerListener.onHidden();
|
||||||
Log.w("EmojiDrawer", "hide()");
|
Log.i(TAG, "hide()");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeEmojiGrid() {
|
private void initializeEmojiGrid() {
|
||||||
@ -104,7 +107,7 @@ public class EmojiDrawer extends LinearLayout implements InputView {
|
|||||||
new EmojiSelectionListener() {
|
new EmojiSelectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onEmojiSelected(String emoji) {
|
public void onEmojiSelected(String emoji) {
|
||||||
Log.w("EmojiDrawer", "onEmojiSelected()");
|
Log.i(TAG, "onEmojiSelected()");
|
||||||
recentModel.onCodePointSelected(emoji);
|
recentModel.onCodePointSelected(emoji);
|
||||||
if (listener != null) listener.onEmojiSelected(emoji);
|
if (listener != null) listener.onEmojiSelected(emoji);
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ public class RecentEmojiPageModel implements EmojiPageModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onCodePointSelected(String emoji) {
|
public void onCodePointSelected(String emoji) {
|
||||||
Log.w(TAG, "onCodePointSelected(" + emoji + ")");
|
Log.i(TAG, "onCodePointSelected(" + emoji + ")");
|
||||||
recentlyUsed.remove(emoji);
|
recentlyUsed.remove(emoji);
|
||||||
recentlyUsed.add(emoji);
|
recentlyUsed.add(emoji);
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class EmojiPageBitmap {
|
|||||||
} else {
|
} else {
|
||||||
Callable<Bitmap> callable = () -> {
|
Callable<Bitmap> callable = () -> {
|
||||||
try {
|
try {
|
||||||
Log.w(TAG, "loading page " + model.getSprite());
|
Log.i(TAG, "loading page " + model.getSprite());
|
||||||
return loadPage();
|
return loadPage();
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
Log.w(TAG, 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);
|
Bitmap scaledBitmap = Bitmap.createScaledBitmap(originalBitmap, (int)(originalBitmap.getWidth() * decodeScale), (int)(originalBitmap.getHeight() * decodeScale), false);
|
||||||
|
|
||||||
bitmapReference = new SoftReference<>(scaledBitmap);
|
bitmapReference = new SoftReference<>(scaledBitmap);
|
||||||
Log.w(TAG, "onPageLoaded(" + model.getSprite() + ")");
|
Log.i(TAG, "onPageLoaded(" + model.getSprite() + ")");
|
||||||
return scaledBitmap;
|
return scaledBitmap;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
|
@ -68,7 +68,7 @@ public class UnverifiedBannerView extends LinearLayout {
|
|||||||
this.container.setOnClickListener(new OnClickListener() {
|
this.container.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Log.w(TAG, "onClick()");
|
Log.i(TAG, "onClick()");
|
||||||
clickListener.onClicked(unverifiedIdentities);
|
clickListener.onClicked(unverifiedIdentities);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -27,7 +27,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Point init(Context context, Uri uri) throws Exception {
|
public Point init(Context context, Uri uri) throws Exception {
|
||||||
Log.w(TAG, "Init!");
|
Log.d(TAG, "Init!");
|
||||||
if (!PartAuthority.isLocalUri(uri)) {
|
if (!PartAuthority.isLocalUri(uri)) {
|
||||||
passthrough = new SkiaImageRegionDecoder();
|
passthrough = new SkiaImageRegionDecoder();
|
||||||
return passthrough.init(context, uri);
|
return passthrough.init(context, uri);
|
||||||
@ -43,7 +43,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bitmap decodeRegion(Rect rect, int sampleSize) {
|
public Bitmap decodeRegion(Rect rect, int sampleSize) {
|
||||||
Log.w(TAG, "Decode region: " + rect);
|
Log.d(TAG, "Decode region: " + rect);
|
||||||
|
|
||||||
if (passthrough != null) {
|
if (passthrough != null) {
|
||||||
return passthrough.decodeRegion(rect, sampleSize);
|
return passthrough.decodeRegion(rect, sampleSize);
|
||||||
@ -65,7 +65,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isReady() {
|
public boolean isReady() {
|
||||||
Log.w(TAG, "isReady");
|
Log.d(TAG, "isReady");
|
||||||
return (passthrough != null && passthrough.isReady()) ||
|
return (passthrough != null && passthrough.isReady()) ||
|
||||||
(bitmapRegionDecoder != null && !bitmapRegionDecoder.isRecycled());
|
(bitmapRegionDecoder != null && !bitmapRegionDecoder.isRecycled());
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ public class ContactsCursorLoader extends CursorLoader {
|
|||||||
ContactsDatabase.NORMAL_TYPE});
|
ContactsDatabase.NORMAL_TYPE});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.w(TAG, "filterNonPushContacts() -> " + (System.currentTimeMillis() - startMillis) + "ms");
|
Log.i(TAG, "filterNonPushContacts() -> " + (System.currentTimeMillis() - startMillis) + "ms");
|
||||||
return matrix;
|
return matrix;
|
||||||
} finally {
|
} finally {
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
@ -89,7 +89,7 @@ public class ContactsDatabase {
|
|||||||
try (Cursor cursor = context.getContentResolver().query(currentContactsUri, projection, RawContacts.DELETED + " = ?", new String[] {"1"}, null)) {
|
try (Cursor cursor = context.getContentResolver().query(currentContactsUri, projection, RawContacts.DELETED + " = ?", new String[] {"1"}, null)) {
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
long rawContactId = cursor.getLong(0);
|
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)});
|
context.getContentResolver().delete(currentContactsUri, RawContacts._ID + " = ?", new String[] {String.valueOf(rawContactId)});
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ public class ContactsDatabase {
|
|||||||
Optional<SystemContactInfo> systemContactInfo = getSystemContactInfo(registeredAddress);
|
Optional<SystemContactInfo> systemContactInfo = getSystemContactInfo(registeredAddress);
|
||||||
|
|
||||||
if (systemContactInfo.isPresent()) {
|
if (systemContactInfo.isPresent()) {
|
||||||
Log.w(TAG, "Adding number: " + registeredAddress);
|
Log.i(TAG, "Adding number: " + registeredAddress);
|
||||||
addTextSecureRawContact(operations, account, systemContactInfo.get().number,
|
addTextSecureRawContact(operations, account, systemContactInfo.get().number,
|
||||||
systemContactInfo.get().name, systemContactInfo.get().id);
|
systemContactInfo.get().name, systemContactInfo.get().id);
|
||||||
}
|
}
|
||||||
@ -122,16 +122,16 @@ public class ContactsDatabase {
|
|||||||
for (Map.Entry<Address, SignalContact> currentContactEntry : currentContacts.entrySet()) {
|
for (Map.Entry<Address, SignalContact> currentContactEntry : currentContacts.entrySet()) {
|
||||||
if (!registeredAddressSet.contains(currentContactEntry.getKey())) {
|
if (!registeredAddressSet.contains(currentContactEntry.getKey())) {
|
||||||
if (remove) {
|
if (remove) {
|
||||||
Log.w(TAG, "Removing number: " + currentContactEntry.getKey());
|
Log.i(TAG, "Removing number: " + currentContactEntry.getKey());
|
||||||
removeTextSecureRawContact(operations, account, currentContactEntry.getValue().getId());
|
removeTextSecureRawContact(operations, account, currentContactEntry.getValue().getId());
|
||||||
}
|
}
|
||||||
} else if (!currentContactEntry.getValue().isVoiceSupported()) {
|
} 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());
|
addContactVoiceSupport(operations, currentContactEntry.getKey(), currentContactEntry.getValue().getId());
|
||||||
} else if (!Util.isStringEquals(currentContactEntry.getValue().getRawDisplayName(),
|
} else if (!Util.isStringEquals(currentContactEntry.getValue().getRawDisplayName(),
|
||||||
currentContactEntry.getValue().getAggregateDisplayName()))
|
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());
|
updateDisplayName(operations, currentContactEntry.getValue().getAggregateDisplayName(), currentContactEntry.getValue().getId(), currentContactEntry.getValue().getDisplayNameSource());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class ContactsSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||||||
public void onPerformSync(Account account, Bundle extras, String authority,
|
public void onPerformSync(Account account, Bundle extras, String authority,
|
||||||
ContentProviderClient provider, SyncResult syncResult)
|
ContentProviderClient provider, SyncResult syncResult)
|
||||||
{
|
{
|
||||||
Log.w(TAG, "onPerformSync(" + authority +")");
|
Log.i(TAG, "onPerformSync(" + authority +")");
|
||||||
|
|
||||||
if (TextSecurePreferences.isPushRegistered(getContext())) {
|
if (TextSecurePreferences.isPushRegistered(getContext())) {
|
||||||
try {
|
try {
|
||||||
|
@ -55,6 +55,8 @@ import javax.crypto.spec.SecretKeySpec;
|
|||||||
|
|
||||||
public class MasterCipher {
|
public class MasterCipher {
|
||||||
|
|
||||||
|
private static final String TAG = MasterCipher.class.getSimpleName();
|
||||||
|
|
||||||
private final MasterSecret masterSecret;
|
private final MasterSecret masterSecret;
|
||||||
private final Cipher encryptingCipher;
|
private final Cipher encryptingCipher;
|
||||||
private final Cipher decryptingCipher;
|
private final Cipher decryptingCipher;
|
||||||
@ -125,13 +127,13 @@ public class MasterCipher {
|
|||||||
|
|
||||||
public boolean verifyMacFor(String content, byte[] theirMac) {
|
public boolean verifyMacFor(String content, byte[] theirMac) {
|
||||||
byte[] ourMac = getMacFor(content);
|
byte[] ourMac = getMacFor(content);
|
||||||
Log.w("MasterCipher", "Our Mac: " + Hex.toString(ourMac));
|
Log.i(TAG, "Our Mac: " + Hex.toString(ourMac));
|
||||||
Log.w("MasterCipher", "Thr Mac: " + Hex.toString(theirMac));
|
Log.i(TAG, "Thr Mac: " + Hex.toString(theirMac));
|
||||||
return Arrays.equals(ourMac, theirMac);
|
return Arrays.equals(ourMac, theirMac);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getMacFor(String content) {
|
public byte[] getMacFor(String content) {
|
||||||
Log.w("MasterCipher", "Macing: " + content);
|
Log.w(TAG, "Macing: " + content);
|
||||||
try {
|
try {
|
||||||
Mac mac = getMac(masterSecret.getMacKey());
|
Mac mac = getMac(masterSecret.getMacKey());
|
||||||
return mac.doFinal(content.getBytes());
|
return mac.doFinal(content.getBytes());
|
||||||
|
@ -47,6 +47,8 @@ import java.security.Security;
|
|||||||
*/
|
*/
|
||||||
public final class PRNGFixes {
|
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 = 16;
|
||||||
private static final int VERSION_CODE_JELLY_BEAN_MR2 = 18;
|
private static final int VERSION_CODE_JELLY_BEAN_MR2 = 18;
|
||||||
private static final byte[] BUILD_FINGERPRINT_AND_DEVICE_SERIAL =
|
private static final byte[] BUILD_FINGERPRINT_AND_DEVICE_SERIAL =
|
||||||
@ -226,8 +228,7 @@ public final class PRNGFixes {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// On a small fraction of devices /dev/urandom is not writable.
|
// On a small fraction of devices /dev/urandom is not writable.
|
||||||
// Log and ignore.
|
// Log and ignore.
|
||||||
Log.w(PRNGFixes.class.getSimpleName(),
|
Log.w(TAG, "Failed to mix seed into " + URANDOM_FILE);
|
||||||
"Failed to mix seed into " + URANDOM_FILE);
|
|
||||||
} finally {
|
} finally {
|
||||||
mSeeded = true;
|
mSeeded = true;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,8 @@ import java.security.NoSuchAlgorithmException;
|
|||||||
|
|
||||||
public class PublicKey {
|
public class PublicKey {
|
||||||
|
|
||||||
|
private static final String TAG = PublicKey.class.getSimpleName();
|
||||||
|
|
||||||
public static final int KEY_SIZE = 3 + ECPublicKey.KEY_SIZE;
|
public static final int KEY_SIZE = 3 + ECPublicKey.KEY_SIZE;
|
||||||
|
|
||||||
private final ECPublicKey publicKey;
|
private final ECPublicKey publicKey;
|
||||||
@ -48,7 +50,7 @@ public class PublicKey {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PublicKey(byte[] bytes, int offset) throws InvalidKeyException {
|
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)
|
if ((bytes.length - offset) < KEY_SIZE)
|
||||||
throw new InvalidKeyException("Provided bytes are too short.");
|
throw new InvalidKeyException("Provided bytes are too short.");
|
||||||
@ -95,7 +97,7 @@ public class PublicKey {
|
|||||||
byte[] keyIdBytes = Conversions.mediumToByteArray(id);
|
byte[] keyIdBytes = Conversions.mediumToByteArray(id);
|
||||||
byte[] serializedPoint = publicKey.serialize();
|
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);
|
return Util.combine(keyIdBytes, serializedPoint);
|
||||||
}
|
}
|
||||||
|
@ -51,13 +51,13 @@ public class TextSecureIdentityKeyStore implements IdentityKeyStore {
|
|||||||
Optional<IdentityRecord> identityRecord = identityDatabase.getIdentity(signalAddress);
|
Optional<IdentityRecord> identityRecord = identityDatabase.getIdentity(signalAddress);
|
||||||
|
|
||||||
if (!identityRecord.isPresent()) {
|
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);
|
identityDatabase.saveIdentity(signalAddress, identityKey, VerifiedStatus.DEFAULT, true, System.currentTimeMillis(), nonBlockingApproval);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!identityRecord.get().getIdentityKey().equals(identityKey)) {
|
if (!identityRecord.get().getIdentityKey().equals(identityKey)) {
|
||||||
Log.w(TAG, "Replacing existing identity...");
|
Log.i(TAG, "Replacing existing identity...");
|
||||||
VerifiedStatus verifiedStatus;
|
VerifiedStatus verifiedStatus;
|
||||||
|
|
||||||
if (identityRecord.get().getVerifiedStatus() == VerifiedStatus.VERIFIED ||
|
if (identityRecord.get().getVerifiedStatus() == VerifiedStatus.VERIFIED ||
|
||||||
@ -75,7 +75,7 @@ public class TextSecureIdentityKeyStore implements IdentityKeyStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isNonBlockingApprovalRequired(identityRecord.get())) {
|
if (isNonBlockingApprovalRequired(identityRecord.get())) {
|
||||||
Log.w(TAG, "Setting approval status...");
|
Log.i(TAG, "Setting approval status...");
|
||||||
identityDatabase.setApproval(signalAddress, nonBlockingApproval);
|
identityDatabase.setApproval(signalAddress, nonBlockingApproval);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ public class ApnDatabase {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (apn != null) {
|
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,
|
cursor = db.query(TABLE_NAME, null,
|
||||||
BASE_SELECTION + " AND " + APN_COLUMN + " = ?",
|
BASE_SELECTION + " AND " + APN_COLUMN + " = ?",
|
||||||
new String[] {mccmnc, apn},
|
new String[] {mccmnc, apn},
|
||||||
@ -132,7 +132,7 @@ public class ApnDatabase {
|
|||||||
|
|
||||||
if (cursor == null || !cursor.moveToFirst()) {
|
if (cursor == null || !cursor.moveToFirst()) {
|
||||||
if (cursor != null) cursor.close();
|
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,
|
cursor = db.query(TABLE_NAME, null,
|
||||||
BASE_SELECTION,
|
BASE_SELECTION,
|
||||||
new String[] {mccmnc},
|
new String[] {mccmnc},
|
||||||
@ -145,7 +145,7 @@ public class ApnDatabase {
|
|||||||
cursor.getString(cursor.getColumnIndexOrThrow(MMS_PORT_COLUMN)),
|
cursor.getString(cursor.getColumnIndexOrThrow(MMS_PORT_COLUMN)),
|
||||||
cursor.getString(cursor.getColumnIndexOrThrow(USER_COLUMN)),
|
cursor.getString(cursor.getColumnIndexOrThrow(USER_COLUMN)),
|
||||||
cursor.getString(cursor.getColumnIndexOrThrow(PASSWORD_COLUMN)));
|
cursor.getString(cursor.getColumnIndexOrThrow(PASSWORD_COLUMN)));
|
||||||
Log.w(TAG, "Returning preferred APN " + params);
|
Log.d(TAG, "Returning preferred APN " + params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ public class AttachmentDatabase extends Database {
|
|||||||
public @NonNull InputStream getThumbnailStream(@NonNull AttachmentId attachmentId)
|
public @NonNull InputStream getThumbnailStream(@NonNull AttachmentId attachmentId)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
Log.w(TAG, "getThumbnailStream(" + attachmentId + ")");
|
Log.d(TAG, "getThumbnailStream(" + attachmentId + ")");
|
||||||
InputStream dataStream = getDataStream(attachmentId, THUMBNAIL, 0);
|
InputStream dataStream = getDataStream(attachmentId, THUMBNAIL, 0);
|
||||||
|
|
||||||
if (dataStream != null) {
|
if (dataStream != null) {
|
||||||
@ -351,20 +351,20 @@ public class AttachmentDatabase extends Database {
|
|||||||
@NonNull Map<Attachment, AttachmentId> insertAttachmentsForMessage(long mmsId, @NonNull List<Attachment> attachments, @NonNull List<Attachment> quoteAttachment)
|
@NonNull Map<Attachment, AttachmentId> insertAttachmentsForMessage(long mmsId, @NonNull List<Attachment> attachments, @NonNull List<Attachment> quoteAttachment)
|
||||||
throws MmsException
|
throws MmsException
|
||||||
{
|
{
|
||||||
Log.w(TAG, "insertParts(" + attachments.size() + ")");
|
Log.d(TAG, "insertParts(" + attachments.size() + ")");
|
||||||
|
|
||||||
Map<Attachment, AttachmentId> insertedAttachments = new HashMap<>();
|
Map<Attachment, AttachmentId> insertedAttachments = new HashMap<>();
|
||||||
|
|
||||||
for (Attachment attachment : attachments) {
|
for (Attachment attachment : attachments) {
|
||||||
AttachmentId attachmentId = insertAttachment(mmsId, attachment, attachment.isQuote());
|
AttachmentId attachmentId = insertAttachment(mmsId, attachment, attachment.isQuote());
|
||||||
insertedAttachments.put(attachment, attachmentId);
|
insertedAttachments.put(attachment, attachmentId);
|
||||||
Log.w(TAG, "Inserted attachment at ID: " + attachmentId);
|
Log.i(TAG, "Inserted attachment at ID: " + attachmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Attachment attachment : quoteAttachment) {
|
for (Attachment attachment : quoteAttachment) {
|
||||||
AttachmentId attachmentId = insertAttachment(mmsId, attachment, true);
|
AttachmentId attachmentId = insertAttachment(mmsId, attachment, true);
|
||||||
insertedAttachments.put(attachment, attachmentId);
|
insertedAttachments.put(attachment, attachmentId);
|
||||||
Log.w(TAG, "Inserted quoted attachment at ID: " + attachmentId);
|
Log.i(TAG, "Inserted quoted attachment at ID: " + attachmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return insertedAttachments;
|
return insertedAttachments;
|
||||||
@ -616,7 +616,7 @@ public class AttachmentDatabase extends Database {
|
|||||||
private AttachmentId insertAttachment(long mmsId, Attachment attachment, boolean quote)
|
private AttachmentId insertAttachment(long mmsId, Attachment attachment, boolean quote)
|
||||||
throws MmsException
|
throws MmsException
|
||||||
{
|
{
|
||||||
Log.w(TAG, "Inserting attachment for mms id: " + mmsId);
|
Log.d(TAG, "Inserting attachment for mms id: " + mmsId);
|
||||||
|
|
||||||
SQLiteDatabase database = databaseHelper.getWritableDatabase();
|
SQLiteDatabase database = databaseHelper.getWritableDatabase();
|
||||||
DataInfo dataInfo = null;
|
DataInfo dataInfo = null;
|
||||||
@ -624,7 +624,7 @@ public class AttachmentDatabase extends Database {
|
|||||||
|
|
||||||
if (attachment.getDataUri() != null) {
|
if (attachment.getDataUri() != null) {
|
||||||
dataInfo = setAttachmentData(attachment.getDataUri());
|
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();
|
ContentValues contentValues = new ContentValues();
|
||||||
@ -679,7 +679,7 @@ public class AttachmentDatabase extends Database {
|
|||||||
thumbnailExecutor.submit(new ThumbnailFetchCallable(attachmentId));
|
thumbnailExecutor.submit(new ThumbnailFetchCallable(attachmentId));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "Submitting thumbnail generation job...");
|
Log.i(TAG, "Submitting thumbnail generation job...");
|
||||||
thumbnailExecutor.submit(new ThumbnailFetchCallable(attachmentId));
|
thumbnailExecutor.submit(new ThumbnailFetchCallable(attachmentId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -692,7 +692,7 @@ public class AttachmentDatabase extends Database {
|
|||||||
protected void updateAttachmentThumbnail(AttachmentId attachmentId, InputStream in, float aspectRatio)
|
protected void updateAttachmentThumbnail(AttachmentId attachmentId, InputStream in, float aspectRatio)
|
||||||
throws MmsException
|
throws MmsException
|
||||||
{
|
{
|
||||||
Log.w(TAG, "updating part thumbnail for #" + attachmentId);
|
Log.i(TAG, "updating part thumbnail for #" + attachmentId);
|
||||||
|
|
||||||
DataInfo thumbnailFile = setAttachmentData(in);
|
DataInfo thumbnailFile = setAttachmentData(in);
|
||||||
|
|
||||||
@ -728,7 +728,7 @@ public class AttachmentDatabase extends Database {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable InputStream call() throws Exception {
|
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);
|
final InputStream stream = getDataStream(attachmentId, THUMBNAIL, 0);
|
||||||
|
|
||||||
if (stream != null) {
|
if (stream != null) {
|
||||||
@ -776,7 +776,7 @@ public class AttachmentDatabase extends Database {
|
|||||||
|
|
||||||
Bitmap bitmap = retriever.getFrameAtTime(1000);
|
Bitmap bitmap = retriever.getFrameAtTime(1000);
|
||||||
|
|
||||||
Log.w(TAG, "Generated video thumbnail...");
|
Log.i(TAG, "Generated video thumbnail...");
|
||||||
return new ThumbnailData(bitmap);
|
return new ThumbnailData(bitmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ public class EarlyReceiptCache {
|
|||||||
private final LRUCache<Long, Map<Address, Long>> cache = new LRUCache<>(100);
|
private final LRUCache<Long, Map<Address, Long>> cache = new LRUCache<>(100);
|
||||||
|
|
||||||
public synchronized void increment(long timestamp, Address origin) {
|
public synchronized void increment(long timestamp, Address origin) {
|
||||||
Log.w(TAG, this+"");
|
Log.i(TAG, this+"");
|
||||||
Log.w(TAG, String.format("Early receipt: (%d, %s)", timestamp, origin.serialize()));
|
Log.i(TAG, String.format("Early receipt: (%d, %s)", timestamp, origin.serialize()));
|
||||||
|
|
||||||
Map<Address, Long> receipts = cache.get(timestamp);
|
Map<Address, Long> receipts = cache.get(timestamp);
|
||||||
|
|
||||||
@ -36,8 +36,8 @@ public class EarlyReceiptCache {
|
|||||||
public synchronized Map<Address, Long> remove(long timestamp) {
|
public synchronized Map<Address, Long> remove(long timestamp) {
|
||||||
Map<Address, Long> receipts = cache.remove(timestamp);
|
Map<Address, Long> receipts = cache.remove(timestamp);
|
||||||
|
|
||||||
Log.w(TAG, this+"");
|
Log.i(TAG, this+"");
|
||||||
Log.w(TAG, String.format("Checking early receipts (%d): %d", timestamp, receipts == null ? 0 : receipts.size()));
|
Log.i(TAG, String.format("Checking early receipts (%d): %d", timestamp, receipts == null ? 0 : receipts.size()));
|
||||||
|
|
||||||
return receipts != null ? receipts : new HashMap<>();
|
return receipts != null ? receipts : new HashMap<>();
|
||||||
}
|
}
|
||||||
|
@ -800,7 +800,7 @@ public class MmsDatabase extends MessagingDatabase {
|
|||||||
ContentValues contentValues = new ContentValues();
|
ContentValues contentValues = new ContentValues();
|
||||||
ContentValuesBuilder contentBuilder = new ContentValuesBuilder(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());
|
contentBuilder.add(CONTENT_LOCATION, notification.getContentLocation());
|
||||||
@ -1056,11 +1056,11 @@ public class MmsDatabase extends MessagingDatabase {
|
|||||||
|
|
||||||
where += (" ELSE " + DATE_RECEIVED + " < " + date + " END)");
|
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);
|
cursor = db.query(TABLE_NAME, new String[] {ID}, where, new String[] {threadId+""}, null, null, null);
|
||||||
|
|
||||||
while (cursor != null && cursor.moveToNext()) {
|
while (cursor != null && cursor.moveToNext()) {
|
||||||
Log.w("MmsDatabase", "Trimming: " + cursor.getLong(0));
|
Log.i("MmsDatabase", "Trimming: " + cursor.getLong(0));
|
||||||
delete(cursor.getLong(0));
|
delete(cursor.getLong(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ public class MmsSmsDatabase extends Database {
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
String query = outerQueryBuilder.buildQuery(projection, null, null, null, null, null, null);
|
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();
|
SQLiteDatabase db = databaseHelper.getReadableDatabase();
|
||||||
return db.rawQuery(query, null);
|
return db.rawQuery(query, null);
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class SmsDatabase extends MessagingDatabase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateTypeBitmask(long id, long maskOff, long maskOn) {
|
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();
|
SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
||||||
db.execSQL("UPDATE " + TABLE_NAME +
|
db.execSQL("UPDATE " + TABLE_NAME +
|
||||||
@ -263,7 +263,7 @@ public class SmsDatabase extends MessagingDatabase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void markStatus(long id, int status) {
|
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 contentValues = new ContentValues();
|
||||||
contentValues.put(STATUS, status);
|
contentValues.put(STATUS, status);
|
||||||
|
|
||||||
@ -690,7 +690,7 @@ public class SmsDatabase extends MessagingDatabase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean deleteMessage(long messageId) {
|
public boolean deleteMessage(long messageId) {
|
||||||
Log.w("MessageDatabase", "Deleting: " + messageId);
|
Log.i("MessageDatabase", "Deleting: " + messageId);
|
||||||
SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
||||||
long threadId = getThreadIdForMessage(messageId);
|
long threadId = getThreadIdForMessage(messageId);
|
||||||
db.delete(TABLE_NAME, ID_WHERE, new String[] {messageId+""});
|
db.delete(TABLE_NAME, ID_WHERE, new String[] {messageId+""});
|
||||||
|
@ -220,7 +220,7 @@ public class ThreadDatabase extends Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void trimThread(long threadId, int length) {
|
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;
|
Cursor cursor = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -232,7 +232,7 @@ public class ThreadDatabase extends Database {
|
|||||||
|
|
||||||
long lastTweetDate = cursor.getLong(cursor.getColumnIndexOrThrow(MmsSmsColumns.NORMALIZED_DATE_RECEIVED));
|
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.getSmsDatabase(context).deleteMessagesInThreadBeforeDate(threadId, lastTweetDate);
|
||||||
DatabaseFactory.getMmsDatabase(context).deleteMessagesInThreadBeforeDate(threadId, lastTweetDate);
|
DatabaseFactory.getMmsDatabase(context).deleteMessagesInThreadBeforeDate(threadId, lastTweetDate);
|
||||||
|
@ -180,10 +180,10 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
Cursor smsCursor = null;
|
Cursor smsCursor = null;
|
||||||
|
|
||||||
Log.w("DatabaseFactory", "Upgrade count: " + (smsCount + threadCount));
|
Log.i("DatabaseFactory", "Upgrade count: " + (smsCount + threadCount));
|
||||||
|
|
||||||
do {
|
do {
|
||||||
Log.w("DatabaseFactory", "Looping SMS cursor...");
|
Log.i("DatabaseFactory", "Looping SMS cursor...");
|
||||||
if (smsCursor != null)
|
if (smsCursor != null)
|
||||||
smsCursor.close();
|
smsCursor.close();
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
|
|||||||
skip = 0;
|
skip = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
Log.w("DatabaseFactory", "Looping thread cursor...");
|
Log.i("DatabaseFactory", "Looping thread cursor...");
|
||||||
|
|
||||||
if (threadCursor != null)
|
if (threadCursor != null)
|
||||||
threadCursor.close();
|
threadCursor.close();
|
||||||
@ -294,13 +294,13 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fromVersion < DatabaseUpgradeActivity.MMS_BODY_VERSION) {
|
if (fromVersion < DatabaseUpgradeActivity.MMS_BODY_VERSION) {
|
||||||
Log.w("DatabaseFactory", "Update MMS bodies...");
|
Log.i("DatabaseFactory", "Update MMS bodies...");
|
||||||
MasterCipher masterCipher = new MasterCipher(masterSecret);
|
MasterCipher masterCipher = new MasterCipher(masterSecret);
|
||||||
Cursor mmsCursor = db.query("mms", new String[] {"_id"},
|
Cursor mmsCursor = db.query("mms", new String[] {"_id"},
|
||||||
"msg_box & " + 0x80000000L + " != 0",
|
"msg_box & " + 0x80000000L + " != 0",
|
||||||
null, null, null, null);
|
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()) {
|
while (mmsCursor != null && mmsCursor.moveToNext()) {
|
||||||
listener.setProgress(mmsCursor.getPosition(), mmsCursor.getCount());
|
listener.setProgress(mmsCursor.getPosition(), mmsCursor.getCount());
|
||||||
@ -353,7 +353,7 @@ public class ClassicOpenHelper extends SQLiteOpenHelper {
|
|||||||
new String[] {partCount+"", mmsId+""});
|
new String[] {partCount+"", mmsId+""});
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w("DatabaseFactory", "Updated body: " + body + " and part_count: " + partCount);
|
Log.i("DatabaseFactory", "Updated body: " + body + " and part_count: " + partCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class PreKeyMigrationHelper {
|
|||||||
contentValues.put(OneTimePreKeyDatabase.PUBLIC_KEY, Base64.encodeBytes(preKey.getKeyPair().getPublicKey().serialize()));
|
contentValues.put(OneTimePreKeyDatabase.PUBLIC_KEY, Base64.encodeBytes(preKey.getKeyPair().getPublicKey().serialize()));
|
||||||
contentValues.put(OneTimePreKeyDatabase.PRIVATE_KEY, Base64.encodeBytes(preKey.getKeyPair().getPrivateKey().serialize()));
|
contentValues.put(OneTimePreKeyDatabase.PRIVATE_KEY, Base64.encodeBytes(preKey.getKeyPair().getPrivateKey().serialize()));
|
||||||
database.insert(OneTimePreKeyDatabase.TABLE_NAME, null, contentValues);
|
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) {
|
} catch (IOException | InvalidMessageException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
clean = false;
|
clean = false;
|
||||||
@ -74,7 +74,7 @@ class PreKeyMigrationHelper {
|
|||||||
contentValues.put(SignedPreKeyDatabase.SIGNATURE, Base64.encodeBytes(signedPreKey.getSignature()));
|
contentValues.put(SignedPreKeyDatabase.SIGNATURE, Base64.encodeBytes(signedPreKey.getSignature()));
|
||||||
contentValues.put(SignedPreKeyDatabase.TIMESTAMP, signedPreKey.getTimestamp());
|
contentValues.put(SignedPreKeyDatabase.TIMESTAMP, signedPreKey.getTimestamp());
|
||||||
database.insert(SignedPreKeyDatabase.TABLE_NAME, null, contentValues);
|
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) {
|
} catch (IOException | InvalidMessageException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
clean = false;
|
clean = false;
|
||||||
@ -92,7 +92,7 @@ class PreKeyMigrationHelper {
|
|||||||
PreKeyIndex index = JsonUtils.fromJson(reader, PreKeyIndex.class);
|
PreKeyIndex index = JsonUtils.fromJson(reader, PreKeyIndex.class);
|
||||||
reader.close();
|
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);
|
TextSecurePreferences.setNextPreKeyId(context, index.nextPreKeyId);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
@ -105,8 +105,8 @@ class PreKeyMigrationHelper {
|
|||||||
SignedPreKeyIndex index = JsonUtils.fromJson(reader, SignedPreKeyIndex.class);
|
SignedPreKeyIndex index = JsonUtils.fromJson(reader, SignedPreKeyIndex.class);
|
||||||
reader.close();
|
reader.close();
|
||||||
|
|
||||||
Log.w(TAG, "Setting next signed prekey id: " + index.nextSignedPreKeyId);
|
Log.i(TAG, "Setting next signed prekey id: " + index.nextSignedPreKeyId);
|
||||||
Log.w(TAG, "Setting active signed prekey id: " + index.activeSignedPreKeyId);
|
Log.i(TAG, "Setting active signed prekey id: " + index.activeSignedPreKeyId);
|
||||||
TextSecurePreferences.setNextSignedPreKeyId(context, index.nextSignedPreKeyId);
|
TextSecurePreferences.setNextSignedPreKeyId(context, index.nextSignedPreKeyId);
|
||||||
TextSecurePreferences.setActiveSignedPreKeyId(context, index.activeSignedPreKeyId);
|
TextSecurePreferences.setActiveSignedPreKeyId(context, index.activeSignedPreKeyId);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -123,11 +123,11 @@ class PreKeyMigrationHelper {
|
|||||||
|
|
||||||
if (preKeyFiles != null) {
|
if (preKeyFiles != null) {
|
||||||
for (File preKeyFile : preKeyFiles) {
|
for (File preKeyFile : preKeyFiles) {
|
||||||
Log.w(TAG, "Deleting: " + preKeyFile.getAbsolutePath());
|
Log.i(TAG, "Deleting: " + preKeyFile.getAbsolutePath());
|
||||||
preKeyFile.delete();
|
preKeyFile.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Deleting: " + preKeyDirectory.getAbsolutePath());
|
Log.i(TAG, "Deleting: " + preKeyDirectory.getAbsolutePath());
|
||||||
preKeyDirectory.delete();
|
preKeyDirectory.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,11 +136,11 @@ class PreKeyMigrationHelper {
|
|||||||
|
|
||||||
if (signedPreKeyFiles != null) {
|
if (signedPreKeyFiles != null) {
|
||||||
for (File signedPreKeyFile : signedPreKeyFiles) {
|
for (File signedPreKeyFile : signedPreKeyFiles) {
|
||||||
Log.w(TAG, "Deleting: " + signedPreKeyFile.getAbsolutePath());
|
Log.i(TAG, "Deleting: " + signedPreKeyFile.getAbsolutePath());
|
||||||
signedPreKeyFile.delete();
|
signedPreKeyFile.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Deleting: " + signedPreKeyDirectory.getAbsolutePath());
|
Log.i(TAG, "Deleting: " + signedPreKeyDirectory.getAbsolutePath());
|
||||||
signedPreKeyDirectory.delete();
|
signedPreKeyDirectory.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
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();
|
db.beginTransaction();
|
||||||
|
|
||||||
|
@ -65,13 +65,13 @@ class SessionStoreMigrationHelper {
|
|||||||
SessionRecord sessionRecord;
|
SessionRecord sessionRecord;
|
||||||
|
|
||||||
if (versionMarker == SINGLE_STATE_VERSION) {
|
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);
|
SessionStructure sessionStructure = SessionStructure.parseFrom(serialized);
|
||||||
SessionState sessionState = new SessionState(sessionStructure);
|
SessionState sessionState = new SessionState(sessionStructure);
|
||||||
|
|
||||||
sessionRecord = new SessionRecord(sessionState);
|
sessionRecord = new SessionRecord(sessionState);
|
||||||
} else if (versionMarker >= ARCHIVE_STATES_VERSION) {
|
} else if (versionMarker >= ARCHIVE_STATES_VERSION) {
|
||||||
Log.w(TAG, "Migrating session: " + sessionFile.getAbsolutePath());
|
Log.i(TAG, "Migrating session: " + sessionFile.getAbsolutePath());
|
||||||
sessionRecord = new SessionRecord(serialized);
|
sessionRecord = new SessionRecord(serialized);
|
||||||
} else {
|
} else {
|
||||||
throw new AssertionError("Unknown version: " + versionMarker + ", " + sessionFile.getAbsolutePath());
|
throw new AssertionError("Unknown version: " + versionMarker + ", " + sessionFile.getAbsolutePath());
|
||||||
|
@ -161,12 +161,12 @@ public class SignalCommunicationModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnected() {
|
public void onConnected() {
|
||||||
Log.w(TAG, "onConnected()");
|
Log.i(TAG, "onConnected()");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnecting() {
|
public void onConnecting() {
|
||||||
Log.w(TAG, "onConnecting()");
|
Log.i(TAG, "onConnecting()");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -23,7 +23,7 @@ public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {
|
|||||||
String messageType = gcm.getMessageType(intent);
|
String messageType = gcm.getMessageType(intent);
|
||||||
|
|
||||||
if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
|
if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
|
||||||
Log.w(TAG, "GCM message...");
|
Log.i(TAG, "GCM message...");
|
||||||
|
|
||||||
if (!TextSecurePreferences.isPushRegistered(context)) {
|
if (!TextSecurePreferences.isPushRegistered(context)) {
|
||||||
Log.w(TAG, "Not push registered!");
|
Log.w(TAG, "Not push registered!");
|
||||||
|
@ -31,7 +31,7 @@ public class EncryptedBitmapCacheDecoder extends EncryptedCoder implements Resou
|
|||||||
public boolean handles(@NonNull File source, @NonNull Options options)
|
public boolean handles(@NonNull File source, @NonNull Options options)
|
||||||
throws IOException
|
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)) {
|
try (InputStream inputStream = createEncryptedInputStream(secret, source)) {
|
||||||
return streamBitmapDecoder.handles(inputStream, options);
|
return streamBitmapDecoder.handles(inputStream, options);
|
||||||
@ -46,7 +46,7 @@ public class EncryptedBitmapCacheDecoder extends EncryptedCoder implements Resou
|
|||||||
public Resource<Bitmap> decode(@NonNull File source, int width, int height, @NonNull Options options)
|
public Resource<Bitmap> decode(@NonNull File source, int width, int height, @NonNull Options options)
|
||||||
throws IOException
|
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)) {
|
try (InputStream inputStream = createEncryptedInputStream(secret, source)) {
|
||||||
return streamBitmapDecoder.decode(inputStream, width, height, options);
|
return streamBitmapDecoder.decode(inputStream, width, height, options);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public class EncryptedBitmapResourceEncoder extends EncryptedCoder implements Re
|
|||||||
@SuppressWarnings("EmptyCatchBlock")
|
@SuppressWarnings("EmptyCatchBlock")
|
||||||
@Override
|
@Override
|
||||||
public boolean encode(@NonNull Resource<Bitmap> data, @NonNull File file, @NonNull Options options) {
|
public boolean encode(@NonNull Resource<Bitmap> 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 bitmap = data.get();
|
||||||
Bitmap.CompressFormat format = getFormat(bitmap, options);
|
Bitmap.CompressFormat format = getFormat(bitmap, options);
|
||||||
|
@ -29,7 +29,7 @@ public class EncryptedCacheEncoder extends EncryptedCoder implements Encoder<Inp
|
|||||||
@SuppressWarnings("EmptyCatchBlock")
|
@SuppressWarnings("EmptyCatchBlock")
|
||||||
@Override
|
@Override
|
||||||
public boolean encode(@NonNull InputStream data, @NonNull File file, @NonNull Options options) {
|
public boolean encode(@NonNull InputStream data, @NonNull File file, @NonNull Options options) {
|
||||||
Log.w(TAG, "Encrypted cache encoder running: " + file.toString());
|
Log.i(TAG, "Encrypted cache encoder running: " + file.toString());
|
||||||
|
|
||||||
byte[] buffer = byteArrayPool.get(ArrayPool.STANDARD_BUFFER_SIZE_BYTES, byte[].class);
|
byte[] buffer = byteArrayPool.get(ArrayPool.STANDARD_BUFFER_SIZE_BYTES, byte[].class);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public class EncryptedGifCacheDecoder extends EncryptedCoder implements Resource
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handles(@NonNull File source, @NonNull Options options) {
|
public boolean handles(@NonNull File source, @NonNull Options options) {
|
||||||
Log.w(TAG, "Checking item for encrypted GIF cache decoder: " + source.toString());
|
Log.i(TAG, "Checking item for encrypted GIF cache decoder: " + source.toString());
|
||||||
|
|
||||||
try (InputStream inputStream = createEncryptedInputStream(secret, source)) {
|
try (InputStream inputStream = createEncryptedInputStream(secret, source)) {
|
||||||
return gifDecoder.handles(inputStream, options);
|
return gifDecoder.handles(inputStream, options);
|
||||||
@ -42,7 +42,7 @@ public class EncryptedGifCacheDecoder extends EncryptedCoder implements Resource
|
|||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Resource<GifDrawable> decode(@NonNull File source, int width, int height, @NonNull Options options) throws IOException {
|
public Resource<GifDrawable> 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)) {
|
try (InputStream inputStream = createEncryptedInputStream(secret, source)) {
|
||||||
return gifDecoder.decode(inputStream, width, height, options);
|
return gifDecoder.decode(inputStream, width, height, options);
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Downloading push part " + attachmentId);
|
Log.i(TAG, "Downloading push part " + attachmentId);
|
||||||
database.setTransferState(messageId, attachmentId, AttachmentDatabase.TRANSFER_PROGRESS_STARTED);
|
database.setTransferState(messageId, attachmentId, AttachmentDatabase.TRANSFER_PROGRESS_STARTED);
|
||||||
|
|
||||||
retrieveAttachment(messageId, attachmentId, attachment);
|
retrieveAttachment(messageId, attachmentId, attachment);
|
||||||
@ -154,9 +154,9 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (attachment.getDigest() != null) {
|
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 {
|
} else {
|
||||||
Log.w(TAG, "Downloading attachment with no digest...");
|
Log.i(TAG, "Downloading attachment with no digest...");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SignalServiceAttachmentPointer(id, null, key, relay,
|
return new SignalServiceAttachmentPointer(id, null, key, relay,
|
||||||
|
@ -75,7 +75,7 @@ public class AvatarDownloadJob extends MasterSecretJob implements InjectableType
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (digest.isPresent()) {
|
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());
|
attachment = File.createTempFile("avatar", "tmp", context.getCacheDir());
|
||||||
|
@ -51,7 +51,7 @@ public class CleanPreKeysJob extends MasterSecretJob implements InjectableType {
|
|||||||
@Override
|
@Override
|
||||||
public void onRun(MasterSecret masterSecret) throws IOException {
|
public void onRun(MasterSecret masterSecret) throws IOException {
|
||||||
try {
|
try {
|
||||||
Log.w(TAG, "Cleaning prekeys...");
|
Log.i(TAG, "Cleaning prekeys...");
|
||||||
|
|
||||||
int activeSignedPreKeyId = PreKeyUtil.getActiveSignedPreKeyId(context);
|
int activeSignedPreKeyId = PreKeyUtil.getActiveSignedPreKeyId(context);
|
||||||
SignedPreKeyStore signedPreKeyStore = signedPreKeyStoreFactory.create();
|
SignedPreKeyStore signedPreKeyStore = signedPreKeyStoreFactory.create();
|
||||||
@ -64,8 +64,8 @@ public class CleanPreKeysJob extends MasterSecretJob implements InjectableType {
|
|||||||
|
|
||||||
Collections.sort(oldRecords, new SignedPreKeySorter());
|
Collections.sort(oldRecords, new SignedPreKeySorter());
|
||||||
|
|
||||||
Log.w(TAG, "Active signed prekey: " + activeSignedPreKeyId);
|
Log.i(TAG, "Active signed prekey: " + activeSignedPreKeyId);
|
||||||
Log.w(TAG, "Old signed prekey record count: " + oldRecords.size());
|
Log.i(TAG, "Old signed prekey record count: " + oldRecords.size());
|
||||||
|
|
||||||
boolean foundAgedRecord = false;
|
boolean foundAgedRecord = false;
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ public class CleanPreKeysJob extends MasterSecretJob implements InjectableType {
|
|||||||
if (!foundAgedRecord) {
|
if (!foundAgedRecord) {
|
||||||
foundAgedRecord = true;
|
foundAgedRecord = true;
|
||||||
} else {
|
} 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());
|
signedPreKeyStore.removeSignedPreKey(oldRecord.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class DirectoryRefreshJob extends ContextJob {
|
public class DirectoryRefreshJob extends ContextJob {
|
||||||
|
|
||||||
|
private static final String TAG = DirectoryRefreshJob.class.getSimpleName();
|
||||||
|
|
||||||
@Nullable private transient Recipient recipient;
|
@Nullable private transient Recipient recipient;
|
||||||
private transient boolean notifyOfNewUsers;
|
private transient boolean notifyOfNewUsers;
|
||||||
|
|
||||||
@ -41,7 +43,7 @@ public class DirectoryRefreshJob extends ContextJob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRun() throws IOException {
|
public void onRun() throws IOException {
|
||||||
Log.w("DirectoryRefreshJob", "DirectoryRefreshJob.onRun()");
|
Log.i(TAG, "DirectoryRefreshJob.onRun()");
|
||||||
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Directory Refresh");
|
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Directory Refresh");
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ public class GcmRefreshJob extends ContextJob implements InjectableType {
|
|||||||
public void onRun() throws Exception {
|
public void onRun() throws Exception {
|
||||||
if (TextSecurePreferences.isGcmDisabled(context)) return;
|
if (TextSecurePreferences.isGcmDisabled(context)) return;
|
||||||
|
|
||||||
Log.w(TAG, "Reregistering GCM...");
|
Log.i(TAG, "Reregistering GCM...");
|
||||||
int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context);
|
int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context);
|
||||||
|
|
||||||
if (result != ConnectionResult.SUCCESS) {
|
if (result != ConnectionResult.SUCCESS) {
|
||||||
|
@ -41,7 +41,7 @@ public class LocalBackupJob extends ContextJob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRun() throws NoExternalStorageException, IOException {
|
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)) {
|
if (!Permissions.hasAll(context, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||||
throw new IOException("No external storage permission!");
|
throw new IOException("No external storage permission!");
|
||||||
|
@ -113,7 +113,7 @@ public class MmsDownloadJob extends MasterSecretJob {
|
|||||||
Log.w(TAG, e);
|
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());
|
RetrieveConf retrieveConf = new CompatMmsConnection(context).retrieve(contentLocation, transactionId, notification.get().getSubscriptionId());
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class MmsReceiveJob extends ContextJob {
|
|||||||
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
|
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
|
||||||
Pair<Long, Long> messageAndThreadId = database.insertMessageInbox((NotificationInd)pdu, subscriptionId);
|
Pair<Long, Long> messageAndThreadId = database.insertMessageInbox((NotificationInd)pdu, subscriptionId);
|
||||||
|
|
||||||
Log.w(TAG, "Inserted received MMS notification...");
|
Log.i(TAG, "Inserted received MMS notification...");
|
||||||
|
|
||||||
ApplicationContext.getInstance(context)
|
ApplicationContext.getInstance(context)
|
||||||
.getJobManager()
|
.getJobManager()
|
||||||
|
@ -138,8 +138,8 @@ public class MmsSendJob extends SendJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isInconsistentResponse(SendReq message, SendConf response) {
|
private boolean isInconsistentResponse(SendReq message, SendConf response) {
|
||||||
Log.w(TAG, "Comparing: " + Hex.toString(message.getTransactionId()));
|
Log.i(TAG, "Comparing: " + Hex.toString(message.getTransactionId()));
|
||||||
Log.w(TAG, "With: " + Hex.toString(response.getTransactionId()));
|
Log.i(TAG, "With: " + Hex.toString(response.getTransactionId()));
|
||||||
return !Arrays.equals(message.getTransactionId(), response.getTransactionId());
|
return !Arrays.equals(message.getTransactionId(), response.getTransactionId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ public class PushDecryptJob extends ContextJob {
|
|||||||
else if (syncMessage.getVerified().isPresent()) handleSynchronizeVerifiedMessage(syncMessage.getVerified().get());
|
else if (syncMessage.getVerified().isPresent()) handleSynchronizeVerifiedMessage(syncMessage.getVerified().get());
|
||||||
else Log.w(TAG, "Contains no known sync types...");
|
else Log.w(TAG, "Contains no known sync types...");
|
||||||
} else if (content.getCallMessage().isPresent()) {
|
} else if (content.getCallMessage().isPresent()) {
|
||||||
Log.w(TAG, "Got call message...");
|
Log.i(TAG, "Got call message...");
|
||||||
SignalServiceCallMessage message = content.getCallMessage().get();
|
SignalServiceCallMessage message = content.getCallMessage().get();
|
||||||
|
|
||||||
if (message.getOfferMessage().isPresent()) handleCallOfferMessage(envelope, message.getOfferMessage().get(), smsMessageId);
|
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,
|
private void handleCallAnswerMessage(@NonNull SignalServiceEnvelope envelope,
|
||||||
@NonNull AnswerMessage message)
|
@NonNull AnswerMessage message)
|
||||||
{
|
{
|
||||||
Log.w(TAG, "handleCallAnswerMessage...");
|
Log.i(TAG, "handleCallAnswerMessage...");
|
||||||
Intent intent = new Intent(context, WebRtcCallService.class);
|
Intent intent = new Intent(context, WebRtcCallService.class);
|
||||||
intent.setAction(WebRtcCallService.ACTION_RESPONSE_MESSAGE);
|
intent.setAction(WebRtcCallService.ACTION_RESPONSE_MESSAGE);
|
||||||
intent.putExtra(WebRtcCallService.EXTRA_CALL_ID, message.getId());
|
intent.putExtra(WebRtcCallService.EXTRA_CALL_ID, message.getId());
|
||||||
@ -297,7 +297,7 @@ public class PushDecryptJob extends ContextJob {
|
|||||||
@NonNull HangupMessage message,
|
@NonNull HangupMessage message,
|
||||||
@NonNull Optional<Long> smsMessageId)
|
@NonNull Optional<Long> smsMessageId)
|
||||||
{
|
{
|
||||||
Log.w(TAG, "handleCallHangupMessage");
|
Log.i(TAG, "handleCallHangupMessage");
|
||||||
if (smsMessageId.isPresent()) {
|
if (smsMessageId.isPresent()) {
|
||||||
DatabaseFactory.getSmsDatabase(context).markAsMissedCall(smsMessageId.get());
|
DatabaseFactory.getSmsDatabase(context).markAsMissedCall(smsMessageId.get());
|
||||||
} else {
|
} else {
|
||||||
@ -846,7 +846,7 @@ public class PushDecryptJob extends ContextJob {
|
|||||||
@NonNull SignalServiceReceiptMessage message)
|
@NonNull SignalServiceReceiptMessage message)
|
||||||
{
|
{
|
||||||
for (long timestamp : message.getTimestamps()) {
|
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)
|
DatabaseFactory.getMmsSmsDatabase(context)
|
||||||
.incrementDeliveryReceiptCount(new SyncMessageId(Address.fromExternal(context, envelope.getSource()), timestamp), System.currentTimeMillis());
|
.incrementDeliveryReceiptCount(new SyncMessageId(Address.fromExternal(context, envelope.getSource()), timestamp), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
@ -857,7 +857,7 @@ public class PushDecryptJob extends ContextJob {
|
|||||||
{
|
{
|
||||||
if (TextSecurePreferences.isReadReceiptsEnabled(context)) {
|
if (TextSecurePreferences.isReadReceiptsEnabled(context)) {
|
||||||
for (long timestamp : message.getTimestamps()) {
|
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)
|
DatabaseFactory.getMmsSmsDatabase(context)
|
||||||
.incrementReadReceiptCount(new SyncMessageId(Address.fromExternal(context, envelope.getSource()), timestamp), envelope.getTimestamp());
|
.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);
|
MessageRecord message = DatabaseFactory.getMmsSmsDatabase(context).getMessageFor(quote.get().getId(), author);
|
||||||
|
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
Log.w(TAG, "Found matching message record...");
|
Log.i(TAG, "Found matching message record...");
|
||||||
|
|
||||||
List<Attachment> attachments = new LinkedList<>();
|
List<Attachment> attachments = new LinkedList<>();
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ public abstract class PushReceivedJob extends ContextJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleReceipt(SignalServiceEnvelope envelope) {
|
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()),
|
DatabaseFactory.getMmsSmsDatabase(context).incrementDeliveryReceiptCount(new SyncMessageId(Address.fromExternal(context, envelope.getSource()),
|
||||||
envelope.getTimestamp()), System.currentTimeMillis());
|
envelope.getTimestamp()), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
|
|||||||
SmsMessageRecord record = database.getMessage(messageId);
|
SmsMessageRecord record = database.getMessage(messageId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Log.w(TAG, "Sending message: " + messageId);
|
Log.i(TAG, "Sending message: " + messageId);
|
||||||
|
|
||||||
deliver(record);
|
deliver(record);
|
||||||
database.markAsSent(messageId, true);
|
database.markAsSent(messageId, true);
|
||||||
|
@ -53,7 +53,7 @@ public class RefreshPreKeysJob extends MasterSecretJob implements InjectableType
|
|||||||
int availableKeys = accountManager.getPreKeysCount();
|
int availableKeys = accountManager.getPreKeysCount();
|
||||||
|
|
||||||
if (availableKeys >= PREKEY_MINIMUM && TextSecurePreferences.isSignedPreKeyRegistered(context)) {
|
if (availableKeys >= PREKEY_MINIMUM && TextSecurePreferences.isSignedPreKeyRegistered(context)) {
|
||||||
Log.w(TAG, "Available keys sufficient: " + availableKeys);
|
Log.i(TAG, "Available keys sufficient: " + availableKeys);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ public class RefreshPreKeysJob extends MasterSecretJob implements InjectableType
|
|||||||
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context);
|
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context);
|
||||||
SignedPreKeyRecord signedPreKeyRecord = PreKeyUtil.generateSignedPreKey(context, identityKey, false);
|
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);
|
accountManager.setPreKeys(identityKey.getPublicKey(), signedPreKeyRecord, preKeyRecords);
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class RotateSignedPreKeyJob extends MasterSecretJob implements Injectable
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRun(MasterSecret masterSecret) throws Exception {
|
public void onRun(MasterSecret masterSecret) throws Exception {
|
||||||
Log.w(TAG, "Rotating signed prekey...");
|
Log.i(TAG, "Rotating signed prekey...");
|
||||||
|
|
||||||
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context);
|
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context);
|
||||||
SignedPreKeyRecord signedPreKeyRecord = PreKeyUtil.generateSignedPreKey(context, identityKey, false);
|
SignedPreKeyRecord signedPreKeyRecord = PreKeyUtil.generateSignedPreKey(context, identityKey, false);
|
||||||
|
@ -45,7 +45,7 @@ public class SmsReceiveJob extends ContextJob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRun() throws MigrationPendingException {
|
public void onRun() throws MigrationPendingException {
|
||||||
Log.w(TAG, "onRun()");
|
Log.i(TAG, "onRun()");
|
||||||
|
|
||||||
Optional<IncomingTextMessage> message = assembleMessageFragments(pdus, subscriptionId);
|
Optional<IncomingTextMessage> message = assembleMessageFragments(pdus, subscriptionId);
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class SmsSendJob extends SendJob {
|
|||||||
SmsMessageRecord record = database.getMessage(messageId);
|
SmsMessageRecord record = database.getMessage(messageId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Log.w(TAG, "Sending message: " + messageId);
|
Log.i(TAG, "Sending message: " + messageId);
|
||||||
|
|
||||||
deliver(record);
|
deliver(record);
|
||||||
} catch (UndeliverableMessageException ude) {
|
} catch (UndeliverableMessageException ude) {
|
||||||
@ -106,8 +106,8 @@ public class SmsSendJob extends SendJob {
|
|||||||
getSmsManagerFor(message.getSubscriptionId()).sendMultipartTextMessage(recipient, null, messages, sentIntents, deliveredIntents);
|
getSmsManagerFor(message.getSubscriptionId()).sendMultipartTextMessage(recipient, null, messages, sentIntents, deliveredIntents);
|
||||||
} catch (NullPointerException | IllegalArgumentException npe) {
|
} catch (NullPointerException | IllegalArgumentException npe) {
|
||||||
Log.w(TAG, npe);
|
Log.w(TAG, npe);
|
||||||
Log.w(TAG, "Recipient: " + recipient);
|
Log.i(TAG, "Recipient: " + recipient);
|
||||||
Log.w(TAG, "Message Parts: " + messages.size());
|
Log.i(TAG, "Message Parts: " + messages.size());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (int i=0;i<messages.size();i++) {
|
for (int i=0;i<messages.size();i++) {
|
||||||
|
@ -43,7 +43,7 @@ public class SmsSentJob extends MasterSecretJob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRun(MasterSecret masterSecret) {
|
public void onRun(MasterSecret masterSecret) {
|
||||||
Log.w(TAG, "Got SMS callback: " + action + " , " + result);
|
Log.i(TAG, "Got SMS callback: " + action + " , " + result);
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case SmsDeliveryListener.SENT_SMS_ACTION:
|
case SmsDeliveryListener.SENT_SMS_ACTION:
|
||||||
|
@ -52,7 +52,7 @@ public class UpdateApkJob extends ContextJob {
|
|||||||
public void onRun() throws IOException, PackageManager.NameNotFoundException {
|
public void onRun() throws IOException, PackageManager.NameNotFoundException {
|
||||||
if (!BuildConfig.PLAY_STORE_DISABLED) return;
|
if (!BuildConfig.PLAY_STORE_DISABLED) return;
|
||||||
|
|
||||||
Log.w(TAG, "Checking for APK update...");
|
Log.i(TAG, "Checking for APK update...");
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder().url(String.format("%s/latest.json", BuildConfig.NOPLAY_UPDATE_URL)).build();
|
Request request = new Request.Builder().url(String.format("%s/latest.json", BuildConfig.NOPLAY_UPDATE_URL)).build();
|
||||||
@ -66,18 +66,18 @@ public class UpdateApkJob extends ContextJob {
|
|||||||
UpdateDescriptor updateDescriptor = JsonUtils.fromJson(response.body().string(), UpdateDescriptor.class);
|
UpdateDescriptor updateDescriptor = JsonUtils.fromJson(response.body().string(), UpdateDescriptor.class);
|
||||||
byte[] digest = Hex.fromStringCondensed(updateDescriptor.getDigest());
|
byte[] digest = Hex.fromStringCondensed(updateDescriptor.getDigest());
|
||||||
|
|
||||||
Log.w(TAG, "Got descriptor: " + updateDescriptor);
|
Log.i(TAG, "Got descriptor: " + updateDescriptor);
|
||||||
|
|
||||||
if (updateDescriptor.getVersionCode() > getVersionCode()) {
|
if (updateDescriptor.getVersionCode() > getVersionCode()) {
|
||||||
DownloadStatus downloadStatus = getDownloadStatus(updateDescriptor.getUrl(), digest);
|
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) {
|
if (downloadStatus.getStatus() == DownloadStatus.Status.COMPLETE) {
|
||||||
Log.w(TAG, "Download status complete, notifying...");
|
Log.i(TAG, "Download status complete, notifying...");
|
||||||
handleDownloadNotify(downloadStatus.getDownloadId());
|
handleDownloadNotify(downloadStatus.getDownloadId());
|
||||||
} else if (downloadStatus.getStatus() == DownloadStatus.Status.MISSING) {
|
} 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);
|
handleDownloadStart(updateDescriptor.getUrl(), updateDescriptor.getVersionName(), digest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,14 +162,14 @@ public class AttachmentManager {
|
|||||||
|
|
||||||
private void cleanup(final @Nullable Uri uri) {
|
private void cleanup(final @Nullable Uri uri) {
|
||||||
if (uri != null && PersistentBlobProvider.isAuthority(context, 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);
|
PersistentBlobProvider.getInstance(context).delete(context, uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void markGarbage(@Nullable Uri uri) {
|
private void markGarbage(@Nullable Uri uri) {
|
||||||
if (uri != null && PersistentBlobProvider.isAuthority(context, 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);
|
garbage.add(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ public class AttachmentManager {
|
|||||||
height = dimens.second;
|
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);
|
return mediaType.createSlide(context, uri, fileName, mimeType, fileSize, width, height);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@ -337,7 +337,7 @@ public class AttachmentManager {
|
|||||||
height = dimens.second;
|
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);
|
return mediaType.createSlide(context, uri, fileName, mimeType, mediaSize, width, height);
|
||||||
}
|
}
|
||||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
@ -435,7 +435,7 @@ public class AttachmentManager {
|
|||||||
if (captureUri == null) {
|
if (captureUri == null) {
|
||||||
captureUri = PersistentBlobProvider.getInstance(context).createForExternal(context, MediaUtil.IMAGE_JPEG);
|
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);
|
captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, captureUri);
|
||||||
activity.startActivityForResult(captureIntent, requestCode);
|
activity.startActivityForResult(captureIntent, requestCode);
|
||||||
}
|
}
|
||||||
|
@ -31,17 +31,17 @@ public class CompatMmsConnection implements OutgoingMmsConnection, IncomingMmsCo
|
|||||||
{
|
{
|
||||||
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) {
|
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) {
|
||||||
try {
|
try {
|
||||||
Log.w(TAG, "Sending via Lollipop API");
|
Log.i(TAG, "Sending via Lollipop API");
|
||||||
return new OutgoingLollipopMmsConnection(context).send(pduBytes, subscriptionId);
|
return new OutgoingLollipopMmsConnection(context).send(pduBytes, subscriptionId);
|
||||||
} catch (UndeliverableMessageException e) {
|
} catch (UndeliverableMessageException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Falling back to legacy connection...");
|
Log.i(TAG, "Falling back to legacy connection...");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subscriptionId == -1) {
|
if (subscriptionId == -1) {
|
||||||
Log.w(TAG, "Sending via legacy connection");
|
Log.i(TAG, "Sending via legacy connection");
|
||||||
try {
|
try {
|
||||||
SendConf result = new OutgoingLegacyMmsConnection(context).send(pduBytes, subscriptionId);
|
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) {
|
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);
|
return new OutgoingLollipopMmsConnection(context).send(pduBytes, subscriptionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,18 +71,18 @@ public class CompatMmsConnection implements OutgoingMmsConnection, IncomingMmsCo
|
|||||||
throws MmsException, MmsRadioException, ApnUnavailableException, IOException
|
throws MmsException, MmsRadioException, ApnUnavailableException, IOException
|
||||||
{
|
{
|
||||||
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) {
|
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) {
|
||||||
Log.w(TAG, "Receiving via Lollipop API");
|
Log.i(TAG, "Receiving via Lollipop API");
|
||||||
try {
|
try {
|
||||||
return new IncomingLollipopMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
|
return new IncomingLollipopMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
|
||||||
} catch (MmsException e) {
|
} catch (MmsException e) {
|
||||||
Log.w(TAG, 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) {
|
if (VERSION.SDK_INT < 22 || subscriptionId == -1) {
|
||||||
Log.w(TAG, "Receiving via legacy API");
|
Log.i(TAG, "Receiving via legacy API");
|
||||||
try {
|
try {
|
||||||
return new IncomingLegacyMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
|
return new IncomingLegacyMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
|
||||||
} catch (MmsRadioException | ApnUnavailableException | IOException e) {
|
} 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) {
|
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);
|
return new IncomingLollipopMmsConnection(context).retrieve(contentLocation, transactionId, subscriptionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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());
|
Apn contentApn = new Apn(contentLocation, apn.getProxy(), Integer.toString(apn.getPort()), apn.getUsername(), apn.getPassword());
|
||||||
|
|
||||||
if (isDirectConnect()) {
|
if (isDirectConnect()) {
|
||||||
Log.w(TAG, "Connecting directly...");
|
Log.i(TAG, "Connecting directly...");
|
||||||
try {
|
try {
|
||||||
return retrieve(contentApn, transactionId, false, false);
|
return retrieve(contentApn, transactionId, false, false);
|
||||||
} catch (IOException | ApnUnavailableException e) {
|
} 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();
|
radio.connect();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Log.w(TAG, "Downloading in MMS mode with proxy...");
|
Log.i(TAG, "Downloading in MMS mode with proxy...");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return retrieve(contentApn, transactionId, true, true);
|
return retrieve(contentApn, transactionId, true, true);
|
||||||
@ -98,7 +98,7 @@ public class IncomingLegacyMmsConnection extends LegacyMmsConnection implements
|
|||||||
Log.w(TAG, e);
|
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);
|
return retrieve(contentApn, transactionId, true, false);
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ public class IncomingLegacyMmsConnection extends LegacyMmsConnection implements
|
|||||||
? contentApn.getProxy()
|
? contentApn.getProxy()
|
||||||
: Uri.parse(contentApn.getMmsc()).getHost();
|
: Uri.parse(contentApn.getMmsc()).getHost();
|
||||||
if (checkRouteToHost(context, targetHost, usingMmsRadio)) {
|
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));
|
pdu = execute(constructRequest(contentApn, useProxy));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,9 +54,9 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme
|
|||||||
@Override
|
@Override
|
||||||
public synchronized void onResult(Context context, Intent intent) {
|
public synchronized void onResult(Context context, Intent intent) {
|
||||||
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) {
|
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
|
@Override
|
||||||
@ -70,7 +70,7 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme
|
|||||||
try {
|
try {
|
||||||
MmsBodyProvider.Pointer pointer = MmsBodyProvider.makeTemporaryPointer(getContext());
|
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;
|
SmsManager smsManager;
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ public class IncomingLollipopMmsConnection extends LollipopMmsConnection impleme
|
|||||||
Util.copy(pointer.getInputStream(), baos);
|
Util.copy(pointer.getInputStream(), baos);
|
||||||
pointer.close();
|
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();
|
RetrieveConf retrieved = (RetrieveConf) new PduParser(baos.toByteArray()).parse();
|
||||||
|
|
||||||
|
@ -127,13 +127,13 @@ public abstract class LegacyMmsConnection {
|
|||||||
return true;
|
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);
|
ConnectivityManager manager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final Method requestRouteMethod = manager.getClass().getMethod("requestRouteToHostAddress", Integer.TYPE, InetAddress.class);
|
final Method requestRouteMethod = manager.getClass().getMethod("requestRouteToHostAddress", Integer.TYPE, InetAddress.class);
|
||||||
final boolean routeToHostObtained = (Boolean) requestRouteMethod.invoke(manager, MmsRadio.TYPE_MOBILE_MMS, inetAddress);
|
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;
|
return routeToHostObtained;
|
||||||
} catch (NoSuchMethodException nsme) {
|
} catch (NoSuchMethodException nsme) {
|
||||||
Log.w(TAG, nsme);
|
Log.w(TAG, nsme);
|
||||||
@ -151,7 +151,7 @@ public abstract class LegacyMmsConnection {
|
|||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
Util.copy(in, baos);
|
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();
|
return baos.toByteArray();
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ public abstract class LegacyMmsConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected byte[] execute(HttpUriRequest request) throws IOException {
|
protected byte[] execute(HttpUriRequest request) throws IOException {
|
||||||
Log.w(TAG, "connecting to " + apn.getMmsc());
|
Log.i(TAG, "connecting to " + apn.getMmsc());
|
||||||
|
|
||||||
CloseableHttpClient client = null;
|
CloseableHttpClient client = null;
|
||||||
CloseableHttpResponse response = null;
|
CloseableHttpResponse response = null;
|
||||||
@ -191,7 +191,7 @@ public abstract class LegacyMmsConnection {
|
|||||||
client = constructHttpClient();
|
client = constructHttpClient();
|
||||||
response = client.execute(request);
|
response = client.execute(request);
|
||||||
|
|
||||||
Log.w(TAG, "* response code: " + response.getStatusLine());
|
Log.i(TAG, "* response code: " + response.getStatusLine());
|
||||||
|
|
||||||
if (response.getStatusLine().getStatusCode() == 200) {
|
if (response.getStatusLine().getStatusCode() == 200) {
|
||||||
return parseResponse(response.getEntity().getContent());
|
return parseResponse(response.getEntity().getContent());
|
||||||
|
@ -45,7 +45,7 @@ public abstract class LollipopMmsConnection extends BroadcastReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void onReceive(Context context, Intent intent) {
|
public synchronized void onReceive(Context context, Intent intent) {
|
||||||
Log.w(TAG, "onReceive()");
|
Log.i(TAG, "onReceive()");
|
||||||
if (!action.equals(intent.getAction())) {
|
if (!action.equals(intent.getAction())) {
|
||||||
Log.w(TAG, "received broadcast with unexpected action " + intent.getAction());
|
Log.w(TAG, "received broadcast with unexpected action " + intent.getAction());
|
||||||
return;
|
return;
|
||||||
|
@ -49,14 +49,14 @@ public class MmsRadio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void disconnect() {
|
public synchronized void disconnect() {
|
||||||
Log.w("MmsRadio", "MMS Radio Disconnect Called...");
|
Log.i(TAG, "MMS Radio Disconnect Called...");
|
||||||
wakeLock.release();
|
wakeLock.release();
|
||||||
connectedCounter--;
|
connectedCounter--;
|
||||||
|
|
||||||
Log.w("MmsRadio", "Reference count: " + connectedCounter);
|
Log.i(TAG, "Reference count: " + connectedCounter);
|
||||||
|
|
||||||
if (connectedCounter == 0) {
|
if (connectedCounter == 0) {
|
||||||
Log.w("MmsRadio", "Turning off MMS radio...");
|
Log.i(TAG, "Turning off MMS radio...");
|
||||||
try {
|
try {
|
||||||
final Method stopUsingNetworkFeatureMethod = connectivityManager.getClass().getMethod("stopUsingNetworkFeature", Integer.TYPE, String.class);
|
final Method stopUsingNetworkFeatureMethod = connectivityManager.getClass().getMethod("stopUsingNetworkFeature", Integer.TYPE, String.class);
|
||||||
stopUsingNetworkFeatureMethod.invoke(connectivityManager, ConnectivityManager.TYPE_MOBILE, FEATURE_ENABLE_MMS);
|
stopUsingNetworkFeatureMethod.invoke(connectivityManager, ConnectivityManager.TYPE_MOBILE, FEATURE_ENABLE_MMS);
|
||||||
@ -69,7 +69,7 @@ public class MmsRadio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (connectivityListener != null) {
|
if (connectivityListener != null) {
|
||||||
Log.w("MmsRadio", "Unregistering receiver...");
|
Log.i(TAG, "Unregistering receiver...");
|
||||||
context.unregisterReceiver(connectivityListener);
|
context.unregisterReceiver(connectivityListener);
|
||||||
connectivityListener = null;
|
connectivityListener = null;
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ public class MmsRadio {
|
|||||||
throw new MmsRadioException(ite);
|
throw new MmsRadioException(ite);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w("MmsRadio", "startUsingNetworkFeature status: " + status);
|
Log.i(TAG, "startUsingNetworkFeature status: " + status);
|
||||||
|
|
||||||
if (status == APN_ALREADY_ACTIVE) {
|
if (status == APN_ALREADY_ACTIVE) {
|
||||||
wakeLock.acquire();
|
wakeLock.acquire();
|
||||||
@ -109,7 +109,7 @@ public class MmsRadio {
|
|||||||
Util.wait(this, 30000);
|
Util.wait(this, 30000);
|
||||||
|
|
||||||
if (!isConnected()) {
|
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();
|
disconnect();
|
||||||
throw new MmsRadioException("Unable to successfully enable MMS radio.");
|
throw new MmsRadioException("Unable to successfully enable MMS radio.");
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ public class MmsRadio {
|
|||||||
private boolean isConnected() {
|
private boolean isConnected() {
|
||||||
NetworkInfo info = connectivityManager.getNetworkInfo(TYPE_MOBILE_MMS);
|
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())
|
if ((info == null) || (info.getType() != TYPE_MOBILE_MMS) || !info.isConnected())
|
||||||
return false;
|
return false;
|
||||||
@ -141,13 +141,13 @@ public class MmsRadio {
|
|||||||
|
|
||||||
private synchronized void issueConnectivityChange() {
|
private synchronized void issueConnectivityChange() {
|
||||||
if (isConnected()) {
|
if (isConnected()) {
|
||||||
Log.w("MmsRadio", "Notifying connected...");
|
Log.i(TAG, "Notifying connected...");
|
||||||
notifyAll();
|
notifyAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isConnected() && (isConnectivityFailure() || !isConnectivityPossible())) {
|
if (!isConnected() && (isConnectivityFailure() || !isConnectivityPossible())) {
|
||||||
Log.w("MmsRadio", "Notifying not connected...");
|
Log.i(TAG, "Notifying not connected...");
|
||||||
notifyAll();
|
notifyAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ public class MmsRadio {
|
|||||||
private class ConnectivityListener extends BroadcastReceiver {
|
private class ConnectivityListener extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
Log.w("MmsRadio", "Got connectivity change...");
|
Log.i(TAG, "Got connectivity change...");
|
||||||
issueConnectivityChange();
|
issueConnectivityChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class OutgoingLegacyMmsConnection extends LegacyMmsConnection implements
|
|||||||
MmsRadio radio = MmsRadio.getInstance(context);
|
MmsRadio radio = MmsRadio.getInstance(context);
|
||||||
|
|
||||||
if (isDirectConnect()) {
|
if (isDirectConnect()) {
|
||||||
Log.w(TAG, "Sending MMS directly without radio change...");
|
Log.i(TAG, "Sending MMS directly without radio change...");
|
||||||
try {
|
try {
|
||||||
return send(pduBytes, false, false);
|
return send(pduBytes, false, false);
|
||||||
} catch (IOException e) {
|
} 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();
|
radio.connect();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -96,7 +96,7 @@ public class OutgoingLegacyMmsConnection extends LegacyMmsConnection implements
|
|||||||
Log.w(TAG, e);
|
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 {
|
try {
|
||||||
return send(pduBytes, true, false);
|
return send(pduBytes, true, false);
|
||||||
@ -126,13 +126,13 @@ public class OutgoingLegacyMmsConnection extends LegacyMmsConnection implements
|
|||||||
? apn.getProxy()
|
? apn.getProxy()
|
||||||
: Uri.parse(apn.getMmsc()).getHost();
|
: 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" : "")
|
+ (useMmsRadio ? ", using mms radio" : "")
|
||||||
+ (useProxy ? ", using proxy" : ""));
|
+ (useProxy ? ", using proxy" : ""));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (checkRouteToHost(context, targetHost, useMmsRadio)) {
|
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));
|
byte[] response = execute(constructRequest(pduBytes, useProxy));
|
||||||
if (response != null) return response;
|
if (response != null) return response;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class OutgoingLollipopMmsConnection extends LollipopMmsConnection impleme
|
|||||||
@Override
|
@Override
|
||||||
public synchronized void onResult(Context context, Intent intent) {
|
public synchronized void onResult(Context context, Intent intent) {
|
||||||
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) {
|
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);
|
response = intent.getByteArrayExtra(SmsManager.EXTRA_MMS_DATA);
|
||||||
@ -96,7 +96,7 @@ public class OutgoingLollipopMmsConnection extends LollipopMmsConnection impleme
|
|||||||
|
|
||||||
waitForResult();
|
waitForResult();
|
||||||
|
|
||||||
Log.w(TAG, "MMS broadcast received and processed.");
|
Log.i(TAG, "MMS broadcast received and processed.");
|
||||||
pointer.close();
|
pointer.close();
|
||||||
|
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
|
@ -50,7 +50,7 @@ public class MarkReadReceiver extends BroadcastReceiver {
|
|||||||
List<MarkedMessageInfo> messageIdsCollection = new LinkedList<>();
|
List<MarkedMessageInfo> messageIdsCollection = new LinkedList<>();
|
||||||
|
|
||||||
for (long threadId : threadIds) {
|
for (long threadId : threadIds) {
|
||||||
Log.w(TAG, "Marking as read: " + threadId);
|
Log.i(TAG, "Marking as read: " + threadId);
|
||||||
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setRead(threadId, true);
|
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setRead(threadId, true);
|
||||||
messageIdsCollection.addAll(messageIds);
|
messageIdsCollection.addAll(messageIds);
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ public class MessageNotifier {
|
|||||||
public static void updateNotification(@NonNull Context context, long threadId)
|
public static void updateNotification(@NonNull Context context, long threadId)
|
||||||
{
|
{
|
||||||
if (System.currentTimeMillis() - lastDesktopActivityTimestamp < DESKTOP_ACTIVITY_PERIOD) {
|
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));
|
executor.execute(new DelayedNotification(context, threadId));
|
||||||
} else {
|
} else {
|
||||||
updateNotification(context, threadId, true);
|
updateNotification(context, threadId, true);
|
||||||
@ -526,14 +526,14 @@ public class MessageNotifier {
|
|||||||
MessageNotifier.updateNotification(context);
|
MessageNotifier.updateNotification(context);
|
||||||
|
|
||||||
long delayMillis = delayUntil - System.currentTimeMillis();
|
long delayMillis = delayUntil - System.currentTimeMillis();
|
||||||
Log.w(TAG, "Waiting to notify: " + delayMillis);
|
Log.i(TAG, "Waiting to notify: " + delayMillis);
|
||||||
|
|
||||||
if (delayMillis > 0) {
|
if (delayMillis > 0) {
|
||||||
Util.sleep(delayMillis);
|
Util.sleep(delayMillis);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!canceled.get()) {
|
if (!canceled.get()) {
|
||||||
Log.w(TAG, "Not canceled, notifying...");
|
Log.i(TAG, "Not canceled, notifying...");
|
||||||
MessageNotifier.updateNotification(context, threadId, true);
|
MessageNotifier.updateNotification(context, threadId, true);
|
||||||
MessageNotifier.cancelDelayedNotifications();
|
MessageNotifier.cancelDelayedNotifications();
|
||||||
} else {
|
} else {
|
||||||
|
@ -19,6 +19,8 @@ import java.util.List;
|
|||||||
|
|
||||||
public class NotificationState {
|
public class NotificationState {
|
||||||
|
|
||||||
|
private static final String TAG = NotificationState.class.getSimpleName();
|
||||||
|
|
||||||
private final LinkedList<NotificationItem> notifications = new LinkedList<>();
|
private final LinkedList<NotificationItem> notifications = new LinkedList<>();
|
||||||
private final LinkedHashSet<Long> threads = new LinkedHashSet<>();
|
private final LinkedHashSet<Long> threads = new LinkedHashSet<>();
|
||||||
|
|
||||||
@ -102,7 +104,7 @@ public class NotificationState {
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
for (long thread : threads) {
|
for (long thread : threads) {
|
||||||
Log.w("NotificationState", "Added thread: " + thread);
|
Log.i(TAG, "Added thread: " + thread);
|
||||||
threadArray[index++] = thread;
|
threadArray[index++] = thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +147,7 @@ public class NotificationState {
|
|||||||
long[] threadArray = new long[threads.size()];
|
long[] threadArray = new long[threads.size()];
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (long thread : threads) {
|
for (long thread : threads) {
|
||||||
Log.w("NotificationState", "getAndroidAutoHeardIntent Added thread: " + thread);
|
Log.i(TAG, "getAndroidAutoHeardIntent Added thread: " + thread);
|
||||||
threadArray[index++] = thread;
|
threadArray[index++] = thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public class AdvancedPreferenceFragment extends CorrectedPreferenceFragment {
|
|||||||
public void onActivityResult(int reqCode, int resultCode, Intent data) {
|
public void onActivityResult(int reqCode, int resultCode, Intent data) {
|
||||||
super.onActivityResult(reqCode, resultCode, 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) {
|
if (resultCode == Activity.RESULT_OK && reqCode == PICK_IDENTITY_CONTACT) {
|
||||||
handleIdentitySelection(data);
|
handleIdentitySelection(data);
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
|
|||||||
.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
.ifNecessary()
|
.ifNecessary()
|
||||||
.onAllGranted(() -> {
|
.onAllGranted(() -> {
|
||||||
Log.w(TAG, "Queing backup...");
|
Log.i(TAG, "Queing backup...");
|
||||||
ApplicationContext.getInstance(getContext())
|
ApplicationContext.getInstance(getContext())
|
||||||
.getJobManager()
|
.getJobManager()
|
||||||
.add(new LocalBackupJob(getContext()));
|
.add(new LocalBackupJob(getContext()));
|
||||||
@ -198,7 +198,7 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
|
|||||||
private class MediaDownloadChangeListener implements Preference.OnPreferenceChangeListener {
|
private class MediaDownloadChangeListener implements Preference.OnPreferenceChangeListener {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override public boolean onPreferenceChange(Preference preference, Object newValue) {
|
@Override public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
Log.w(TAG, "onPreferenceChange");
|
Log.i(TAG, "onPreferenceChange");
|
||||||
preference.setSummary(getSummaryForMediaPreference((Set<String>)newValue));
|
preference.setSummary(getSummaryForMediaPreference((Set<String>)newValue));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -57,11 +57,11 @@ public class MmsBodyProvider extends ContentProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
|
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)) {
|
switch (uriMatcher.match(uri)) {
|
||||||
case SINGLE_ROW:
|
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);
|
File tmpFile = getFile(uri);
|
||||||
|
|
||||||
final int fileMode;
|
final int fileMode;
|
||||||
@ -73,7 +73,7 @@ public class MmsBodyProvider extends ContentProvider {
|
|||||||
default: throw new IllegalArgumentException("requested file mode unsupported");
|
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);
|
return ParcelFileDescriptor.open(tmpFile, fileMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class PartProvider extends ContentProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreate() {
|
public boolean onCreate() {
|
||||||
Log.w(TAG, "onCreate()");
|
Log.i(TAG, "onCreate()");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ public class PartProvider extends ContentProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode) throws FileNotFoundException {
|
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())) {
|
if (KeyCachingService.isLocked(getContext())) {
|
||||||
Log.w(TAG, "masterSecret was null, abandoning.");
|
Log.w(TAG, "masterSecret was null, abandoning.");
|
||||||
@ -79,7 +79,7 @@ public class PartProvider extends ContentProvider {
|
|||||||
|
|
||||||
switch (uriMatcher.match(uri)) {
|
switch (uriMatcher.match(uri)) {
|
||||||
case SINGLE_ROW:
|
case SINGLE_ROW:
|
||||||
Log.w(TAG, "Parting out a single row...");
|
Log.i(TAG, "Parting out a single row...");
|
||||||
try {
|
try {
|
||||||
final PartUriParser partUri = new PartUriParser(uri);
|
final PartUriParser partUri = new PartUriParser(uri);
|
||||||
return getParcelStreamForAttachment(partUri.getPartId());
|
return getParcelStreamForAttachment(partUri.getPartId());
|
||||||
@ -94,13 +94,13 @@ public class PartProvider extends ContentProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delete(@NonNull Uri arg0, String arg1, String[] arg2) {
|
public int delete(@NonNull Uri arg0, String arg1, String[] arg2) {
|
||||||
Log.w(TAG, "delete() called");
|
Log.i(TAG, "delete() called");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getType(@NonNull Uri uri) {
|
public String getType(@NonNull Uri uri) {
|
||||||
Log.w(TAG, "getType() called: " + uri);
|
Log.i(TAG, "getType() called: " + uri);
|
||||||
|
|
||||||
switch (uriMatcher.match(uri)) {
|
switch (uriMatcher.match(uri)) {
|
||||||
case SINGLE_ROW:
|
case SINGLE_ROW:
|
||||||
@ -118,13 +118,13 @@ public class PartProvider extends ContentProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Uri insert(@NonNull Uri arg0, ContentValues arg1) {
|
public Uri insert(@NonNull Uri arg0, ContentValues arg1) {
|
||||||
Log.w(TAG, "insert() called");
|
Log.i(TAG, "insert() called");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cursor query(@NonNull Uri url, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
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;
|
if (projection == null || projection.length <= 0) return null;
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ public class PartProvider extends ContentProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(@NonNull Uri arg0, ContentValues arg1, String arg2, String[] arg3) {
|
public int update(@NonNull Uri arg0, ContentValues arg1, String arg2, String[] arg3) {
|
||||||
Log.w(TAG, "update() called");
|
Log.i(TAG, "update() called");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ import org.thoughtcrime.securesms.logging.Log;
|
|||||||
*/
|
*/
|
||||||
public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
|
public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
|
||||||
|
|
||||||
|
private static final String TAG = TwoFingerGestureDetector.class.getSimpleName();
|
||||||
|
|
||||||
private final float mEdgeSlop;
|
private final float mEdgeSlop;
|
||||||
protected float mPrevFingerDiffX;
|
protected float mPrevFingerDiffX;
|
||||||
protected float mPrevFingerDiffY;
|
protected float mPrevFingerDiffY;
|
||||||
@ -134,7 +136,7 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
|
|||||||
final float y1 = getRawY(event, 1);
|
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",
|
String.format("x0: %f, y0: %f, x1: %f, y1: %f, EdgeSlop: %f, RightSlop: %f, BottomSlop: %f",
|
||||||
x0, y0, x1, y1, edgeSlop, rightSlop, bottomSlop));
|
x0, y0, x1, y1, edgeSlop, rightSlop, bottomSlop));
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class Layer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void postScale(float scaleDiff) {
|
public void postScale(float scaleDiff) {
|
||||||
Log.w("Layer", "ScaleDiff: " + scaleDiff);
|
Log.i("Layer", "ScaleDiff: " + scaleDiff);
|
||||||
float newVal = scale + scaleDiff;
|
float newVal = scale + scaleDiff;
|
||||||
if (newVal >= getMinScale() && newVal <= getMaxScale()) {
|
if (newVal >= getMinScale() && newVal <= getMaxScale()) {
|
||||||
scale = newVal;
|
scale = newVal;
|
||||||
|
@ -444,7 +444,7 @@ public class MotionView extends FrameLayout implements TextWatcher {
|
|||||||
public boolean onScale(ScaleGestureDetector detector) {
|
public boolean onScale(ScaleGestureDetector detector) {
|
||||||
if (selectedEntity != null) {
|
if (selectedEntity != null) {
|
||||||
float scaleFactorDiff = detector.getScaleFactor();
|
float scaleFactorDiff = detector.getScaleFactor();
|
||||||
Log.w(TAG, "ScaleFactorDiff: " + scaleFactorDiff);
|
Log.d(TAG, "ScaleFactorDiff: " + scaleFactorDiff);
|
||||||
selectedEntity.getLayer().postScale(scaleFactorDiff - 1.0F);
|
selectedEntity.getLayer().postScale(scaleFactorDiff - 1.0F);
|
||||||
selectedEntity.updateEntity();
|
selectedEntity.updateEntity();
|
||||||
updateUI();
|
updateUI();
|
||||||
|
@ -126,7 +126,7 @@ public class KeyCachingService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
if (intent == null) return START_NOT_STICKY;
|
if (intent == null) return START_NOT_STICKY;
|
||||||
Log.w("KeyCachingService", "onStartCommand, " + intent.getAction());
|
Log.d(TAG, "onStartCommand, " + intent.getAction());
|
||||||
|
|
||||||
if (intent.getAction() != null) {
|
if (intent.getAction() != null) {
|
||||||
switch (intent.getAction()) {
|
switch (intent.getAction()) {
|
||||||
@ -145,7 +145,7 @@ public class KeyCachingService extends Service {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
Log.w("KeyCachingService", "onCreate()");
|
Log.i(TAG, "onCreate()");
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
this.pending = PendingIntent.getService(this, 0, new Intent(PASSPHRASE_EXPIRED_EVENT, null,
|
this.pending = PendingIntent.getService(this, 0, new Intent(PASSPHRASE_EXPIRED_EVENT, null,
|
||||||
this, KeyCachingService.class), 0);
|
this, KeyCachingService.class), 0);
|
||||||
@ -163,7 +163,7 @@ public class KeyCachingService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
Log.w("KeyCachingService", "KCS Is Being Destroyed!");
|
Log.w(TAG, "KCS Is Being Destroyed!");
|
||||||
handleClearKey();
|
handleClearKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ public class KeyCachingService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleActivityStarted() {
|
private void handleActivityStarted() {
|
||||||
Log.w("KeyCachingService", "Incrementing activity count...");
|
Log.d(TAG, "Incrementing activity count...");
|
||||||
|
|
||||||
AlarmManager alarmManager = ServiceUtil.getAlarmManager(this);
|
AlarmManager alarmManager = ServiceUtil.getAlarmManager(this);
|
||||||
alarmManager.cancel(pending);
|
alarmManager.cancel(pending);
|
||||||
@ -187,7 +187,7 @@ public class KeyCachingService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleActivityStopped() {
|
private void handleActivityStopped() {
|
||||||
Log.w("KeyCachingService", "Decrementing activity count...");
|
Log.d(TAG, "Decrementing activity count...");
|
||||||
|
|
||||||
activitiesRunning--;
|
activitiesRunning--;
|
||||||
startTimeoutIfAppropriate();
|
startTimeoutIfAppropriate();
|
||||||
@ -195,7 +195,7 @@ public class KeyCachingService extends Service {
|
|||||||
|
|
||||||
@SuppressLint("StaticFieldLeak")
|
@SuppressLint("StaticFieldLeak")
|
||||||
private void handleClearKey() {
|
private void handleClearKey() {
|
||||||
Log.w("KeyCachingService", "handleClearKey()");
|
Log.i(TAG, "handleClearKey()");
|
||||||
KeyCachingService.masterSecret = null;
|
KeyCachingService.masterSecret = null;
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ public class KeyCachingService extends Service {
|
|||||||
if (!TextSecurePreferences.isPasswordDisabled(this)) timeoutMillis = TimeUnit.MINUTES.toMillis(passphraseTimeoutMinutes);
|
if (!TextSecurePreferences.isPasswordDisabled(this)) timeoutMillis = TimeUnit.MINUTES.toMillis(passphraseTimeoutMinutes);
|
||||||
else timeoutMillis = TimeUnit.SECONDS.toMillis(screenLockTimeoutSeconds);
|
else timeoutMillis = TimeUnit.SECONDS.toMillis(screenLockTimeoutSeconds);
|
||||||
|
|
||||||
Log.w("KeyCachingService", "Starting timeout: " + timeoutMillis);
|
Log.i(TAG, "Starting timeout: " + timeoutMillis);
|
||||||
|
|
||||||
AlarmManager alarmManager = ServiceUtil.getAlarmManager(this);
|
AlarmManager alarmManager = ServiceUtil.getAlarmManager(this);
|
||||||
alarmManager.cancel(pending);
|
alarmManager.cancel(pending);
|
||||||
@ -263,7 +263,7 @@ public class KeyCachingService extends Service {
|
|||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||||
private void foregroundServiceModern() {
|
private void foregroundServiceModern() {
|
||||||
Log.w("KeyCachingService", "foregrounding KCS");
|
Log.i(TAG, "foregrounding KCS");
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
|
||||||
|
|
||||||
builder.setContentTitle(getString(R.string.KeyCachingService_passphrase_cached));
|
builder.setContentTitle(getString(R.string.KeyCachingService_passphrase_cached));
|
||||||
@ -322,7 +322,7 @@ public class KeyCachingService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void broadcastNewSecret() {
|
private void broadcastNewSecret() {
|
||||||
Log.w("service", "Broadcasting new secret...");
|
Log.i(TAG, "Broadcasting new secret...");
|
||||||
|
|
||||||
Intent intent = new Intent(NEW_KEY_EVENT);
|
Intent intent = new Intent(NEW_KEY_EVENT);
|
||||||
intent.setPackage(getApplicationContext().getPackageName());
|
intent.setPackage(getApplicationContext().getPackageName());
|
||||||
|
@ -116,13 +116,13 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|||||||
|
|
||||||
private synchronized void incrementActive() {
|
private synchronized void incrementActive() {
|
||||||
activeActivities++;
|
activeActivities++;
|
||||||
Log.w(TAG, "Active Count: " + activeActivities);
|
Log.d(TAG, "Active Count: " + activeActivities);
|
||||||
notifyAll();
|
notifyAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void decrementActive() {
|
private synchronized void decrementActive() {
|
||||||
activeActivities--;
|
activeActivities--;
|
||||||
Log.w(TAG, "Active Count: " + activeActivities);
|
Log.d(TAG, "Active Count: " + activeActivities);
|
||||||
notifyAll();
|
notifyAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|||||||
private synchronized boolean isConnectionNecessary() {
|
private synchronized boolean isConnectionNecessary() {
|
||||||
boolean isGcmDisabled = TextSecurePreferences.isGcmDisabled(this);
|
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));
|
networkRequirement.isPresent(), activeActivities, pushPending.size(), isGcmDisabled));
|
||||||
|
|
||||||
return TextSecurePreferences.isPushRegistered(this) &&
|
return TextSecurePreferences.isPushRegistered(this) &&
|
||||||
@ -195,10 +195,10 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
while (!stopThread.get()) {
|
while (!stopThread.get()) {
|
||||||
Log.w(TAG, "Waiting for websocket state change....");
|
Log.i(TAG, "Waiting for websocket state change....");
|
||||||
waitForConnectionNecessary();
|
waitForConnectionNecessary();
|
||||||
|
|
||||||
Log.w(TAG, "Making websocket connection....");
|
Log.i(TAG, "Making websocket connection....");
|
||||||
pipe = receiver.createMessagePipe();
|
pipe = receiver.createMessagePipe();
|
||||||
|
|
||||||
SignalServiceMessagePipe localPipe = pipe;
|
SignalServiceMessagePipe localPipe = pipe;
|
||||||
@ -206,10 +206,10 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|||||||
try {
|
try {
|
||||||
while (isConnectionNecessary() && !stopThread.get()) {
|
while (isConnectionNecessary() && !stopThread.get()) {
|
||||||
try {
|
try {
|
||||||
Log.w(TAG, "Reading message...");
|
Log.i(TAG, "Reading message...");
|
||||||
localPipe.read(REQUEST_TIMEOUT_MINUTES, TimeUnit.MINUTES,
|
localPipe.read(REQUEST_TIMEOUT_MINUTES, TimeUnit.MINUTES,
|
||||||
envelope -> {
|
envelope -> {
|
||||||
Log.w(TAG, "Retrieved envelope! " + envelope.getSource());
|
Log.i(TAG, "Retrieved envelope! " + envelope.getSource());
|
||||||
|
|
||||||
PushContentReceiveJob receiveJob = new PushContentReceiveJob(MessageRetrievalService.this);
|
PushContentReceiveJob receiveJob = new PushContentReceiveJob(MessageRetrievalService.this);
|
||||||
receiveJob.handle(envelope);
|
receiveJob.handle(envelope);
|
||||||
@ -229,10 +229,10 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|||||||
shutdown(localPipe);
|
shutdown(localPipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Looping...");
|
Log.i(TAG, "Looping...");
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Exiting...");
|
Log.i(TAG, "Exiting...");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopThread() {
|
private void stopThread() {
|
||||||
|
@ -55,14 +55,14 @@ public class MmsListener extends BroadcastReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
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()) &&
|
if ((Telephony.Sms.Intents.WAP_PUSH_DELIVER_ACTION.equals(intent.getAction()) &&
|
||||||
Util.isDefaultSmsProvider(context)) ||
|
Util.isDefaultSmsProvider(context)) ||
|
||||||
(Telephony.Sms.Intents.WAP_PUSH_RECEIVED_ACTION.equals(intent.getAction()) &&
|
(Telephony.Sms.Intents.WAP_PUSH_RECEIVED_ACTION.equals(intent.getAction()) &&
|
||||||
isRelevant(context, intent)))
|
isRelevant(context, intent)))
|
||||||
{
|
{
|
||||||
Log.w(TAG, "Relevant!");
|
Log.i(TAG, "Relevant!");
|
||||||
int subscriptionId = intent.getExtras().getInt("subscription", -1);
|
int subscriptionId = intent.getExtras().getInt("subscription", -1);
|
||||||
|
|
||||||
ApplicationContext.getInstance(context)
|
ApplicationContext.getInstance(context)
|
||||||
|
@ -26,7 +26,7 @@ public abstract class PersistentAlarmManagerListener extends BroadcastReceiver {
|
|||||||
scheduledTime = onAlarm(context, scheduledTime);
|
scheduledTime = onAlarm(context, scheduledTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, getClass() + " scheduling for: " + scheduledTime);
|
Log.i(TAG, getClass() + " scheduling for: " + scheduledTime);
|
||||||
|
|
||||||
alarmManager.cancel(pendingIntent);
|
alarmManager.cancel(pendingIntent);
|
||||||
alarmManager.set(AlarmManager.RTC_WAKEUP, scheduledTime, pendingIntent);
|
alarmManager.set(AlarmManager.RTC_WAKEUP, scheduledTime, pendingIntent);
|
||||||
|
@ -46,7 +46,7 @@ public class SmsDeliveryListener extends BroadcastReceiver {
|
|||||||
|
|
||||||
int status = message.getStatus();
|
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()
|
// 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"
|
// " CDMA: For not interfering with status codes from GSM, the value is shifted to the bits 31-16"
|
||||||
|
@ -142,7 +142,7 @@ public class SmsListener extends BroadcastReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
Log.w("SMSListener", "Got SMS broadcast...");
|
Log.i("SMSListener", "Got SMS broadcast...");
|
||||||
|
|
||||||
String messageBody = getSmsMessageBodyFromIntent(intent);
|
String messageBody = getSmsMessageBodyFromIntent(intent);
|
||||||
if (SMS_RECEIVED_ACTION.equals(intent.getAction()) && isChallenge(context, messageBody)) {
|
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)) ||
|
} else if ((intent.getAction().equals(SMS_DELIVERED_ACTION)) ||
|
||||||
(intent.getAction().equals(SMS_RECEIVED_ACTION)) && isRelevant(context, intent))
|
(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");
|
Object[] pdus = (Object[]) intent.getExtras().get("pdus");
|
||||||
int subscriptionId = intent.getExtras().getInt("subscription", -1);
|
int subscriptionId = intent.getExtras().getInt("subscription", -1);
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class UpdateApkReadyListener extends BroadcastReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
Log.w(TAG, "onReceive()");
|
Log.i(TAG, "onReceive()");
|
||||||
|
|
||||||
if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(intent.getAction())) {
|
if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(intent.getAction())) {
|
||||||
long downloadId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -2);
|
long downloadId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -2);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user