Messaging: Fix modifiers

We either have too few or too many

Change-Id: I09a9a38b859c68526fcbcdbc7862afe1d693f6c0
This commit is contained in:
Michael W
2024-12-26 14:55:12 +01:00
parent 37d6d70835
commit 21cb2b6289
78 changed files with 528 additions and 464 deletions
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 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.
@@ -43,7 +44,7 @@ public abstract class Action implements Parcelable {
public final String actionKey;
// If derived classes keep their data in actionParameters then parcelable is trivial
protected Bundle actionParameters;
protected final Bundle actionParameters;
// This does not get written to the parcel
private final List<Action> mBackgroundActions = new LinkedList<Action>();
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 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.
@@ -52,8 +53,8 @@ public class ActionMonitor {
* @param result value returned by {@link Action#executeAction}
*/
@RunsOnMainThread
abstract void onActionExecuted(ActionMonitor monitor, final Action action,
final Object data, final Object result);
void onActionExecuted(ActionMonitor monitor, final Action action,
final Object data, final Object result);
}
/**
@@ -67,14 +68,14 @@ public class ActionMonitor {
* {@link Action#processBackgroundResponse}
*/
@RunsOnMainThread
abstract void onActionSucceeded(ActionMonitor monitor,
final Action action, final Object data, final Object result);
void onActionSucceeded(ActionMonitor monitor,
final Action action, final Object data, final Object result);
/**
* @param result value returned by {@link Action#processBackgroundFailure}
*/
@RunsOnMainThread
abstract void onActionFailed(ActionMonitor monitor, final Action action,
final Object data, final Object result);
void onActionFailed(ActionMonitor monitor, final Action action,
final Object data, final Object result);
}
/**
@@ -291,9 +292,8 @@ public class ActionMonitor {
* else the value returned by {@link Action#processBackgroundResponse}
* or {@link Action#processBackgroundFailure}
*/
private final void complete(final Action action,
final int expectedOldState, final Object result,
final boolean succeeded) {
private void complete(final Action action, final int expectedOldState, final Object result,
final boolean succeeded) {
ActionCompletedListener completedListener = null;
synchronized (mLock) {
setState(action, expectedOldState, STATE_COMPLETE);
@@ -419,7 +419,7 @@ public class ActionMonitor {
* Map of action monitors indexed by actionKey
*/
@VisibleForTesting
static SimpleArrayMap<String, ActionMonitor> sActionMonitors =
static final SimpleArrayMap<String, ActionMonitor> sActionMonitors =
new SimpleArrayMap<String, ActionMonitor>();
/**
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 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.
@@ -51,14 +52,14 @@ public class DownloadMmsAction extends Action implements Parcelable {
*/
public interface DownloadMmsActionListener {
@RunsOnMainThread
abstract void onDownloadMessageStarting(final ActionMonitor monitor,
final Object data, final MessageData message);
void onDownloadMessageStarting(final ActionMonitor monitor,
final Object data, final MessageData message);
@RunsOnMainThread
abstract void onDownloadMessageSucceeded(final ActionMonitor monitor,
final Object data, final MessageData message);
void onDownloadMessageSucceeded(final ActionMonitor monitor,
final Object data, final MessageData message);
@RunsOnMainThread
abstract void onDownloadMessageFailed(final ActionMonitor monitor,
final Object data, final MessageData message);
void onDownloadMessageFailed(final ActionMonitor monitor,
final Object data, final MessageData message);
}
/**
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 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.
@@ -43,12 +44,12 @@ public class GetOrCreateConversationAction extends Action implements Parcelable
*/
public interface GetOrCreateConversationActionListener {
@RunsOnMainThread
abstract void onGetOrCreateConversationSucceeded(final ActionMonitor monitor,
final Object data, final String conversationId);
void onGetOrCreateConversationSucceeded(final ActionMonitor monitor,
final Object data, final String conversationId);
@RunsOnMainThread
abstract void onGetOrCreateConversationFailed(final ActionMonitor monitor,
final Object data);
void onGetOrCreateConversationFailed(final ActionMonitor monitor,
final Object data);
}
public static GetOrCreateConversationActionMonitor getOrCreateConversation(
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 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.
@@ -37,11 +38,11 @@ public class ReadDraftDataAction extends Action implements Parcelable {
*/
public interface ReadDraftDataActionListener {
@RunsOnMainThread
abstract void onReadDraftDataSucceeded(final ReadDraftDataAction action,
final Object data, final MessageData message,
final ConversationListItemData conversation);
void onReadDraftDataSucceeded(final ReadDraftDataAction action,
final Object data, final MessageData message,
final ConversationListItemData conversation);
@RunsOnMainThread
abstract void onReadDraftDataFailed(final ReadDraftDataAction action, final Object data);
void onReadDraftDataFailed(final ReadDraftDataAction action, final Object data);
}
/**
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 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.
@@ -306,19 +307,19 @@ class SyncCursorPair {
*
* @return The next element (which becomes the current)
*/
public DatabaseMessage next();
DatabaseMessage next();
/**
* Close the cursor
*/
public void close();
void close();
/**
* Get the position
*/
public int getPosition();
int getPosition();
/**
* Get the count
*/
public int getCount();
int getCount();
}
private static final String ORDER_BY_DATE_DESC = "date DESC";
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 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.
@@ -28,10 +29,10 @@ import com.android.messaging.util.Assert;
public class UpdateDestinationBlockedAction extends Action {
public interface UpdateDestinationBlockedActionListener {
@Assert.RunsOnMainThread
abstract void onUpdateDestinationBlockedAction(final UpdateDestinationBlockedAction action,
final boolean success,
final boolean block,
final String destination);
void onUpdateDestinationBlockedAction(final UpdateDestinationBlockedAction action,
final boolean success,
final boolean block,
final String destination);
}
public static class UpdateDestinationBlockedActionMonitor extends ActionMonitor