Messaging: We don't need to check for verbose logging everywhere

We can just do this in the actual method

Change-Id: I80e89b0ab97926749851628b1bd34e8cd9dc82f2
This commit is contained in:
Michael W
2025-05-18 09:18:48 +00:00
parent 8613b6bcc8
commit c4bbba9441
39 changed files with 293 additions and 547 deletions
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1433,10 +1433,8 @@ public class BugleDatabaseOperations {
cursor.close();
}
}
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG,
"Updated draft message " + messageId + " for conversation " + conversationId);
}
LogUtil.v(TAG, "Updated draft message " + messageId + " for conversation "
+ conversationId);
return messageId;
}
@@ -1692,9 +1690,7 @@ public class BugleDatabaseOperations {
}
MessagingContentProvider.notifyConversationListChanged();
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Number of conversations refreshed:" + conversationIds.size());
}
LogUtil.v(TAG, "Number of conversations refreshed:" + conversationIds.size());
}
}
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -161,11 +161,9 @@ public class BugleNotifications {
*/
public static void update(final boolean silent, final String conversationId,
final int coverage) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Update: silent = " + silent
+ " conversationId = " + conversationId
+ " coverage = " + coverage);
}
LogUtil.v(TAG, "Update: silent = " + silent
+ " conversationId = " + conversationId
+ " coverage = " + coverage);
Assert.isNotMainThread();
checkInitialized();
if ((coverage & UPDATE_MESSAGES) != 0) {
@@ -219,9 +217,7 @@ public class BugleNotifications {
final NotificationState notifState = iter.next();
if (notifState.mType == type) {
notifState.mCanceled = true;
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Canceling pending notification");
}
LogUtil.v(TAG, "Canceling pending notification");
iter.remove();
}
}
@@ -369,11 +365,9 @@ public class BugleNotifications {
// conversation list), then play a notification beep at a low volume and don't display an
// actual notification.
if (softSound) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "processAndSend: fromConversationId == " +
"sCurrentlyDisplayedConversationId so NOT showing notification," +
" but playing soft sound. conversationId: " + conversationId);
}
LogUtil.v(TAG, "processAndSend: fromConversationId == " +
"sCurrentlyDisplayedConversationId so NOT showing notification," +
" but playing soft sound. conversationId: " + conversationId);
playObservableConversationNotificationSound(conversationId);
return;
}
@@ -708,17 +702,12 @@ public class BugleNotifications {
private static void fireOffNotification(final NotificationState notificationState,
final Bitmap attachmentBitmap, final Bitmap avatarBitmap, Bitmap avatarHiResBitmap) {
if (notificationState.mCanceled) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Firing off notification, but notification already canceled");
}
LogUtil.v(TAG, "Firing off notification, but notification already canceled");
return;
}
final Context context = Factory.get().getApplicationContext();
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "MMS picture loaded, bitmap: " + attachmentBitmap);
}
LogUtil.v(TAG, "MMS picture loaded, bitmap: " + attachmentBitmap);
final NotificationCompat.Builder notifBuilder = notificationState.mNotificationBuilder;
notifBuilder.setStyle(notificationState.mNotificationStyle);
@@ -759,9 +748,7 @@ public class BugleNotifications {
private static void setWearableGroupOptions(final NotificationCompat.Builder notifBuilder,
final NotificationState notificationState) {
final String groupKey = "groupkey";
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Group key (for wearables)=" + groupKey);
}
LogUtil.v(TAG, "Group key (for wearables)=" + groupKey);
if (notificationState instanceof MultiConversationNotificationState) {
notifBuilder.setGroup(groupKey).setGroupSummary(true);
} else if (notificationState instanceof BundledMessageNotificationState) {
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -817,9 +817,7 @@ public abstract class MessageNotificationState extends NotificationState {
null);
if (convMessageCursor != null && convMessageCursor.moveToFirst()) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "MessageNotificationState: Found unseen message notifications.");
}
LogUtil.v(TAG, "MessageNotificationState: Found unseen message notifications.");
final ConversationMessageData convMessageData =
new ConversationMessageData();
@@ -1021,9 +1019,7 @@ public abstract class MessageNotificationState extends NotificationState {
final ConversationInfoList convList = createConversationInfoList();
if (convList == null || convList.mConvInfos.size() == 0) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "MessageNotificationState: No unseen notifications");
}
LogUtil.v(TAG, "MessageNotificationState: No unseen notifications");
} else {
final ConversationLineInfo convInfo = convList.mConvInfos.get(0);
state = new MultiMessageNotificationState(convList);
@@ -1049,7 +1045,7 @@ public abstract class MessageNotificationState extends NotificationState {
}
}
}
if (state != null && LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
if (state != null) {
LogUtil.v(TAG, "MessageNotificationState: Notification state created"
+ ", title = "
+ (state.mTickerSender != null ? state.mTickerSender : state.mTitle)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,23 +53,16 @@ public class NoConfirmationSmsSendService extends IntentService {
@Override
protected void onHandleIntent(final Intent intent) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "NoConfirmationSmsSendService onHandleIntent");
}
LogUtil.v(TAG, "NoConfirmationSmsSendService onHandleIntent");
final String action = intent.getAction();
if (!TelephonyManager.ACTION_RESPOND_VIA_MESSAGE.equals(action)) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "NoConfirmationSmsSendService onHandleIntent wrong action: " +
action);
}
LogUtil.v(TAG, "NoConfirmationSmsSendService onHandleIntent wrong action: " + action);
return;
}
final Bundle extras = intent.getExtras();
if (extras == null) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Called to send SMS but no extras");
}
LogUtil.v(TAG, "Called to send SMS but no extras");
return;
}
@@ -87,9 +80,7 @@ public class NoConfirmationSmsSendService extends IntentService {
final String recipients = UriUtil.parseRecipientsFromSmsMmsUri(intent.getData());
if (TextUtils.isEmpty(recipients) && TextUtils.isEmpty(conversationId)) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Both conversationId and recipient(s) cannot be empty");
}
LogUtil.v(TAG, "Both conversationId and recipient(s) cannot be empty");
return;
}
@@ -97,9 +88,7 @@ public class NoConfirmationSmsSendService extends IntentService {
startActivity(new Intent(this, ConversationListActivity.class));
} else {
if (TextUtils.isEmpty(message)) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Message cannot be empty");
}
LogUtil.v(TAG, "Message cannot be empty");
return;
}
@@ -111,17 +100,13 @@ public class NoConfirmationSmsSendService extends IntentService {
} else {
MessageData messageData;
if (requiresMms) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Auto-sending MMS message in conversation: " +
conversationId);
}
LogUtil.v(TAG, "Auto-sending MMS message in conversation: " +
conversationId);
messageData = MessageData.createDraftMmsMessage(conversationId, selfId, message,
subject);
} else {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Auto-sending SMS message in conversation: " +
conversationId);
}
LogUtil.v(TAG, "Auto-sending SMS message in conversation: " +
conversationId);
messageData = MessageData.createDraftSmsMessage(conversationId, selfId,
message);
}
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -115,9 +115,7 @@ public class ParticipantRefresh {
@Override
public void onChange(final boolean selfChange) {
super.onChange(selfChange);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Contacts changed");
}
LogUtil.v(TAG, "Contacts changed");
mContactChanged = true;
}
@@ -143,11 +141,9 @@ public class ParticipantRefresh {
public static void refreshParticipantsIfNeeded() {
if (ParticipantRefresh.getNeedFullRefresh() &&
sFullRefreshScheduled.compareAndSet(false, true)) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Started full participant refresh");
}
LogUtil.v(TAG, "Started full participant refresh");
Executors.newSingleThreadExecutor().execute(sFullRefreshRunnable);
} else if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
} else {
LogUtil.v(TAG, "Skipped full participant refresh");
}
}
@@ -200,24 +196,20 @@ public class ParticipantRefresh {
*/
static void refreshParticipants(final int refreshMode) {
Assert.inRange(refreshMode, REFRESH_MODE_FULL, REFRESH_MODE_SELF_ONLY);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
switch (refreshMode) {
case REFRESH_MODE_FULL:
LogUtil.v(TAG, "Start full participant refresh");
break;
case REFRESH_MODE_INCREMENTAL:
LogUtil.v(TAG, "Start partial participant refresh");
break;
case REFRESH_MODE_SELF_ONLY:
LogUtil.v(TAG, "Start self participant refresh");
break;
}
switch (refreshMode) {
case REFRESH_MODE_FULL:
LogUtil.v(TAG, "Start full participant refresh");
break;
case REFRESH_MODE_INCREMENTAL:
LogUtil.v(TAG, "Start partial participant refresh");
break;
case REFRESH_MODE_SELF_ONLY:
LogUtil.v(TAG, "Start self participant refresh");
break;
}
if (!ContactUtil.hasReadContactsPermission() || !OsUtil.hasPhonePermission()) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Skipping participant referesh because of permissions");
}
LogUtil.v(TAG, "Skipping participant referesh because of permissions");
return;
}
@@ -281,9 +273,7 @@ public class ParticipantRefresh {
}
}
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "Number of participants refreshed:" + changedParticipants.size());
}
LogUtil.v(TAG, "Number of participants refreshed:" + changedParticipants.size());
// Refresh conversations for participants that are changed.
if (changedParticipants.size() > 0) {
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -167,10 +167,8 @@ public class SyncManager {
* @return - true if sync should start
*/
public synchronized boolean shouldSync(final boolean full, final long startTimestamp) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SyncManager: Checking shouldSync " + (full ? "full " : "")
+ "at " + startTimestamp);
}
LogUtil.v(TAG, "SyncManager: Checking shouldSync " + (full ? "full " : "")
+ "at " + startTimestamp);
if (full) {
final long delayUntilFullSync = delayUntilFullSync(startTimestamp);
@@ -342,11 +340,9 @@ public class SyncManager {
@Override
public void onChange(final boolean selfChange, final Uri uri) {
// Handle change.
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SyncManager: Sms/Mms DB changed @" + System.currentTimeMillis()
+ " for " + (uri == null ? "<unk>" : uri.toString()) + " "
+ mSyncOnChanges + "/" + mNotifyOnChanges);
}
LogUtil.v(TAG, "SyncManager: Sms/Mms DB changed @" + System.currentTimeMillis()
+ " for " + (uri == null ? "<unk>" : uri.toString()) + " "
+ mSyncOnChanges + "/" + mNotifyOnChanges);
if (mSyncOnChanges) {
// If sync is already running this will do nothing - but at end of each sync
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -273,13 +273,11 @@ public class ActionMonitor {
monitor.updateState(action, expectedOldState, newState);
newMonitorState = monitor.mState;
}
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS",
Locale.getDefault());
df.setTimeZone(TimeZone.getTimeZone("UTC"));
LogUtil.v(TAG, "Operation-" + action.actionKey + ": @" + df.format(new Date())
+ "UTC State = " + oldMonitorState + " - " + newMonitorState);
}
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS",
Locale.getDefault());
df.setTimeZone(TimeZone.getTimeZone("UTC"));
LogUtil.v(TAG, "Operation-" + action.actionKey + ": @" + df.format(new Date())
+ "UTC State = " + oldMonitorState + " - " + newMonitorState);
}
/**
@@ -342,13 +340,11 @@ public class ActionMonitor {
monitor.complete(action, expectedOldState, result, succeeded);
unregisterActionMonitorIfComplete(action.actionKey, monitor);
}
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS",
Locale.getDefault());
df.setTimeZone(TimeZone.getTimeZone("UTC"));
LogUtil.v(TAG, "Operation-" + action.actionKey + ": @" + df.format(new Date())
+ "UTC State = " + oldMonitorState + " - " + STATE_COMPLETE);
}
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS",
Locale.getDefault());
df.setTimeZone(TimeZone.getTimeZone("UTC"));
LogUtil.v(TAG, "Operation-" + action.actionKey + ": @" + df.format(new Date())
+ "UTC State = " + oldMonitorState + " - " + STATE_COMPLETE);
}
/**
@@ -401,13 +397,11 @@ public class ActionMonitor {
oldMonitorState = monitor.mState;
monitor.executed(action, expectedOldState, hasBackgroundActions, result);
}
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS",
Locale.getDefault());
df.setTimeZone(TimeZone.getTimeZone("UTC"));
LogUtil.v(TAG, "Operation-" + action.actionKey + ": @" + df.format(new Date())
+ "UTC State = " + oldMonitorState + " - EXECUTED");
}
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS",
Locale.getDefault());
df.setTimeZone(TimeZone.getTimeZone("UTC"));
LogUtil.v(TAG, "Operation-" + action.actionKey + ": @" + df.format(new Date())
+ "UTC State = " + oldMonitorState + " - EXECUTED");
}
/**
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ import com.android.messaging.util.LoggingTimer;
*/
public class ActionServiceImpl extends JobIntentService {
private static final String TAG = LogUtil.BUGLE_DATAMODEL_TAG;
private static final boolean VERBOSE = false;
/**
* Unique job ID for this service.
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,6 @@ import java.util.List;
*/
public class BackgroundWorkerService extends JobIntentService {
private static final String TAG = LogUtil.BUGLE_DATAMODEL_TAG;
private static final boolean VERBOSE = false;
/**
* Unique job ID for this service.
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -290,10 +290,8 @@ public class InsertNewMessageAction extends Action implements Parcelable {
private void insertBroadcastSmsMessage(final String conversationId,
final MessageData message, final int subId, final long laterTimestamp,
final ArrayList<String> recipients) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "InsertNewMessageAction: Inserting broadcast SMS message "
+ message.getMessageId());
}
LogUtil.v(TAG, "InsertNewMessageAction: Inserting broadcast SMS message "
+ message.getMessageId());
final Context context = Factory.get().getApplicationContext();
final DatabaseWrapper db = DataModel.get().getDatabase();
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -222,10 +222,8 @@ public class ProcessDownloadedMmsAction extends Action {
// Send a response indicating that auto-download failed
if (sendDeferredRespStatus) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "DownloadMmsAction: Auto-download of message " + messageId
+ " failed; sending DEFERRED NotifyRespInd");
}
LogUtil.v(TAG, "DownloadMmsAction: Auto-download of message " + messageId
+ " failed; sending DEFERRED NotifyRespInd");
MmsUtils.sendNotifyResponseForMmsDownload(
context,
subId,
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -90,12 +90,10 @@ public class ProcessPendingMessagesAction extends Action implements Parcelable {
// return true.
final ProcessPendingMessagesAction action = new ProcessPendingMessagesAction();
if (action.queueActions(processingAction)) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
if (processingAction.hasBackgroundActions()) {
LogUtil.v(TAG, "ProcessPendingMessagesAction: Action queued");
} else {
LogUtil.v(TAG, "ProcessPendingMessagesAction: No actions to queue");
}
if (processingAction.hasBackgroundActions()) {
LogUtil.v(TAG, "ProcessPendingMessagesAction: Action queued");
} else {
LogUtil.v(TAG, "ProcessPendingMessagesAction: No actions to queue");
}
// Have queued next action if needed, nothing more to do
return;
@@ -175,10 +173,8 @@ public class ProcessPendingMessagesAction extends Action implements Parcelable {
final ProcessPendingMessagesAction action = new ProcessPendingMessagesAction();
action.schedule(PENDING_INTENT_BASE_REQUEST_CODE + subId, Long.MAX_VALUE);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "ProcessPendingMessagesAction: Unregistering for connectivity changed "
+ "events and clearing scheduled alarm for subId " + subId);
}
LogUtil.v(TAG, "ProcessPendingMessagesAction: Unregistering for connectivity changed "
+ "events and clearing scheduled alarm for subId " + subId);
}
private static void setRetry(final int retryAttempt, int subId) {
@@ -293,9 +289,7 @@ public class ProcessPendingMessagesAction extends Action implements Parcelable {
scheduleProcessPendingMessagesAction(true /* failed */, this);
}
} else {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "ProcessPendingMessagesAction: Not default SMS app; rescheduling");
}
LogUtil.v(TAG, "ProcessPendingMessagesAction: Not default SMS app; rescheduling");
scheduleProcessPendingMessagesAction(true /* failed */, this);
}
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -148,10 +148,8 @@ public class ProcessSentMessageAction extends Action {
if (tempFile.exists()) {
messageSize = tempFile.length();
tempFile.delete();
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "ProcessSentMessageAction: Deleted temp file with outgoing "
+ "MMS pdu: " + contentUri);
}
LogUtil.v(TAG, "ProcessSentMessageAction: Deleted temp file with outgoing "
+ "MMS pdu: " + contentUri);
}
final int resultCode = actionParameters.getInt(KEY_RESULT_CODE);
@@ -194,10 +192,8 @@ public class ProcessSentMessageAction extends Action {
messageId, updatedMessageUri, status, rawStatus, isSms, this, subId,
resultCode, httpStatusCode);
} else {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "ProcessSentMessageAction: No sent message to process (it was "
+ "probably a notify response for an MMS download)");
}
LogUtil.v(TAG, "ProcessSentMessageAction: No sent message to process (it was "
+ "probably a notify response for an MMS download)");
}
return null;
}
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -235,11 +235,9 @@ public class SendMessageAction extends Action implements Parcelable {
// To prevent Sync seeing inconsistent state must write to DB on this thread
updateMessageUri(messageId, updatedMessageUri);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SendMessageAction: Updated message " + messageId
+ " with new uri " + messageUri);
}
}
LogUtil.v(TAG, "SendMessageAction: Updated message " + messageId
+ " with new uri " + messageUri);
}
}
if (messageUri != null) {
// Actually send the MMS
@@ -378,11 +376,9 @@ public class SendMessageAction extends Action implements Parcelable {
}
}
if (updatedTelephony) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SendMessageAction: Updated " + (isSms ? "SMS" : "MMS")
+ " message " + message.getMessageId()
+ " in telephony (" + message.getSmsMessageUri() + ")");
}
LogUtil.v(TAG, "SendMessageAction: Updated " + (isSms ? "SMS" : "MMS")
+ " message " + message.getMessageId()
+ " in telephony (" + message.getSmsMessageUri() + ")");
} else {
LogUtil.w(TAG, "SendMessageAction: Failed to update " + (isSms ? "SMS" : "MMS")
+ " message " + message.getMessageId()
@@ -414,11 +410,9 @@ public class SendMessageAction extends Action implements Parcelable {
values);
}
db.setTransactionSuccessful();
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SendMessageAction: Updated " + (isSms ? "SMS" : "MMS")
+ " message " + message.getMessageId() + " in local db. Timestamp = "
+ message.getReceivedTimeStamp());
}
LogUtil.v(TAG, "SendMessageAction: Updated " + (isSms ? "SMS" : "MMS")
+ " message " + message.getMessageId() + " in local db. Timestamp = "
+ message.getReceivedTimeStamp());
} finally {
db.endTransaction();
}
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -375,10 +375,8 @@ class SyncCursorPair {
throws SQLiteException {
mDatabase = database;
try {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SyncCursorPair: Querying for local messages; selection = "
+ selection);
}
LogUtil.v(TAG, "SyncCursorPair: Querying for local messages; selection = "
+ selection);
mCursor = mDatabase.query(
DatabaseHelper.MESSAGES_TABLE,
LocalMessageQuery.PROJECTION,
@@ -440,10 +438,8 @@ class SyncCursorPair {
mMmsCursor = null;
try {
final Context context = Factory.get().getApplicationContext();
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SyncCursorPair: Querying for remote SMS; selection = "
+ smsSelection);
}
LogUtil.v(TAG, "SyncCursorPair: Querying for remote SMS; selection = "
+ smsSelection);
mSmsCursor = SqliteWrapper.query(
context,
context.getContentResolver(),
@@ -457,10 +453,8 @@ class SyncCursorPair {
+ "need to cancel sync");
throw new RuntimeException("Null cursor from remote SMS query");
}
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SyncCursorPair: Querying for remote MMS; selection = "
+ mmsSelection);
}
LogUtil.v(TAG, "SyncCursorPair: Querying for remote MMS; selection = "
+ mmsSelection);
mMmsCursor = SqliteWrapper.query(
context,
context.getContentResolver(),
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -98,11 +98,9 @@ class SyncMessageBatch {
messageListToIds(mMessagesToDelete));
for (final LocalDatabaseMessage message : mMessagesToDelete) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SyncMessageBatch: Deleted message " + message.getLocalId()
+ " for SMS/MMS " + message.getUri() + " with timestamp "
+ message.getTimestampInMillis());
}
LogUtil.v(TAG, "SyncMessageBatch: Deleted message " + message.getLocalId()
+ " for SMS/MMS " + message.getUri() + " with timestamp "
+ message.getTimestampInMillis());
}
// Update conversation state for imported messages, like snippet,
@@ -185,11 +183,9 @@ class SyncMessageBatch {
conversationId, selfId, participantId);
}
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SyncMessageBatch: Inserted new message " + message.getMessageId()
+ " for SMS " + message.getSmsMessageUri() + " received at "
+ message.getReceivedTimeStamp());
}
LogUtil.v(TAG, "SyncMessageBatch: Inserted new message " + message.getMessageId()
+ " for SMS " + message.getSmsMessageUri() + " received at "
+ message.getReceivedTimeStamp());
// Keep track of updated conversation for later updating the conversation snippet, etc.
mConversationsToUpdate.add(conversationId);
@@ -273,11 +269,9 @@ class SyncMessageBatch {
conversationId, selfId, participantId);
}
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "SyncMessageBatch: Inserted new message " + message.getMessageId()
+ " for MMS " + message.getSmsMessageUri() + " received at "
+ message.getReceivedTimeStamp());
}
LogUtil.v(TAG, "SyncMessageBatch: Inserted new message " + message.getMessageId()
+ " for MMS " + message.getSmsMessageUri() + " received at "
+ message.getReceivedTimeStamp());
// Keep track of updated conversation for later updating the conversation snippet, etc.
mConversationsToUpdate.add(conversationId);
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,13 +69,11 @@ public class MediaCache<T extends RefCountedMediaResource> extends LruCache<Stri
public synchronized T fetchResourceFromCache(final String key) {
final T ret = get(key);
if (ret != null) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "cache hit in mediaCache @ " + getName() +
", total cache hit = " + hitCount() +
", total cache miss = " + missCount());
}
LogUtil.v(TAG, "cache hit in mediaCache @ " + getName() +
", total cache hit = " + hitCount() +
", total cache miss = " + missCount());
ret.addRef();
} else if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
} else {
LogUtil.v(TAG, "cache miss in mediaCache @ " + getName() +
", total cache hit = " + hitCount() +
", total cache miss = " + missCount());
@@ -110,4 +109,4 @@ public class MediaCache<T extends RefCountedMediaResource> extends LruCache<Stri
// Never zero-count any resource, count as at least 1KB.
return mediaSizeInKilobytes == 0 ? 1 : mediaSizeInKilobytes;
}
}
}
@@ -262,10 +262,8 @@ public class MediaResourceManager {
bindableRequest.onMediaResourceLoadError(bindableRequest, mException);
} else {
Assert.isTrue(bindableRequest == null || !bindableRequest.isBound());
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "media request not processed, no longer bound; key=" +
LogUtil.sanitizePII(mediaRequest.getKey()) /* key with phone# */);
}
LogUtil.v(TAG, "media request not processed, no longer bound; key=" +
LogUtil.sanitizePII(mediaRequest.getKey()) /* key with phone# */);
}
});
});
@@ -278,10 +276,8 @@ public class MediaResourceManager {
final MediaCache<T> mediaCache = mediaRequest.getMediaCache();
if (mediaCache != null) {
mediaCache.addResourceToCache(mediaRequest.getKey(), mediaResource);
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "added media resource to " + mediaCache.getName() + ". key=" +
LogUtil.sanitizePII(mediaRequest.getKey()) /* key can contain phone# */);
}
LogUtil.v(TAG, "added media resource to " + mediaCache.getName() + ". key=" +
LogUtil.sanitizePII(mediaRequest.getKey()) /* key can contain phone# */);
}
}
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
* Copyright (C) 2024-2025 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -297,12 +297,10 @@ public class PoolableImageCache extends MediaCache<ImageResource> {
final long timeSinceLastRef = SystemClock.elapsedRealtime() -
imageToUse.getLastRefAddTimestamp();
if (timeSinceLastRef < MIN_TIME_IN_POOL) {
if (LogUtil.isLoggable(LogUtil.BUGLE_IMAGE_TAG, LogUtil.VERBOSE)) {
LogUtil.v(LogUtil.BUGLE_IMAGE_TAG, "Not reusing reusing " +
"first available bitmap from the pool because it " +
"has not been in the pool long enough. " +
"timeSinceLastRef=" + timeSinceLastRef);
}
LogUtil.v(LogUtil.BUGLE_IMAGE_TAG, "Not reusing reusing " +
"first available bitmap from the pool because it " +
"has not been in the pool long enough. " +
"timeSinceLastRef=" + timeSinceLastRef);
// Put back the image and return no reuseable bitmap.
images.addLast(imageToUse);
return null;