Messaging: Fix modifiers

We either have too few or too many

Change-Id: I09a9a38b859c68526fcbcdbc7862afe1d693f6c0
This commit is contained in:
Michael W
2024-12-08 21:40:43 +01:00
parent 37d6d70835
commit 21cb2b6289
78 changed files with 528 additions and 464 deletions

View File

@@ -34,30 +34,30 @@ public interface CarrierConfigValuesLoader {
// Configuration keys and default values
/** Boolean value: if MMS is enabled */
public static final String CONFIG_ENABLED_MMS = "enabledMMS";
public static final boolean CONFIG_ENABLED_MMS_DEFAULT = true;
String CONFIG_ENABLED_MMS = "enabledMMS";
boolean CONFIG_ENABLED_MMS_DEFAULT = true;
/**
* Boolean value: if transaction ID should be appended to
* the download URL of a single segment WAP push message
*/
public static final String CONFIG_ENABLED_TRANS_ID = "enabledTransID";
public static final boolean CONFIG_ENABLED_TRANS_ID_DEFAULT = false;
String CONFIG_ENABLED_TRANS_ID = "enabledTransID";
boolean CONFIG_ENABLED_TRANS_ID_DEFAULT = false;
/**
* Boolean value: if acknowledge or notify response to a download
* should be sent to the WAP push message's download URL
*/
public static final String CONFIG_ENABLED_NOTIFY_WAP_MMSC = "enabledNotifyWapMMSC";
public static final boolean CONFIG_ENABLED_NOTIFY_WAP_MMSC_DEFAULT = false;
String CONFIG_ENABLED_NOTIFY_WAP_MMSC = "enabledNotifyWapMMSC";
boolean CONFIG_ENABLED_NOTIFY_WAP_MMSC_DEFAULT = false;
/**
* Boolean value: if phone number alias can be used
*/
public static final String CONFIG_ALIAS_ENABLED = "aliasEnabled";
public static final boolean CONFIG_ALIAS_ENABLED_DEFAULT = false;
String CONFIG_ALIAS_ENABLED = "aliasEnabled";
boolean CONFIG_ALIAS_ENABLED_DEFAULT = false;
/**
* Boolean value: if audio is allowed in attachment
*/
public static final String CONFIG_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
public static final boolean CONFIG_ALLOW_ATTACH_AUDIO_DEFAULT = true;
String CONFIG_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
boolean CONFIG_ALLOW_ATTACH_AUDIO_DEFAULT = true;
/**
* Boolean value: if true, long sms messages are always sent as multi-part sms
* messages, with no checked limit on the number of segments. If false, then
@@ -66,144 +66,144 @@ public interface CarrierConfigValuesLoader {
* independent SMS messages (dependent on CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES flag).
* This feature exists for carriers that don't support multi-part sms.
*/
public static final String CONFIG_ENABLE_MULTIPART_SMS = "enableMultipartSMS";
public static final boolean CONFIG_ENABLE_MULTIPART_SMS_DEFAULT = true;
String CONFIG_ENABLE_MULTIPART_SMS = "enableMultipartSMS";
boolean CONFIG_ENABLE_MULTIPART_SMS_DEFAULT = true;
/**
* Boolean value: if SMS delivery report is supported
*/
public static final String CONFIG_ENABLE_SMS_DELIVERY_REPORTS = "enableSMSDeliveryReports";
public static final boolean CONFIG_ENABLE_SMS_DELIVERY_REPORTS_DEFAULT = true;
String CONFIG_ENABLE_SMS_DELIVERY_REPORTS = "enableSMSDeliveryReports";
boolean CONFIG_ENABLE_SMS_DELIVERY_REPORTS_DEFAULT = true;
/**
* Boolean value: if group MMS is supported
*/
public static final String CONFIG_ENABLE_GROUP_MMS = "enableGroupMms";
public static final boolean CONFIG_ENABLE_GROUP_MMS_DEFAULT = true;
String CONFIG_ENABLE_GROUP_MMS = "enableGroupMms";
boolean CONFIG_ENABLE_GROUP_MMS_DEFAULT = true;
/**
* Boolean value: if the content_disposition field of an MMS part should be parsed
* Check wap-230-wsp-20010705-a.pdf, chapter 8.4.2.21. Most carriers support it except some.
*/
public static final String CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION =
String CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION =
"supportMmsContentDisposition";
public static final boolean CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION_DEFAULT = true;
boolean CONFIG_SUPPORT_MMS_CONTENT_DISPOSITION_DEFAULT = true;
/**
* Boolean value: if the sms app should support a link to the system settings
* where amber alerts are configured.
*/
public static final String CONFIG_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
public static final boolean CONFIG_CELL_BROADCAST_APP_LINKS_DEFAULT = true;
String CONFIG_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
boolean CONFIG_CELL_BROADCAST_APP_LINKS_DEFAULT = true;
/**
* Boolean value: if multipart SMS should be sent as separate SMS messages
*/
public static final String CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES =
String CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES =
"sendMultipartSmsAsSeparateMessages";
public static final boolean CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_DEFAULT = false;
boolean CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_DEFAULT = false;
/**
* Boolean value: if MMS read report is supported
*/
public static final String CONFIG_ENABLE_MMS_READ_REPORTS = "enableMMSReadReports";
public static final boolean CONFIG_ENABLE_MMS_READ_REPORTS_DEFAULT = false;
String CONFIG_ENABLE_MMS_READ_REPORTS = "enableMMSReadReports";
boolean CONFIG_ENABLE_MMS_READ_REPORTS_DEFAULT = false;
/**
* Boolean value: if MMS delivery report is supported
*/
public static final String CONFIG_ENABLE_MMS_DELIVERY_REPORTS = "enableMMSDeliveryReports";
public static final boolean CONFIG_ENABLE_MMS_DELIVERY_REPORTS_DEFAULT = false;
String CONFIG_ENABLE_MMS_DELIVERY_REPORTS = "enableMMSDeliveryReports";
boolean CONFIG_ENABLE_MMS_DELIVERY_REPORTS_DEFAULT = false;
/**
* Boolean value: if "charset" value is supported in the "Content-Type" HTTP header
*/
public static final String CONFIG_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
public static final boolean CONFIG_SUPPORT_HTTP_CHARSET_HEADER_DEFAULT = false;
String CONFIG_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
boolean CONFIG_SUPPORT_HTTP_CHARSET_HEADER_DEFAULT = false;
/**
* Integer value: maximal MMS message size in bytes
*/
public static final String CONFIG_MAX_MESSAGE_SIZE = "maxMessageSize";
public static final int CONFIG_MAX_MESSAGE_SIZE_DEFAULT = 300 * 1024;
String CONFIG_MAX_MESSAGE_SIZE = "maxMessageSize";
int CONFIG_MAX_MESSAGE_SIZE_DEFAULT = 300 * 1024;
/**
* Integer value: maximal MMS image height in pixels
*/
public static final String CONFIG_MAX_IMAGE_HEIGHT = "maxImageHeight";
public static final int CONFIG_MAX_IMAGE_HEIGHT_DEFAULT = 480;
String CONFIG_MAX_IMAGE_HEIGHT = "maxImageHeight";
int CONFIG_MAX_IMAGE_HEIGHT_DEFAULT = 480;
/**
* Integer value: maximal MMS image width in pixels
*/
public static final String CONFIG_MAX_IMAGE_WIDTH = "maxImageWidth";
public static final int CONFIG_MAX_IMAGE_WIDTH_DEFAULT = 640;
String CONFIG_MAX_IMAGE_WIDTH = "maxImageWidth";
int CONFIG_MAX_IMAGE_WIDTH_DEFAULT = 640;
/**
* Integer value: limit on recipient list of an MMS message
*/
public static final String CONFIG_RECIPIENT_LIMIT = "recipientLimit";
public static final int CONFIG_RECIPIENT_LIMIT_DEFAULT = Integer.MAX_VALUE;
String CONFIG_RECIPIENT_LIMIT = "recipientLimit";
int CONFIG_RECIPIENT_LIMIT_DEFAULT = Integer.MAX_VALUE;
/**
* Integer value: HTTP socket timeout in milliseconds for MMS
*/
public static final String CONFIG_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
public static final int CONFIG_HTTP_SOCKET_TIMEOUT_DEFAULT = 60 * 1000;
String CONFIG_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
int CONFIG_HTTP_SOCKET_TIMEOUT_DEFAULT = 60 * 1000;
/**
* Integer value: minimal number of characters of an alias
*/
public static final String CONFIG_ALIAS_MIN_CHARS = "aliasMinChars";
public static final int CONFIG_ALIAS_MIN_CHARS_DEFAULT = 2;
String CONFIG_ALIAS_MIN_CHARS = "aliasMinChars";
int CONFIG_ALIAS_MIN_CHARS_DEFAULT = 2;
/**
* Integer value: maximal number of characters of an alias
*/
public static final String CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars";
public static final int CONFIG_ALIAS_MAX_CHARS_DEFAULT = 48;
String CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars";
int CONFIG_ALIAS_MAX_CHARS_DEFAULT = 48;
/**
* Integer value: the threshold of number of SMS parts when an multipart SMS will be
* converted into an MMS, e.g. if this is "4", when an multipart SMS message has 5
* parts, then it will be sent as MMS message instead. "-1" indicates no such conversion
* can happen.
*/
public static final String CONFIG_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
public static final int CONFIG_SMS_TO_MMS_TEXT_THRESHOLD_DEFAULT = -1;
String CONFIG_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
int CONFIG_SMS_TO_MMS_TEXT_THRESHOLD_DEFAULT = -1;
/**
* Integer value: the threshold of SMS length when it will be converted into an MMS.
* "-1" indicates no such conversion can happen.
*/
public static final String CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD =
String CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD =
"smsToMmsTextLengthThreshold";
public static final int CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_DEFAULT = -1;
int CONFIG_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_DEFAULT = -1;
/**
* Integer value: maximal length in bytes of SMS message
*/
public static final String CONFIG_MAX_MESSAGE_TEXT_SIZE = "maxMessageTextSize";
public static final int CONFIG_MAX_MESSAGE_TEXT_SIZE_DEFAULT = -1;
String CONFIG_MAX_MESSAGE_TEXT_SIZE = "maxMessageTextSize";
int CONFIG_MAX_MESSAGE_TEXT_SIZE_DEFAULT = -1;
/**
* Integer value: maximum number of characters allowed for mms subject
*/
public static final String CONFIG_MAX_SUBJECT_LENGTH = "maxSubjectLength";
public static final int CONFIG_MAX_SUBJECT_LENGTH_DEFAULT = 40;
String CONFIG_MAX_SUBJECT_LENGTH = "maxSubjectLength";
int CONFIG_MAX_SUBJECT_LENGTH_DEFAULT = 40;
/**
* String value: name for the user agent profile HTTP header
*/
public static final String CONFIG_UA_PROF_TAG_NAME = "uaProfTagName";
public static final String CONFIG_UA_PROF_TAG_NAME_DEFAULT = "x-wap-profile";
String CONFIG_UA_PROF_TAG_NAME = "uaProfTagName";
String CONFIG_UA_PROF_TAG_NAME_DEFAULT = "x-wap-profile";
/**
* String value: additional HTTP headers for MMS HTTP requests.
* The format is
* header_1:header_value_1|header_2:header_value_2|...
* Each value can contain macros.
*/
public static final String CONFIG_HTTP_PARAMS = "httpParams";
public static final String CONFIG_HTTP_PARAMS_DEFAULT = null;
String CONFIG_HTTP_PARAMS = "httpParams";
String CONFIG_HTTP_PARAMS_DEFAULT = null;
/**
* String value: number of email gateway
*/
public static final String CONFIG_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
public static final String CONFIG_EMAIL_GATEWAY_NUMBER_DEFAULT = null;
String CONFIG_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
String CONFIG_EMAIL_GATEWAY_NUMBER_DEFAULT = null;
/**
* String value: suffix for the NAI HTTP header value, e.g. ":pcs"
* (NAI is used as authentication in HTTP headers for some carriers)
*/
public static final String CONFIG_NAI_SUFFIX = "naiSuffix";
public static final String CONFIG_NAI_SUFFIX_DEFAULT = null;
String CONFIG_NAI_SUFFIX = "naiSuffix";
String CONFIG_NAI_SUFFIX_DEFAULT = null;
/**
* String value: Url for user agent profile
*/
public static final String CONFIG_UA_PROF_URL = "uaProfUrl";
public static final String CONFIG_UA_PROF_URL_DEFAULT = null;
String CONFIG_UA_PROF_URL = "uaProfUrl";
String CONFIG_UA_PROF_URL_DEFAULT = null;
/**
* String value: user agent
*/
public static final String CONFIG_USER_AGENT = "userAgent";
public static final String CONFIG_USER_AGENT_DEFAULT = null;
String CONFIG_USER_AGENT = "userAgent";
String CONFIG_USER_AGENT_DEFAULT = null;
}

View File

@@ -31,7 +31,7 @@ class DefaultUserAgentInfoLoader implements UserAgentInfoLoader {
private static final String DEFAULT_UA_PROF_URL =
"http://www.gstatic.com/android/sms/mms_ua_profile.xml";
private Context mContext;
private final Context mContext;
private boolean mLoaded;
private String mUserAgent;

View File

@@ -37,7 +37,7 @@ public class MmsManager {
private static volatile boolean sForceLegacyMms = false;
// Cached computed overrides for carrier configuration values
private static SparseArray<Bundle> sConfigOverridesMap = new SparseArray<>();
private static final SparseArray<Bundle> sConfigOverridesMap = new SparseArray<>();
/**
* Set the flag about whether to force to use legacy system APIs instead of system MMS API

View File

@@ -239,7 +239,7 @@ public class MmsService extends Service {
// Request execution thread pools. One thread pool for sending and one for downloading.
// The size of the thread pool controls the parallelism of request execution.
// See {@link setThreadPoolSize}
private ExecutorService[] mExecutors = new ExecutorService[2];
private final ExecutorService[] mExecutors = new ExecutorService[2];
// Active request count
private int mActiveRequestCount;

View File

@@ -22,8 +22,8 @@ package android.support.v7.mms;
*/
public interface UserAgentInfoLoader {
// Carrier configuration keys for passing as config overrides into system MMS service
public static final String CONFIG_USER_AGENT = "userAgent";
public static final String CONFIG_UA_PROF_URL = "uaProfUrl";
String CONFIG_USER_AGENT = "userAgent";
String CONFIG_UA_PROF_URL = "uaProfUrl";
/**
* Get UserAgent value

View File

@@ -35,7 +35,7 @@ public class Base64 {
static final int BASELENGTH = 255;
// Create arrays to hold the base64 characters
private static byte[] base64Alphabet = new byte[BASELENGTH];
private static final byte[] base64Alphabet = new byte[BASELENGTH];
// Populating the character arrays
static {

View File

@@ -21,7 +21,7 @@ package android.support.v7.mms.pdu;
import java.io.ByteArrayOutputStream;
public class QuotedPrintable {
private static byte ESCAPE_CHAR = '=';
private static final byte ESCAPE_CHAR = '=';
/**
* Decodes an array quoted-printable characters into an array of original bytes.
@@ -37,7 +37,7 @@ public class QuotedPrintable {
* @return array of original bytes,
* null if quoted-printable decoding is unsuccessful.
*/
public static final byte[] decodeQuotedPrintable(byte[] bytes) {
public static byte[] decodeQuotedPrintable(byte[] bytes) {
if (bytes == null) {
return null;
}

View File

@@ -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.
@@ -87,7 +88,7 @@ public class ConversationImagePartsView {
}
public interface PhotoViewQuery {
public final String[] PROJECTION = {
String[] PROJECTION = {
PhotoViewColumns.URI,
PhotoViewColumns.NAME,
PhotoViewColumns.CONTENT_URI,
@@ -99,22 +100,22 @@ public class ConversationImagePartsView {
Columns.STATUS,
};
public final int INDEX_URI = 0;
public final int INDEX_SENDER_FULL_NAME = 1;
public final int INDEX_CONTENT_URI = 2;
public final int INDEX_THUMBNAIL_URI = 3;
public final int INDEX_CONTENT_TYPE = 4;
int INDEX_URI = 0;
int INDEX_SENDER_FULL_NAME = 1;
int INDEX_CONTENT_URI = 2;
int INDEX_THUMBNAIL_URI = 3;
int INDEX_CONTENT_TYPE = 4;
// Columns in addition to those specified by PhotoContract
public final int INDEX_DISPLAY_DESTINATION = 5;
public final int INDEX_RECEIVED_TIMESTAMP = 6;
public final int INDEX_STATUS = 7;
int INDEX_DISPLAY_DESTINATION = 5;
int INDEX_RECEIVED_TIMESTAMP = 6;
int INDEX_STATUS = 7;
}
static final String getViewName() {
static String getViewName() {
return VIEW_NAME;
}
static final String getCreateSql() {
static String getCreateSql() {
return CREATE_SQL;
}
}

View File

@@ -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.
@@ -59,12 +60,11 @@ public abstract class DataModel {
return Factory.get().getDataModel();
}
public static final void startActionService(final Action action) {
public static void startActionService(final Action action) {
get().getActionService().startAction(action);
}
public static final void scheduleAction(final Action action,
final int code, final long delayMs) {
public static void scheduleAction(final Action action, final int code, final long delayMs) {
get().getActionService().scheduleAction(action, code, delayMs);
}

View File

@@ -44,7 +44,7 @@ import com.android.messaging.util.LogUtil;
public class DatabaseHelper extends SQLiteOpenHelper {
public static final String DATABASE_NAME = "bugle_db";
private static final int getDatabaseVersion(final Context context) {
private static int getDatabaseVersion(final Context context) {
return Integer.parseInt(context.getResources().getString(R.string.database_version));
}

View File

@@ -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.
@@ -65,7 +66,7 @@ public class DatabaseWrapper {
}
// track transaction on a per thread basis
private static ThreadLocal<Stack<TransactionData>> sTransactionDepth =
private static final ThreadLocal<Stack<TransactionData>> sTransactionDepth =
new ThreadLocal<Stack<TransactionData>>() {
@Override
public Stack<TransactionData> initialValue() {
@@ -73,7 +74,7 @@ public class DatabaseWrapper {
}
};
private static String[] sFormatStrings = new String[] {
private static final String[] sFormatStrings = new String[] {
"took %d ms to %s",
" took %d ms to %s",
" took %d ms to %s",

View File

@@ -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.
@@ -146,11 +147,11 @@ public abstract class MessageNotificationState extends NotificationState {
*/
static class MessageLineInfo extends NotificationLineInfo {
final CharSequence mText;
Uri mAttachmentUri;
String mAttachmentType;
final Uri mAttachmentUri;
final String mAttachmentType;
final String mAuthorFullName;
final String mAuthorFirstName;
boolean mIsManualDownloadNeeded;
final boolean mIsManualDownloadNeeded;
final String mMessageId;
MessageLineInfo(final boolean isGroup, final String authorFullName,
@@ -792,7 +793,7 @@ public abstract class MessageNotificationState extends NotificationState {
* with notifications for other conversations on a wearable device.
*/
public static class BundledMessageNotificationState extends MultiMessageNotificationState {
public int mGroupOrder;
public final int mGroupOrder;
public BundledMessageNotificationState(final ConversationInfoList convList,
final int groupOrder) {
super(convList);

View File

@@ -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.
@@ -46,14 +47,14 @@ public abstract class NotificationState {
private static final int NUM_REQUEST_CODES_NEEDED = 2;
public interface FailedMessageQuery {
static final String FAILED_MESSAGES_WHERE_CLAUSE =
String FAILED_MESSAGES_WHERE_CLAUSE =
"((" + MessageColumns.STATUS + " = " +
MessageData.BUGLE_STATUS_OUTGOING_FAILED + " OR " +
MessageColumns.STATUS + " = " +
MessageData.BUGLE_STATUS_INCOMING_DOWNLOAD_FAILED + ") AND " +
DatabaseHelper.MessageColumns.SEEN + " = 0)";
static final String FAILED_ORDER_BY = DatabaseHelper.MessageColumns.CONVERSATION_ID + ", " +
String FAILED_ORDER_BY = DatabaseHelper.MessageColumns.CONVERSATION_ID + ", " +
DatabaseHelper.MessageColumns.SENT_TIMESTAMP + " asc";
}

View File

@@ -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.
@@ -310,7 +311,7 @@ public class ParticipantRefresh {
+ ParticipantData.OTHER_THAN_SELF_SUB_ID
+ " )";
private static final Set<Integer> getExistingSubIds() {
private static Set<Integer> getExistingSubIds() {
final DatabaseWrapper db = DataModel.get().getDatabase();
final HashSet<Integer> existingSubIds = new HashSet<Integer>();

View File

@@ -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>();

View File

@@ -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>();
/**

View File

@@ -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);
}
/**

View File

@@ -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(

View File

@@ -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);
}
/**

View File

@@ -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";

View File

@@ -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

View File

@@ -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.
@@ -19,7 +20,7 @@ package com.android.messaging.datamodel.binding;
import java.util.concurrent.atomic.AtomicLong;
public class Binding<T extends BindableData> extends BindingBase<T> {
private static AtomicLong sBindingIdx = new AtomicLong(System.currentTimeMillis() * 1000);
private static final AtomicLong sBindingIdx = new AtomicLong(System.currentTimeMillis() * 1000);
private String mBindingId;
private T mData;

View File

@@ -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.
@@ -36,7 +37,7 @@ import com.android.messaging.util.Assert;
public class BlockedParticipantsData extends BindableData implements
LoaderManager.LoaderCallbacks<Cursor> {
public interface BlockedParticipantsDataListener {
public void onBlockedParticipantsCursorUpdated(final Cursor cursor);
void onBlockedParticipantsCursorUpdated(final Cursor cursor);
}
private static final String BINDING_ID = "bindingId";
private static final int BLOCKED_PARTICIPANTS_LOADER = 1;

View File

@@ -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.
@@ -103,12 +104,12 @@ public class ConversationData extends BindableData {
}
public interface ConversationDataListener {
public void onConversationMessagesCursorUpdated(ConversationData data, Cursor cursor,
void onConversationMessagesCursorUpdated(ConversationData data, Cursor cursor,
@Nullable ConversationMessageData newestMessage, boolean isSync);
public void onConversationMetadataUpdated(ConversationData data);
public void closeConversation(String conversationId);
public void onConversationParticipantDataLoaded(ConversationData data);
public void onSubscriptionListDataLoaded(ConversationData data);
void onConversationMetadataUpdated(ConversationData data);
void closeConversation(String conversationId);
void onConversationParticipantDataLoaded(ConversationData data);
void onSubscriptionListDataLoaded(ConversationData data);
}
private static class ReversedCursor extends CursorWrapper {

View File

@@ -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,8 +52,8 @@ public class ConversationListData extends BindableData
"(" + ConversationListViewColumns.ARCHIVE_STATUS + " = 0)";
public interface ConversationListDataListener {
public void onConversationListCursorUpdated(ConversationListData data, Cursor cursor);
public void setBlockedParticipantsAvailable(boolean blockedAvailable);
void onConversationListCursorUpdated(ConversationListData data, Cursor cursor);
void setBlockedParticipantsAvailable(boolean blockedAvailable);
}
private ConversationListDataListener mListener;

View File

@@ -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.
@@ -261,11 +262,11 @@ public class ConversationListItemData {
/**
* Get the name of the view for this data item
*/
public static final String getConversationListView() {
public static String getConversationListView() {
return CONVERSATION_LIST_VIEW;
}
public static final String getConversationListViewSql() {
public static String getConversationListViewSql() {
return CONVERSATION_LIST_VIEW_SQL;
}

View File

@@ -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.
@@ -620,7 +621,7 @@ public class ConversationMessageData {
// Data definitions
public static final String getConversationMessagesQuerySql() {
public static String getConversationMessagesQuerySql() {
return CONVERSATION_MESSAGES_QUERY_SQL
+ " AND "
// Inject the conversation id
@@ -628,7 +629,7 @@ public class ConversationMessageData {
+ CONVERSATION_MESSAGES_QUERY_SQL_GROUP_BY;
}
static final String getConversationMessageIdsQuerySql() {
static String getConversationMessageIdsQuerySql() {
return CONVERSATION_MESSAGES_IDS_QUERY_SQL
+ " AND "
// Inject the conversation id
@@ -636,7 +637,7 @@ public class ConversationMessageData {
+ CONVERSATION_MESSAGES_QUERY_SQL_GROUP_BY;
}
public static final String getNotificationQuerySql() {
public static String getNotificationQuerySql() {
return CONVERSATION_MESSAGES_QUERY_SQL
+ " AND "
+ "(" + DatabaseHelper.MessageColumns.STATUS + " in ("
@@ -648,7 +649,7 @@ public class ConversationMessageData {
+ NOTIFICATION_QUERY_SQL_GROUP_BY;
}
public static final String getWearableQuerySql() {
public static String getWearableQuerySql() {
return CONVERSATION_MESSAGES_QUERY_SQL
+ " AND "
+ DatabaseHelper.MESSAGES_TABLE + "." + MessageColumns.CONVERSATION_ID + "=?"
@@ -808,37 +809,37 @@ public class ConversationMessageData {
+ DatabaseHelper.MESSAGES_TABLE + '.' + MessageColumns.RECEIVED_TIMESTAMP + " DESC";
interface ConversationMessageViewColumns extends BaseColumns {
static final String _ID = MessageColumns._ID;
static final String CONVERSATION_ID = MessageColumns.CONVERSATION_ID;
static final String PARTICIPANT_ID = MessageColumns.SENDER_PARTICIPANT_ID;
static final String PARTS_COUNT = "parts_count";
static final String SENT_TIMESTAMP = MessageColumns.SENT_TIMESTAMP;
static final String RECEIVED_TIMESTAMP = MessageColumns.RECEIVED_TIMESTAMP;
static final String SEEN = MessageColumns.SEEN;
static final String READ = MessageColumns.READ;
static final String PROTOCOL = MessageColumns.PROTOCOL;
static final String STATUS = MessageColumns.STATUS;
static final String SMS_MESSAGE_URI = MessageColumns.SMS_MESSAGE_URI;
static final String SMS_PRIORITY = MessageColumns.SMS_PRIORITY;
static final String SMS_MESSAGE_SIZE = MessageColumns.SMS_MESSAGE_SIZE;
static final String MMS_SUBJECT = MessageColumns.MMS_SUBJECT;
static final String MMS_EXPIRY = MessageColumns.MMS_EXPIRY;
static final String RAW_TELEPHONY_STATUS = MessageColumns.RAW_TELEPHONY_STATUS;
static final String SELF_PARTICIPANT_ID = MessageColumns.SELF_PARTICIPANT_ID;
static final String SENDER_FULL_NAME = ParticipantColumns.FULL_NAME;
static final String SENDER_FIRST_NAME = ParticipantColumns.FIRST_NAME;
static final String SENDER_DISPLAY_DESTINATION = ParticipantColumns.DISPLAY_DESTINATION;
static final String SENDER_NORMALIZED_DESTINATION =
String _ID = MessageColumns._ID;
String CONVERSATION_ID = MessageColumns.CONVERSATION_ID;
String PARTICIPANT_ID = MessageColumns.SENDER_PARTICIPANT_ID;
String PARTS_COUNT = "parts_count";
String SENT_TIMESTAMP = MessageColumns.SENT_TIMESTAMP;
String RECEIVED_TIMESTAMP = MessageColumns.RECEIVED_TIMESTAMP;
String SEEN = MessageColumns.SEEN;
String READ = MessageColumns.READ;
String PROTOCOL = MessageColumns.PROTOCOL;
String STATUS = MessageColumns.STATUS;
String SMS_MESSAGE_URI = MessageColumns.SMS_MESSAGE_URI;
String SMS_PRIORITY = MessageColumns.SMS_PRIORITY;
String SMS_MESSAGE_SIZE = MessageColumns.SMS_MESSAGE_SIZE;
String MMS_SUBJECT = MessageColumns.MMS_SUBJECT;
String MMS_EXPIRY = MessageColumns.MMS_EXPIRY;
String RAW_TELEPHONY_STATUS = MessageColumns.RAW_TELEPHONY_STATUS;
String SELF_PARTICIPANT_ID = MessageColumns.SELF_PARTICIPANT_ID;
String SENDER_FULL_NAME = ParticipantColumns.FULL_NAME;
String SENDER_FIRST_NAME = ParticipantColumns.FIRST_NAME;
String SENDER_DISPLAY_DESTINATION = ParticipantColumns.DISPLAY_DESTINATION;
String SENDER_NORMALIZED_DESTINATION =
ParticipantColumns.NORMALIZED_DESTINATION;
static final String SENDER_PROFILE_PHOTO_URI = ParticipantColumns.PROFILE_PHOTO_URI;
static final String SENDER_CONTACT_ID = ParticipantColumns.CONTACT_ID;
static final String SENDER_CONTACT_LOOKUP_KEY = ParticipantColumns.LOOKUP_KEY;
static final String PARTS_IDS = "parts_ids";
static final String PARTS_CONTENT_TYPES = "parts_content_types";
static final String PARTS_CONTENT_URIS = "parts_content_uris";
static final String PARTS_WIDTHS = "parts_widths";
static final String PARTS_HEIGHTS = "parts_heights";
static final String PARTS_TEXTS = "parts_texts";
String SENDER_PROFILE_PHOTO_URI = ParticipantColumns.PROFILE_PHOTO_URI;
String SENDER_CONTACT_ID = ParticipantColumns.CONTACT_ID;
String SENDER_CONTACT_LOOKUP_KEY = ParticipantColumns.LOOKUP_KEY;
String PARTS_IDS = "parts_ids";
String PARTS_CONTENT_TYPES = "parts_content_types";
String PARTS_CONTENT_URIS = "parts_content_uris";
String PARTS_WIDTHS = "parts_widths";
String PARTS_HEIGHTS = "parts_heights";
String PARTS_TEXTS = "parts_texts";
}
private static int sIndexIncrementer = 0;
@@ -878,7 +879,7 @@ public class ConversationMessageData {
private static final int INDEX_SENDER_CONTACT_LOOKUP_KEY = sIndexIncrementer++;
private static String[] sProjection = {
private static final String[] sProjection = {
ConversationMessageViewColumns._ID,
ConversationMessageViewColumns.CONVERSATION_ID,
ConversationMessageViewColumns.PARTICIPANT_ID,

View File

@@ -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.
@@ -70,16 +71,16 @@ public class DraftMessageData extends BindableData implements ReadDraftDataActio
}
// Flags sent to onDraftChanged to help the receiver limit the amount of work done
public static int ATTACHMENTS_CHANGED = 0x0001;
public static int MESSAGE_TEXT_CHANGED = 0x0002;
public static int MESSAGE_SUBJECT_CHANGED = 0x0004;
public static final int ATTACHMENTS_CHANGED = 0x0001;
public static final int MESSAGE_TEXT_CHANGED = 0x0002;
public static final int MESSAGE_SUBJECT_CHANGED = 0x0004;
// Whether the self participant data has been loaded
public static int SELF_CHANGED = 0x0008;
public static int ALL_CHANGED = 0x00FF;
public static final int SELF_CHANGED = 0x0008;
public static final int ALL_CHANGED = 0x00FF;
// ALL_CHANGED intentionally doesn't include WIDGET_CHANGED. ConversationFragment needs to
// be notified if the draft it is looking at is changed externally (by a desktop widget) so it
// can reload the draft.
public static int WIDGET_CHANGED = 0x0100;
public static final int WIDGET_CHANGED = 0x0100;
private final String mConversationId;
private ReadDraftDataActionMonitor mMonitor;
@@ -91,7 +92,7 @@ public class DraftMessageData extends BindableData implements ReadDraftDataActio
private String mMessageText;
private String mMessageSubject;
private String mSelfId;
private MessageTextStats mMessageTextStats;
private final MessageTextStats mMessageTextStats;
private boolean mSending;
/** Keeps track of completed attachments in the message draft. This data is persisted to db */

View File

@@ -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.
@@ -141,7 +142,7 @@ public class MessageData implements Parcelable {
public static final int BUGLE_STATUS_INCOMING_DOWNLOAD_FAILED = 106;
public static final int BUGLE_STATUS_INCOMING_EXPIRED_OR_NOT_AVAILABLE = 107;
public static final String getStatusDescription(int status) {
public static String getStatusDescription(int status) {
switch (status) {
case BUGLE_STATUS_UNKNOWN:
return "UNKNOWN";
@@ -646,7 +647,7 @@ public class MessageData implements Parcelable {
|| mProtocol == MessageData.PROTOCOL_MMS_PUSH_NOTIFICATION;
}
public static final boolean getIsMmsNotification(final int protocol) {
public static boolean getIsMmsNotification(final int protocol) {
return (protocol == MessageData.PROTOCOL_MMS_PUSH_NOTIFICATION);
}
@@ -654,7 +655,7 @@ public class MessageData implements Parcelable {
return getIsMmsNotification(mProtocol);
}
public static final boolean getIsSms(final int protocol) {
public static boolean getIsSms(final int protocol) {
return protocol == (MessageData.PROTOCOL_SMS);
}

View File

@@ -45,7 +45,7 @@ import java.util.List;
public class AvatarRequest extends UriImageRequest<AvatarRequestDescriptor> {
private static final float SCALING_FACTOR = 1.33f;
private TypedArray mColors;
private final TypedArray mColors;
public AvatarRequest(final Context context,
final AvatarRequestDescriptor descriptor) {

View File

@@ -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.
@@ -29,7 +30,7 @@ public class CustomVCardEntryConstructor implements VCardInterpreter {
/**
* Called when the parsing started.
*/
public void onStart();
void onStart();
/**
* The method called when one vCard entry is created. Children come before their parent in
@@ -46,13 +47,13 @@ public class CustomVCardEntryConstructor implements VCardInterpreter {
* END:VCARD
* </code>
*/
public void onEntryCreated(final CustomVCardEntry entry);
void onEntryCreated(final CustomVCardEntry entry);
/**
* Called when the parsing ended.
* Able to be use this method for showing performance log, etc.
*/
public void onEnd();
void onEnd();
}
/**
@@ -130,4 +131,4 @@ public class CustomVCardEntryConstructor implements VCardInterpreter {
public void onPropertyCreated(VCardProperty property) {
mCurrentEntry.addProperty(property);
}
}
}

View File

@@ -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.
@@ -26,9 +27,9 @@ import java.util.List;
* extensions).
*/
public interface MediaRequest<T extends RefCountedMediaResource> {
public static final int REQUEST_ENCODE_MEDIA = 1;
public static final int REQUEST_DECODE_MEDIA = 2;
public static final int REQUEST_LOAD_MEDIA = 3;
int REQUEST_ENCODE_MEDIA = 1;
int REQUEST_DECODE_MEDIA = 2;
int REQUEST_LOAD_MEDIA = 3;
/**
* Returns a unique key used for storing and looking up the MediaRequest.

View File

@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007 Esmertec AG.
* Copyright (C) 2007 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.
@@ -34,7 +35,7 @@ public class Base64 {
static final int BASELENGTH = 255;
// Create arrays to hold the base64 characters
private static byte[] base64Alphabet = new byte[BASELENGTH];
private static final byte[] base64Alphabet = new byte[BASELENGTH];
// Populating the character arrays
static {

View File

@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007 Esmertec AG.
* Copyright (C) 2007 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.
@@ -20,7 +21,7 @@ package com.android.messaging.mmslib.pdu;
import java.io.ByteArrayOutputStream;
public class QuotedPrintable {
private static byte ESCAPE_CHAR = '=';
private static final byte ESCAPE_CHAR = '=';
/**
* Decodes an array quoted-printable characters into an array of original bytes.
@@ -36,7 +37,7 @@ public class QuotedPrintable {
* @return array of original bytes,
* null if quoted-printable decoding is unsuccessful.
*/
public static final byte[] decodeQuotedPrintable(byte[] bytes) {
public static byte[] decodeQuotedPrintable(byte[] bytes) {
if (bytes == null) {
return null;
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 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.
@@ -29,8 +30,8 @@ import java.io.RandomAccessFile;
public class DrmConvertSession {
private DrmManagerClient mDrmClient;
private int mConvertSessionId;
private final DrmManagerClient mDrmClient;
private final int mConvertSessionId;
private static final String TAG = "DrmConvertSession";
private DrmConvertSession(DrmManagerClient drmClient, int convertSessionId) {

View File

@@ -1,6 +1,7 @@
/*
* Copyright (C) 2008 Esmertec AG.
* Copyright (C) 2008 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.
@@ -81,7 +82,7 @@ public final class PduCache extends AbstractCache<Uri, PduCacheEntry> {
mUpdating = new HashSet<Uri>();
}
public static final synchronized PduCache getInstance() {
public static synchronized PduCache getInstance() {
if (sInstance == null) {
if (LOCAL_LOGV) {
Log.v(TAG, "Constructing new PduCache instance.");

View File

@@ -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 @@ import java.util.Map;
*/
class ApnsXmlProcessor {
public interface ApnHandler {
public void process(ContentValues apnValues);
void process(ContentValues apnValues);
}
public interface MmsConfigHandler {
public void process(String mccMnc, String key, String value, String type);
void process(String mccMnc, String key, String value, String type);
}
private static final String TAG = LogUtil.BUGLE_TAG;

View File

@@ -33,7 +33,7 @@ import com.android.messaging.util.VersionUtil;
public class BugleUserAgentInfoLoader implements UserAgentInfoLoader {
private static final String DEFAULT_USER_AGENT_PREFIX = "Bugle/";
private Context mContext;
private final Context mContext;
private boolean mLoaded;
private String mUserAgent;

View File

@@ -1779,8 +1779,8 @@ public class MmsUtils {
}
public static class SendReqResp {
public SendReq mSendReq;
public SendConf mSendConf;
public final SendReq mSendReq;
public final SendConf mSendConf;
public SendReqResp(final SendReq sendReq, final SendConf sendConf) {
mSendReq = sendReq;

View File

@@ -60,7 +60,7 @@ public class SmsSender {
/*
* A map for pending sms messages. The key is the random request UUID.
*/
private static ConcurrentHashMap<Uri, SendResult> sPendingMessageMap =
private static final ConcurrentHashMap<Uri, SendResult> sPendingMessageMap =
new ConcurrentHashMap<Uri, SendResult>();
private static final Random RANDOM = new Random();

View File

@@ -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.
@@ -67,7 +68,7 @@ public class AsyncImageView extends ImageView implements MediaResourceLoadListen
public final Binding<BindableMediaRequest<ImageResource>> mImageRequestBinding;
/** True if we want the image to fade in when it loads */
private boolean mFadeIn;
private final boolean mFadeIn;
/** True if we want the image to reveal (scale) when it loads. When set to true, this
* will take precedence over {@link #mFadeIn} */

View File

@@ -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.
@@ -53,7 +54,7 @@ public class AttachmentPreview extends ScrollView implements OnAttachmentClickLi
private int mAnimatedHeight = -1;
private Animator mCloseGapAnimator;
private boolean mPendingFirstUpdate;
private Handler mHandler;
private final Handler mHandler;
private Runnable mHideRunnable;
private boolean mPendingHideCanceled;

View File

@@ -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.
@@ -30,9 +31,9 @@ public class CompositeAdapter extends BaseAdapter {
private static final int INITIAL_CAPACITY = 2;
public static class Partition {
boolean mShowIfEmpty;
boolean mHasHeader;
BaseAdapter mAdapter;
final boolean mShowIfEmpty;
final boolean mHasHeader;
final BaseAdapter mAdapter;
public Partition(final boolean showIfEmpty, final boolean hasHeader,
final BaseAdapter adapter) {

View File

@@ -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.
@@ -33,8 +34,8 @@ import com.android.messaging.util.Assert;
public class CustomHeaderViewPager extends LinearLayout {
public final static int DEFAULT_TAB_STRIP_SIZE = -1;
private final int mDefaultTabStripSize;
private ViewPager mViewPager;
private ViewPagerTabs mTabstrip;
private final ViewPager mViewPager;
private final ViewPagerTabs mTabstrip;
public CustomHeaderViewPager(final Context context, final AttributeSet attrs) {
super(context, attrs);

View File

@@ -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.
@@ -130,7 +131,7 @@ public class SnackBar {
private Action mAction;
private Placement mPlacement;
// The parent view is only used to get a window token and doesn't affect the layout
private View mParentView;
private final View mParentView;
public Builder(final SnackBarManager snackBarManager, final View parentView) {
Assert.notNull(snackBarManager);

View File

@@ -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.
@@ -46,7 +47,7 @@ public interface SnackBarInteraction {
* {@link SnackBar} is always shown with {@link Gravity#BOTTOM} and that the provided View will
* always need to be translated up to make room for the SnackBar.
*/
public static class BasicSnackBarInteraction implements SnackBarInteraction {
class BasicSnackBarInteraction implements SnackBarInteraction {
private final View mView;
public BasicSnackBarInteraction(final View view) {
@@ -64,4 +65,4 @@ public interface SnackBarInteraction {
return mView.animate().translationY(0);
}
}
}
}

View File

@@ -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.
@@ -27,7 +28,7 @@ import android.widget.LinearLayout;
import com.android.messaging.R;
public class ViewPagerTabStrip extends LinearLayout {
private int mSelectedUnderlineThickness;
private final int mSelectedUnderlineThickness;
private final Paint mSelectedUnderlinePaint;
private int mIndexForSelection;

View File

@@ -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.
@@ -49,7 +50,7 @@ import com.android.messaging.R;
public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnPageChangeListener {
ViewPager mPager;
private ViewPagerTabStrip mTabStrip;
private final ViewPagerTabStrip mTabStrip;
/**
* Linearlayout that will contain the TextViews serving as tabs. This is the only child
@@ -60,7 +61,7 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP
final int mTextSize;
final boolean mTextAllCaps;
int mPrevSelected = -1;
int mSidePadding;
final int mSidePadding;
private static final int TAB_SIDE_PADDING_IN_DPS = 10;

View File

@@ -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.
@@ -376,8 +377,8 @@ public class ApnSettingsActivity extends BugleActionBarActivity {
}
}
private class RestoreApnProcessHandler extends Handler {
private Handler mCachedRestoreApnUiHandler;
private static class RestoreApnProcessHandler extends Handler {
private final Handler mCachedRestoreApnUiHandler;
public RestoreApnProcessHandler(Looper looper, Handler restoreApnUiHandler) {
super(looper);

View File

@@ -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.
@@ -56,7 +57,7 @@ public class AttachmentChooserFragment extends Fragment implements DraftMessageD
private AttachmentChooserFragmentHost mHost;
@VisibleForTesting
Binding<DraftMessageData> mBinding = BindingBase.createBinding(this);
final Binding<DraftMessageData> mBinding = BindingBase.createBinding(this);
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,

View File

@@ -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.
@@ -36,7 +37,7 @@ public abstract class ConversationInput {
}
protected boolean mShowing;
protected ConversationInputBase mConversationInputBase;
protected final ConversationInputBase mConversationInputBase;
public abstract boolean show(boolean animate);
public abstract boolean hide(boolean animate);

View File

@@ -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.
@@ -77,15 +78,15 @@ public class ConversationListFragment extends Fragment implements ConversationLi
private boolean mForwardMessageMode;
public interface ConversationListFragmentHost {
public void onConversationClick(final ConversationListData listData,
void onConversationClick(final ConversationListData listData,
final ConversationListItemData conversationListItemData,
final boolean isLongClick,
final ConversationListItemView conversationView);
public void onCreateConversationClick();
public boolean isConversationSelected(final String conversationId);
public boolean isSwipeAnimatable();
public boolean isSelectionMode();
public boolean hasWindowFocus();
void onCreateConversationClick();
boolean isConversationSelected(final String conversationId);
boolean isSwipeAnimatable();
boolean isSelectionMode();
boolean hasWindowFocus();
}
private ConversationListFragmentHost mHost;

View File

@@ -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.
@@ -47,8 +48,8 @@ public class ShareIntentFragment extends DialogFragment implements ConversationL
public static final String HIDE_NEW_CONVERSATION_BUTTON_KEY = "hide_conv_button_key";
public interface HostInterface {
public void onConversationClick(final ConversationListItemData conversationListItemData);
public void onCreateConversationClick();
void onConversationClick(final ConversationListItemData conversationListItemData);
void onCreateConversationClick();
}
private final Binding<ConversationListData> mListBinding = BindingBase.createBinding(this);

View File

@@ -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.
@@ -99,8 +100,8 @@ class CameraManager implements FocusOverlayManager.Listener {
* Callback when taking image or video
*/
interface MediaCallback {
static final int MEDIA_CAMERA_CHANGED = 1;
static final int MEDIA_NO_DATA = 2;
int MEDIA_CAMERA_CHANGED = 1;
int MEDIA_NO_DATA = 2;
void onMediaReady(Uri uriToMedia, String contentType, int width, int height);
void onMediaFailed(Exception exception);

View File

@@ -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.
@@ -55,6 +56,7 @@ public class GalleryGridItemView extends FrameLayout {
}
@VisibleForTesting
final
GalleryGridItemData mData;
private AsyncImageView mImageView;
private CheckBox mCheckBox;

View File

@@ -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.
@@ -53,7 +54,7 @@ class GalleryMediaChooser extends MediaChooser implements
private View mMissingPermissionView;
/** Handles picking a media from the document picker. */
private DocumentImagePicker mDocumentImagePicker;
private final DocumentImagePicker mDocumentImagePicker;
GalleryMediaChooser(final MediaPicker mediaPicker) {
super(mediaPicker);

View File

@@ -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.
@@ -36,7 +37,7 @@ import java.io.IOException;
* implementations of the shared methods are delegated to CameraPreview
*/
public class HardwareCameraPreview extends TextureView implements CameraPreview.CameraPreviewHost {
private CameraPreview mPreview;
private final CameraPreview mPreview;
public HardwareCameraPreview(final Context context, final AttributeSet attrs) {
super(context, attrs);

View File

@@ -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.
@@ -17,8 +18,8 @@
package com.android.messaging.ui.mediapicker.camerafocus;
public interface FocusIndicator {
public void showStart();
public void showSuccess(boolean timeout);
public void showFail(boolean timeout);
public void clear();
}
void showStart();
void showSuccess(boolean timeout);
void showFail(boolean timeout);
void clear();
}

View File

@@ -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.
@@ -76,7 +77,7 @@ public class FocusOverlayManager {
private boolean mMeteringAreaSupported;
private boolean mLockAeAwbNeeded;
private boolean mAeAwbLock;
private Matrix mMatrix;
private final Matrix mMatrix;
private PieRenderer mPieRenderer;
@@ -89,14 +90,14 @@ public class FocusOverlayManager {
private String mFocusMode;
private String mOverrideFocusMode;
private Parameters mParameters;
private Handler mHandler;
Listener mListener;
private final Handler mHandler;
private final Listener mListener;
public interface Listener {
public void autoFocus();
public void cancelAutoFocus();
public boolean capture();
public void setFocusParameters();
void autoFocus();
void cancelAutoFocus();
boolean capture();
void setFocusParameters();
}
private class MainHandler extends Handler {

View File

@@ -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.
@@ -29,12 +30,12 @@ import java.util.List;
*/
public class PieItem {
public static interface OnClickListener {
public interface OnClickListener {
void onClick(PieItem item);
}
private Drawable mDrawable;
private int level;
private final int level;
private float mCenter;
private float start;
private float sweep;
@@ -199,4 +200,4 @@ public class PieItem {
setAlpha(mAlpha);
}
}
}

View File

@@ -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.
@@ -46,14 +47,14 @@ public class PieRenderer extends OverlayRenderer
// These states are used to make sure the animation is run for at least some
// time.
private volatile int mState;
private ScaleAnimation mAnimation = new ScaleAnimation();
private final ScaleAnimation mAnimation = new ScaleAnimation();
private static final int STATE_IDLE = 0;
private static final int STATE_FOCUSING = 1;
private static final int STATE_FINISHING = 2;
private static final int STATE_PIE = 8;
private Runnable mDisappear = new Disappear();
private Animation.AnimationListener mEndAction = new EndAction();
private final Runnable mDisappear = new Disappear();
private final Animation.AnimationListener mEndAction = new EndAction();
private static final int SCALING_UP_TIME = 600;
private static final int SCALING_DOWN_TIME = 100;
private static final int DISAPPEAR_TIMEOUT = 200;
@@ -114,7 +115,7 @@ public class PieRenderer extends OverlayRenderer
private LinearAnimation mFadeIn;
private volatile boolean mFocusCancelled;
private Handler mHandler = new Handler() {
private final Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
switch(msg.what) {
case MSG_OPEN:
@@ -133,9 +134,9 @@ public class PieRenderer extends OverlayRenderer
private PieListener mListener;
public static interface PieListener {
public void onPieOpened(int centerX, int centerY);
public void onPieClosed();
public interface PieListener {
void onPieOpened(int centerX, int centerY);
void onPieClosed();
}
public void setPieListener(PieListener pl) {
@@ -801,8 +802,8 @@ public class PieRenderer extends OverlayRenderer
private class LinearAnimation extends Animation {
private float mFrom;
private float mTo;
private final float mFrom;
private final float mTo;
private float mValue;
public LinearAnimation(float from, float to) {
@@ -822,4 +823,4 @@ public class PieRenderer extends OverlayRenderer
}
}
}
}

View File

@@ -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.
@@ -30,20 +31,20 @@ public class RenderOverlay extends FrameLayout {
interface Renderer {
public boolean handlesTouch();
public boolean onTouchEvent(MotionEvent evt);
public void setOverlay(RenderOverlay overlay);
public void layout(int left, int top, int right, int bottom);
public void draw(Canvas canvas);
boolean handlesTouch();
boolean onTouchEvent(MotionEvent evt);
void setOverlay(RenderOverlay overlay);
void layout(int left, int top, int right, int bottom);
void draw(Canvas canvas);
}
private RenderView mRenderView;
private List<Renderer> mClients;
private final RenderView mRenderView;
private final List<Renderer> mClients;
// reverse list of touch clients
private List<Renderer> mTouchClients;
private int[] mPosition = new int[2];
private final List<Renderer> mTouchClients;
private final int[] mPosition = new int[2];
public RenderOverlay(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -175,4 +176,4 @@ public class RenderOverlay extends FrameLayout {
}
}
}
}

View File

@@ -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.
@@ -20,9 +21,9 @@ import android.os.Looper;
import java.util.Arrays;
public final class Assert {
public static @interface RunsOnMainThread {}
public static @interface DoesNotRunOnMainThread {}
public static @interface RunsOnAnyThread {}
public @interface RunsOnMainThread {}
public @interface DoesNotRunOnMainThread {}
public @interface RunsOnAnyThread {}
private static final String TEST_THREAD_SUBSTRING = "test";

View File

@@ -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.
@@ -25,7 +26,7 @@ package com.android.messaging.util;
public class CircularArray<E> {
private int mNextWriter;
private boolean mHasWrapped;
private int mMaxCount;
private final int mMaxCount;
Object mList[];
/**

View File

@@ -36,7 +36,7 @@ public class ConnectivityUtil {
private ConnectivityListener mListener;
public interface ConnectivityListener {
public void onPhoneStateChanged(int serviceState);
void onPhoneStateChanged(int serviceState);
}
public ConnectivityUtil(final Context context, final int subId) {

View File

@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007-2008 Esmertec AG.
* Copyright (C) 2007-2008 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.
@@ -20,10 +21,10 @@ package com.android.messaging.util;
import android.webkit.MimeTypeMap;
public final class ContentType {
public static String THREE_GPP_EXTENSION = "3gp";
public static String VIDEO_MP4_EXTENSION = "mp4";
public static final String THREE_GPP_EXTENSION = "3gp";
public static final String VIDEO_MP4_EXTENSION = "mp4";
// Default extension used when we don't know one.
public static String DEFAULT_EXTENSION = "dat";
public static final String DEFAULT_EXTENSION = "dat";
public static final int TYPE_IMAGE = 0;
public static final int TYPE_VIDEO = 1;

View File

@@ -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.
@@ -95,7 +96,7 @@ public class DebugUtils {
}
public abstract static class DebugAction {
String mTitle;
final String mTitle;
public DebugAction(final String title) {
mTitle = title;
}

View File

@@ -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.
@@ -33,8 +34,8 @@ import java.util.concurrent.TimeUnit;
public class GifTranscoder {
private static final String TAG = LogUtil.BUGLE_TAG;
private static int MIN_HEIGHT = 100;
private static int MIN_WIDTH = 100;
private static final int MIN_HEIGHT = 100;
private static final int MIN_WIDTH = 100;
static {
System.loadLibrary("giftranscode");

View File

@@ -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.
@@ -20,8 +21,8 @@ import android.content.Context;
import com.android.messaging.Factory;
public abstract class MediaUtil {
public static interface OnCompletionListener {
public void onCompletion();
public interface OnCompletionListener {
void onCompletion();
}
public static MediaUtil get() {

View File

@@ -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.
@@ -71,7 +72,7 @@ public class NotificationPlayer implements OnCompletionListener {
* be created with a looper running so its event handler is not null.
*/
private final class CreationAndCompletionThread extends Thread {
public Command mCmd;
public final Command mCmd;
public CreationAndCompletionThread(final Command cmd) {
super();
mCmd = cmd;
@@ -235,7 +236,7 @@ public class NotificationPlayer implements OnCompletionListener {
}
}
private String mTag;
private final String mTag;
private CmdThread mThread;
private CreationAndCompletionThread mCompletionThread;
private final Object mCompletionHandlingLock = new Object();

View File

@@ -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.
@@ -76,7 +77,7 @@ public class OsUtil {
return null;
}
private static Hashtable<String, Integer> sPermissions = new Hashtable<String, Integer>();
private static final Hashtable<String, Integer> sPermissions = new Hashtable<String, Integer>();
/**
* Check if the app has the specified permission. If it does not, the app needs to use
@@ -150,7 +151,7 @@ public class OsUtil {
return missingArray;
}
private static String[] sRequiredPermissions = new String[] {
private static final String[] sRequiredPermissions = new String[] {
// Required to read existing SMS threads
Manifest.permission.READ_SMS,
// Required for knowing the phone number, number of SIMs, etc.

View File

@@ -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.
@@ -42,7 +43,7 @@ public abstract class SafeAsyncTask<Params, Progress, Result>
private static final String WAKELOCK_ID = "bugle_safe_async_task_wakelock";
protected static final int WAKELOCK_OP = 1000;
private static WakeLockHelper sWakeLock = new WakeLockHelper(WAKELOCK_ID);
private static final WakeLockHelper sWakeLock = new WakeLockHelper(WAKELOCK_ID);
private final long mMaxExecutionTimeMillis;
private final boolean mCancelExecutionOnTimeout;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 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.
@@ -322,7 +323,7 @@ public class ExifInterface {
* Tags that contain offset markers. These are included in the banned
* defines.
*/
private static HashSet<Short> sOffsetTags = new HashSet<Short>();
private static final HashSet<Short> sOffsetTags = new HashSet<Short>();
static {
sOffsetTags.add(getTrueTagKey(TAG_GPS_IFD));
sOffsetTags.add(getTrueTagKey(TAG_EXIF_IFD));
@@ -334,7 +335,7 @@ public class ExifInterface {
/**
* Tags with definitions that cannot be overridden (banned defines).
*/
protected static HashSet<Short> sBannedDefines = new HashSet<Short>(sOffsetTags);
protected static final HashSet<Short> sBannedDefines = new HashSet<Short>(sOffsetTags);
static {
sBannedDefines.add(getTrueTagKey(TAG_NULL));
sBannedDefines.add(getTrueTagKey(TAG_JPEG_INTERCHANGE_FORMAT_LENGTH));
@@ -377,84 +378,84 @@ public class ExifInterface {
* <li>RIGHT_BOTTOM is a 270 degree clockwise rotation.</li>
* </ul>
*/
public static interface Orientation {
public static final short TOP_LEFT = 1;
public static final short TOP_RIGHT = 2;
public static final short BOTTOM_LEFT = 3;
public static final short BOTTOM_RIGHT = 4;
public static final short LEFT_TOP = 5;
public static final short RIGHT_TOP = 6;
public static final short LEFT_BOTTOM = 7;
public static final short RIGHT_BOTTOM = 8;
public interface Orientation {
short TOP_LEFT = 1;
short TOP_RIGHT = 2;
short BOTTOM_LEFT = 3;
short BOTTOM_RIGHT = 4;
short LEFT_TOP = 5;
short RIGHT_TOP = 6;
short LEFT_BOTTOM = 7;
short RIGHT_BOTTOM = 8;
}
/**
* Constants for {@link TAG_Y_CB_CR_POSITIONING}
*/
public static interface YCbCrPositioning {
public static final short CENTERED = 1;
public static final short CO_SITED = 2;
public interface YCbCrPositioning {
short CENTERED = 1;
short CO_SITED = 2;
}
/**
* Constants for {@link TAG_COMPRESSION}
*/
public static interface Compression {
public static final short UNCOMPRESSION = 1;
public static final short JPEG = 6;
public interface Compression {
short UNCOMPRESSION = 1;
short JPEG = 6;
}
/**
* Constants for {@link TAG_RESOLUTION_UNIT}
*/
public static interface ResolutionUnit {
public static final short INCHES = 2;
public static final short CENTIMETERS = 3;
public interface ResolutionUnit {
short INCHES = 2;
short CENTIMETERS = 3;
}
/**
* Constants for {@link TAG_PHOTOMETRIC_INTERPRETATION}
*/
public static interface PhotometricInterpretation {
public static final short RGB = 2;
public static final short YCBCR = 6;
public interface PhotometricInterpretation {
short RGB = 2;
short YCBCR = 6;
}
/**
* Constants for {@link TAG_PLANAR_CONFIGURATION}
*/
public static interface PlanarConfiguration {
public static final short CHUNKY = 1;
public static final short PLANAR = 2;
public interface PlanarConfiguration {
short CHUNKY = 1;
short PLANAR = 2;
}
/**
* Constants for {@link TAG_EXPOSURE_PROGRAM}
*/
public static interface ExposureProgram {
public static final short NOT_DEFINED = 0;
public static final short MANUAL = 1;
public static final short NORMAL_PROGRAM = 2;
public static final short APERTURE_PRIORITY = 3;
public static final short SHUTTER_PRIORITY = 4;
public static final short CREATIVE_PROGRAM = 5;
public static final short ACTION_PROGRAM = 6;
public static final short PROTRAIT_MODE = 7;
public static final short LANDSCAPE_MODE = 8;
public interface ExposureProgram {
short NOT_DEFINED = 0;
short MANUAL = 1;
short NORMAL_PROGRAM = 2;
short APERTURE_PRIORITY = 3;
short SHUTTER_PRIORITY = 4;
short CREATIVE_PROGRAM = 5;
short ACTION_PROGRAM = 6;
short PROTRAIT_MODE = 7;
short LANDSCAPE_MODE = 8;
}
/**
* Constants for {@link TAG_METERING_MODE}
*/
public static interface MeteringMode {
public static final short UNKNOWN = 0;
public static final short AVERAGE = 1;
public static final short CENTER_WEIGHTED_AVERAGE = 2;
public static final short SPOT = 3;
public static final short MULTISPOT = 4;
public static final short PATTERN = 5;
public static final short PARTAIL = 6;
public static final short OTHER = 255;
public interface MeteringMode {
short UNKNOWN = 0;
short AVERAGE = 1;
short CENTER_WEIGHTED_AVERAGE = 2;
short SPOT = 3;
short MULTISPOT = 4;
short PATTERN = 5;
short PARTAIL = 6;
short OTHER = 255;
}
/**
@@ -466,244 +467,244 @@ public class ExifInterface {
* short flash = FIRED | RETURN_STROBE_RETURN_LIGHT_DETECTED |
* MODE_AUTO_MODE
*/
public static interface Flash {
public interface Flash {
// LSB
public static final short DID_NOT_FIRED = 0;
public static final short FIRED = 1;
short DID_NOT_FIRED = 0;
short FIRED = 1;
// 1st~2nd bits
public static final short RETURN_NO_STROBE_RETURN_DETECTION_FUNCTION = 0 << 1;
public static final short RETURN_STROBE_RETURN_LIGHT_NOT_DETECTED = 2 << 1;
public static final short RETURN_STROBE_RETURN_LIGHT_DETECTED = 3 << 1;
short RETURN_NO_STROBE_RETURN_DETECTION_FUNCTION = 0 << 1;
short RETURN_STROBE_RETURN_LIGHT_NOT_DETECTED = 2 << 1;
short RETURN_STROBE_RETURN_LIGHT_DETECTED = 3 << 1;
// 3rd~4th bits
public static final short MODE_UNKNOWN = 0 << 3;
public static final short MODE_COMPULSORY_FLASH_FIRING = 1 << 3;
public static final short MODE_COMPULSORY_FLASH_SUPPRESSION = 2 << 3;
public static final short MODE_AUTO_MODE = 3 << 3;
short MODE_UNKNOWN = 0 << 3;
short MODE_COMPULSORY_FLASH_FIRING = 1 << 3;
short MODE_COMPULSORY_FLASH_SUPPRESSION = 2 << 3;
short MODE_AUTO_MODE = 3 << 3;
// 5th bit
public static final short FUNCTION_PRESENT = 0 << 5;
public static final short FUNCTION_NO_FUNCTION = 1 << 5;
short FUNCTION_PRESENT = 0 << 5;
short FUNCTION_NO_FUNCTION = 1 << 5;
// 6th bit
public static final short RED_EYE_REDUCTION_NO_OR_UNKNOWN = 0 << 6;
public static final short RED_EYE_REDUCTION_SUPPORT = 1 << 6;
short RED_EYE_REDUCTION_NO_OR_UNKNOWN = 0 << 6;
short RED_EYE_REDUCTION_SUPPORT = 1 << 6;
}
/**
* Constants for {@link TAG_COLOR_SPACE}
*/
public static interface ColorSpace {
public static final short SRGB = 1;
public static final short UNCALIBRATED = (short) 0xFFFF;
public interface ColorSpace {
short SRGB = 1;
short UNCALIBRATED = (short) 0xFFFF;
}
/**
* Constants for {@link TAG_EXPOSURE_MODE}
*/
public static interface ExposureMode {
public static final short AUTO_EXPOSURE = 0;
public static final short MANUAL_EXPOSURE = 1;
public static final short AUTO_BRACKET = 2;
public interface ExposureMode {
short AUTO_EXPOSURE = 0;
short MANUAL_EXPOSURE = 1;
short AUTO_BRACKET = 2;
}
/**
* Constants for {@link TAG_WHITE_BALANCE}
*/
public static interface WhiteBalance {
public static final short AUTO = 0;
public static final short MANUAL = 1;
public interface WhiteBalance {
short AUTO = 0;
short MANUAL = 1;
}
/**
* Constants for {@link TAG_SCENE_CAPTURE_TYPE}
*/
public static interface SceneCapture {
public static final short STANDARD = 0;
public static final short LANDSCAPE = 1;
public static final short PROTRAIT = 2;
public static final short NIGHT_SCENE = 3;
public interface SceneCapture {
short STANDARD = 0;
short LANDSCAPE = 1;
short PROTRAIT = 2;
short NIGHT_SCENE = 3;
}
/**
* Constants for {@link TAG_COMPONENTS_CONFIGURATION}
*/
public static interface ComponentsConfiguration {
public static final short NOT_EXIST = 0;
public static final short Y = 1;
public static final short CB = 2;
public static final short CR = 3;
public static final short R = 4;
public static final short G = 5;
public static final short B = 6;
public interface ComponentsConfiguration {
short NOT_EXIST = 0;
short Y = 1;
short CB = 2;
short CR = 3;
short R = 4;
short G = 5;
short B = 6;
}
/**
* Constants for {@link TAG_LIGHT_SOURCE}
*/
public static interface LightSource {
public static final short UNKNOWN = 0;
public static final short DAYLIGHT = 1;
public static final short FLUORESCENT = 2;
public static final short TUNGSTEN = 3;
public static final short FLASH = 4;
public static final short FINE_WEATHER = 9;
public static final short CLOUDY_WEATHER = 10;
public static final short SHADE = 11;
public static final short DAYLIGHT_FLUORESCENT = 12;
public static final short DAY_WHITE_FLUORESCENT = 13;
public static final short COOL_WHITE_FLUORESCENT = 14;
public static final short WHITE_FLUORESCENT = 15;
public static final short STANDARD_LIGHT_A = 17;
public static final short STANDARD_LIGHT_B = 18;
public static final short STANDARD_LIGHT_C = 19;
public static final short D55 = 20;
public static final short D65 = 21;
public static final short D75 = 22;
public static final short D50 = 23;
public static final short ISO_STUDIO_TUNGSTEN = 24;
public static final short OTHER = 255;
public interface LightSource {
short UNKNOWN = 0;
short DAYLIGHT = 1;
short FLUORESCENT = 2;
short TUNGSTEN = 3;
short FLASH = 4;
short FINE_WEATHER = 9;
short CLOUDY_WEATHER = 10;
short SHADE = 11;
short DAYLIGHT_FLUORESCENT = 12;
short DAY_WHITE_FLUORESCENT = 13;
short COOL_WHITE_FLUORESCENT = 14;
short WHITE_FLUORESCENT = 15;
short STANDARD_LIGHT_A = 17;
short STANDARD_LIGHT_B = 18;
short STANDARD_LIGHT_C = 19;
short D55 = 20;
short D65 = 21;
short D75 = 22;
short D50 = 23;
short ISO_STUDIO_TUNGSTEN = 24;
short OTHER = 255;
}
/**
* Constants for {@link TAG_SENSING_METHOD}
*/
public static interface SensingMethod {
public static final short NOT_DEFINED = 1;
public static final short ONE_CHIP_COLOR = 2;
public static final short TWO_CHIP_COLOR = 3;
public static final short THREE_CHIP_COLOR = 4;
public static final short COLOR_SEQUENTIAL_AREA = 5;
public static final short TRILINEAR = 7;
public static final short COLOR_SEQUENTIAL_LINEAR = 8;
public interface SensingMethod {
short NOT_DEFINED = 1;
short ONE_CHIP_COLOR = 2;
short TWO_CHIP_COLOR = 3;
short THREE_CHIP_COLOR = 4;
short COLOR_SEQUENTIAL_AREA = 5;
short TRILINEAR = 7;
short COLOR_SEQUENTIAL_LINEAR = 8;
}
/**
* Constants for {@link TAG_FILE_SOURCE}
*/
public static interface FileSource {
public static final short DSC = 3;
public interface FileSource {
short DSC = 3;
}
/**
* Constants for {@link TAG_SCENE_TYPE}
*/
public static interface SceneType {
public static final short DIRECT_PHOTOGRAPHED = 1;
public interface SceneType {
short DIRECT_PHOTOGRAPHED = 1;
}
/**
* Constants for {@link TAG_GAIN_CONTROL}
*/
public static interface GainControl {
public static final short NONE = 0;
public static final short LOW_UP = 1;
public static final short HIGH_UP = 2;
public static final short LOW_DOWN = 3;
public static final short HIGH_DOWN = 4;
public interface GainControl {
short NONE = 0;
short LOW_UP = 1;
short HIGH_UP = 2;
short LOW_DOWN = 3;
short HIGH_DOWN = 4;
}
/**
* Constants for {@link TAG_CONTRAST}
*/
public static interface Contrast {
public static final short NORMAL = 0;
public static final short SOFT = 1;
public static final short HARD = 2;
public interface Contrast {
short NORMAL = 0;
short SOFT = 1;
short HARD = 2;
}
/**
* Constants for {@link TAG_SATURATION}
*/
public static interface Saturation {
public static final short NORMAL = 0;
public static final short LOW = 1;
public static final short HIGH = 2;
public interface Saturation {
short NORMAL = 0;
short LOW = 1;
short HIGH = 2;
}
/**
* Constants for {@link TAG_SHARPNESS}
*/
public static interface Sharpness {
public static final short NORMAL = 0;
public static final short SOFT = 1;
public static final short HARD = 2;
public interface Sharpness {
short NORMAL = 0;
short SOFT = 1;
short HARD = 2;
}
/**
* Constants for {@link TAG_SUBJECT_DISTANCE}
*/
public static interface SubjectDistance {
public static final short UNKNOWN = 0;
public static final short MACRO = 1;
public static final short CLOSE_VIEW = 2;
public static final short DISTANT_VIEW = 3;
public interface SubjectDistance {
short UNKNOWN = 0;
short MACRO = 1;
short CLOSE_VIEW = 2;
short DISTANT_VIEW = 3;
}
/**
* Constants for {@link TAG_GPS_LATITUDE_REF},
* {@link TAG_GPS_DEST_LATITUDE_REF}
*/
public static interface GpsLatitudeRef {
public static final String NORTH = "N";
public static final String SOUTH = "S";
public interface GpsLatitudeRef {
String NORTH = "N";
String SOUTH = "S";
}
/**
* Constants for {@link TAG_GPS_LONGITUDE_REF},
* {@link TAG_GPS_DEST_LONGITUDE_REF}
*/
public static interface GpsLongitudeRef {
public static final String EAST = "E";
public static final String WEST = "W";
public interface GpsLongitudeRef {
String EAST = "E";
String WEST = "W";
}
/**
* Constants for {@link TAG_GPS_ALTITUDE_REF}
*/
public static interface GpsAltitudeRef {
public static final short SEA_LEVEL = 0;
public static final short SEA_LEVEL_NEGATIVE = 1;
public interface GpsAltitudeRef {
short SEA_LEVEL = 0;
short SEA_LEVEL_NEGATIVE = 1;
}
/**
* Constants for {@link TAG_GPS_STATUS}
*/
public static interface GpsStatus {
public static final String IN_PROGRESS = "A";
public static final String INTEROPERABILITY = "V";
public interface GpsStatus {
String IN_PROGRESS = "A";
String INTEROPERABILITY = "V";
}
/**
* Constants for {@link TAG_GPS_MEASURE_MODE}
*/
public static interface GpsMeasureMode {
public static final String MODE_2_DIMENSIONAL = "2";
public static final String MODE_3_DIMENSIONAL = "3";
public interface GpsMeasureMode {
String MODE_2_DIMENSIONAL = "2";
String MODE_3_DIMENSIONAL = "3";
}
/**
* Constants for {@link TAG_GPS_SPEED_REF},
* {@link TAG_GPS_DEST_DISTANCE_REF}
*/
public static interface GpsSpeedRef {
public static final String KILOMETERS = "K";
public static final String MILES = "M";
public static final String KNOTS = "N";
public interface GpsSpeedRef {
String KILOMETERS = "K";
String MILES = "M";
String KNOTS = "N";
}
/**
* Constants for {@link TAG_GPS_TRACK_REF},
* {@link TAG_GPS_IMG_DIRECTION_REF}, {@link TAG_GPS_DEST_BEARING_REF}
*/
public static interface GpsTrackRef {
public static final String TRUE_DIRECTION = "T";
public static final String MAGNETIC_DIRECTION = "M";
public interface GpsTrackRef {
String TRUE_DIRECTION = "T";
String MAGNETIC_DIRECTION = "M";
}
/**
* Constants for {@link TAG_GPS_DIFFERENTIAL}
*/
public static interface GpsDifferential {
public static final short WITHOUT_DIFFERENTIAL_CORRECTION = 0;
public static final short DIFFERENTIAL_CORRECTION_APPLIED = 1;
public interface GpsDifferential {
short WITHOUT_DIFFERENTIAL_CORRECTION = 0;
short DIFFERENTIAL_CORRECTION_APPLIED = 1;
}
private static final String NULL_ARGUMENT_STRING = "Argument is null";

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 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.
@@ -877,8 +878,8 @@ public class ExifParser {
}
private static class ImageEvent {
int stripIndex;
int type;
final int stripIndex;
final int type;
ImageEvent(int type) {
this.stripIndex = 0;
@@ -892,8 +893,8 @@ public class ExifParser {
}
private static class IfdEvent {
int ifd;
boolean isRequested;
final int ifd;
final boolean isRequested;
IfdEvent(int ifd, boolean isInterestedIfd) {
this.ifd = ifd;
@@ -902,8 +903,8 @@ public class ExifParser {
}
private static class ExifTagEvent {
ExifTag tag;
boolean isRequested;
final ExifTag tag;
final boolean isRequested;
ExifTagEvent(ExifTag tag, boolean isRequireByUser) {
this.tag = tag;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 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.
@@ -67,7 +68,7 @@ public class ExifTag {
*/
public static final short TYPE_RATIONAL = 10;
private static Charset US_ASCII = Charset.forName("US-ASCII");
private static final Charset US_ASCII = Charset.forName("US-ASCII");
private static final int TYPE_TO_SIZE_MAP[] = new int[11];
private static final int UNSIGNED_SHORT_MAX = 65535;
private static final long UNSIGNED_LONG_MAX = 4294967295L;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 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.
@@ -20,12 +21,12 @@ package com.android.messaging.util.exif;
* The constants of the IFD ID defined in EXIF spec.
*/
public interface IfdId {
public static final int TYPE_IFD_0 = 0;
public static final int TYPE_IFD_1 = 1;
public static final int TYPE_IFD_EXIF = 2;
public static final int TYPE_IFD_INTEROPERABILITY = 3;
public static final int TYPE_IFD_GPS = 4;
int TYPE_IFD_0 = 0;
int TYPE_IFD_1 = 1;
int TYPE_IFD_EXIF = 2;
int TYPE_IFD_INTEROPERABILITY = 3;
int TYPE_IFD_GPS = 4;
/* This is used in ExifData to allocate enough IfdData */
static final int TYPE_IFD_COUNT = 5;
int TYPE_IFD_COUNT = 5;
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 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.
@@ -32,7 +33,7 @@ class JpegHeader {
public static final short JPG = (short) 0xFFC8;
public static final short DAC = (short) 0xFFCC;
public static final boolean isSofMarker(short marker) {
public static boolean isSofMarker(short marker) {
return marker >= SOF0 && marker <= SOF15 && marker != DHT && marker != JPG
&& marker != DAC;
}

View File

@@ -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.
@@ -72,7 +73,7 @@ public class WidgetConversationService extends RemoteViewsService {
*/
private static class WidgetConversationFactory extends BaseWidgetFactory {
private ImageResource mImageResource;
private String mConversationId;
private final String mConversationId;
public WidgetConversationFactory(Context context, Intent intent) {
super(context, intent);