From 21cb2b6289f7e37abc920b751e931c0cedaf4dbb Mon Sep 17 00:00:00 2001 From: Michael W Date: Sun, 8 Dec 2024 21:40:43 +0100 Subject: [PATCH] Messaging: Fix modifiers We either have too few or too many Change-Id: I09a9a38b859c68526fcbcdbc7862afe1d693f6c0 --- .../v7/mms/CarrierConfigValuesLoader.java | 124 +++---- .../v7/mms/DefaultUserAgentInfoLoader.java | 2 +- src/android/support/v7/mms/MmsManager.java | 2 +- src/android/support/v7/mms/MmsService.java | 2 +- .../support/v7/mms/UserAgentInfoLoader.java | 4 +- src/android/support/v7/mms/pdu/Base64.java | 2 +- .../support/v7/mms/pdu/QuotedPrintable.java | 4 +- .../datamodel/ConversationImagePartsView.java | 23 +- .../messaging/datamodel/DataModel.java | 6 +- .../messaging/datamodel/DatabaseHelper.java | 2 +- .../messaging/datamodel/DatabaseWrapper.java | 5 +- .../datamodel/MessageNotificationState.java | 9 +- .../datamodel/NotificationState.java | 5 +- .../datamodel/ParticipantRefresh.java | 3 +- .../messaging/datamodel/action/Action.java | 3 +- .../datamodel/action/ActionMonitor.java | 20 +- .../datamodel/action/DownloadMmsAction.java | 13 +- .../action/GetOrCreateConversationAction.java | 9 +- .../datamodel/action/ReadDraftDataAction.java | 9 +- .../datamodel/action/SyncCursorPair.java | 9 +- .../UpdateDestinationBlockedAction.java | 9 +- .../messaging/datamodel/binding/Binding.java | 3 +- .../data/BlockedParticipantsData.java | 3 +- .../datamodel/data/ConversationData.java | 11 +- .../datamodel/data/ConversationListData.java | 5 +- .../data/ConversationListItemData.java | 5 +- .../data/ConversationMessageData.java | 71 ++-- .../datamodel/data/DraftMessageData.java | 15 +- .../messaging/datamodel/data/MessageData.java | 7 +- .../datamodel/media/AvatarRequest.java | 2 +- .../media/CustomVCardEntryConstructor.java | 9 +- .../datamodel/media/MediaRequest.java | 7 +- .../android/messaging/mmslib/pdu/Base64.java | 3 +- .../messaging/mmslib/pdu/QuotedPrintable.java | 5 +- .../mmslib/util/DrmConvertSession.java | 5 +- .../messaging/mmslib/util/PduCache.java | 3 +- .../messaging/sms/ApnsXmlProcessor.java | 5 +- .../sms/BugleUserAgentInfoLoader.java | 2 +- src/com/android/messaging/sms/MmsUtils.java | 4 +- src/com/android/messaging/sms/SmsSender.java | 2 +- .../android/messaging/ui/AsyncImageView.java | 3 +- .../messaging/ui/AttachmentPreview.java | 3 +- .../messaging/ui/CompositeAdapter.java | 7 +- .../messaging/ui/CustomHeaderViewPager.java | 5 +- src/com/android/messaging/ui/SnackBar.java | 3 +- .../messaging/ui/SnackBarInteraction.java | 5 +- .../messaging/ui/ViewPagerTabStrip.java | 3 +- .../android/messaging/ui/ViewPagerTabs.java | 5 +- .../ui/appsettings/ApnSettingsActivity.java | 5 +- .../AttachmentChooserFragment.java | 3 +- .../ui/conversation/ConversationInput.java | 3 +- .../ConversationListFragment.java | 13 +- .../conversationlist/ShareIntentFragment.java | 5 +- .../ui/mediapicker/CameraManager.java | 5 +- .../ui/mediapicker/GalleryGridItemView.java | 2 + .../ui/mediapicker/GalleryMediaChooser.java | 3 +- .../ui/mediapicker/HardwareCameraPreview.java | 3 +- .../camerafocus/FocusIndicator.java | 11 +- .../camerafocus/FocusOverlayManager.java | 15 +- .../ui/mediapicker/camerafocus/PieItem.java | 7 +- .../mediapicker/camerafocus/PieRenderer.java | 21 +- .../camerafocus/RenderOverlay.java | 21 +- src/com/android/messaging/util/Assert.java | 7 +- .../android/messaging/util/CircularArray.java | 3 +- .../messaging/util/ConnectivityUtil.java | 2 +- .../android/messaging/util/ContentType.java | 7 +- .../android/messaging/util/DebugUtils.java | 3 +- .../android/messaging/util/GifTranscoder.java | 5 +- src/com/android/messaging/util/MediaUtil.java | 5 +- .../messaging/util/NotificationPlayer.java | 5 +- src/com/android/messaging/util/OsUtil.java | 5 +- .../android/messaging/util/SafeAsyncTask.java | 3 +- .../messaging/util/exif/ExifInterface.java | 329 +++++++++--------- .../messaging/util/exif/ExifParser.java | 13 +- .../android/messaging/util/exif/ExifTag.java | 3 +- .../android/messaging/util/exif/IfdId.java | 13 +- .../messaging/util/exif/JpegHeader.java | 3 +- .../widget/WidgetConversationService.java | 3 +- 78 files changed, 528 insertions(+), 464 deletions(-) diff --git a/src/android/support/v7/mms/CarrierConfigValuesLoader.java b/src/android/support/v7/mms/CarrierConfigValuesLoader.java index 0dd8d35..e65a8d8 100644 --- a/src/android/support/v7/mms/CarrierConfigValuesLoader.java +++ b/src/android/support/v7/mms/CarrierConfigValuesLoader.java @@ -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; } diff --git a/src/android/support/v7/mms/DefaultUserAgentInfoLoader.java b/src/android/support/v7/mms/DefaultUserAgentInfoLoader.java index 1c70990..5a826be 100644 --- a/src/android/support/v7/mms/DefaultUserAgentInfoLoader.java +++ b/src/android/support/v7/mms/DefaultUserAgentInfoLoader.java @@ -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; diff --git a/src/android/support/v7/mms/MmsManager.java b/src/android/support/v7/mms/MmsManager.java index e43baf9..9c09f8c 100644 --- a/src/android/support/v7/mms/MmsManager.java +++ b/src/android/support/v7/mms/MmsManager.java @@ -37,7 +37,7 @@ public class MmsManager { private static volatile boolean sForceLegacyMms = false; // Cached computed overrides for carrier configuration values - private static SparseArray sConfigOverridesMap = new SparseArray<>(); + private static final SparseArray sConfigOverridesMap = new SparseArray<>(); /** * Set the flag about whether to force to use legacy system APIs instead of system MMS API diff --git a/src/android/support/v7/mms/MmsService.java b/src/android/support/v7/mms/MmsService.java index 061818a..5330e08 100644 --- a/src/android/support/v7/mms/MmsService.java +++ b/src/android/support/v7/mms/MmsService.java @@ -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; diff --git a/src/android/support/v7/mms/UserAgentInfoLoader.java b/src/android/support/v7/mms/UserAgentInfoLoader.java index 29b58e4..fb1e421 100644 --- a/src/android/support/v7/mms/UserAgentInfoLoader.java +++ b/src/android/support/v7/mms/UserAgentInfoLoader.java @@ -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 diff --git a/src/android/support/v7/mms/pdu/Base64.java b/src/android/support/v7/mms/pdu/Base64.java index 81c6676..63c592b 100644 --- a/src/android/support/v7/mms/pdu/Base64.java +++ b/src/android/support/v7/mms/pdu/Base64.java @@ -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 { diff --git a/src/android/support/v7/mms/pdu/QuotedPrintable.java b/src/android/support/v7/mms/pdu/QuotedPrintable.java index c746138..202e7a2 100644 --- a/src/android/support/v7/mms/pdu/QuotedPrintable.java +++ b/src/android/support/v7/mms/pdu/QuotedPrintable.java @@ -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; } diff --git a/src/com/android/messaging/datamodel/ConversationImagePartsView.java b/src/com/android/messaging/datamodel/ConversationImagePartsView.java index 70ba381..5fd8895 100644 --- a/src/com/android/messaging/datamodel/ConversationImagePartsView.java +++ b/src/com/android/messaging/datamodel/ConversationImagePartsView.java @@ -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; } } diff --git a/src/com/android/messaging/datamodel/DataModel.java b/src/com/android/messaging/datamodel/DataModel.java index b606c72..98055ad 100644 --- a/src/com/android/messaging/datamodel/DataModel.java +++ b/src/com/android/messaging/datamodel/DataModel.java @@ -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); } diff --git a/src/com/android/messaging/datamodel/DatabaseHelper.java b/src/com/android/messaging/datamodel/DatabaseHelper.java index d62b166..433d9d8 100644 --- a/src/com/android/messaging/datamodel/DatabaseHelper.java +++ b/src/com/android/messaging/datamodel/DatabaseHelper.java @@ -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)); } diff --git a/src/com/android/messaging/datamodel/DatabaseWrapper.java b/src/com/android/messaging/datamodel/DatabaseWrapper.java index c08d5aa..be5de94 100644 --- a/src/com/android/messaging/datamodel/DatabaseWrapper.java +++ b/src/com/android/messaging/datamodel/DatabaseWrapper.java @@ -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> sTransactionDepth = + private static final ThreadLocal> sTransactionDepth = new ThreadLocal>() { @Override public Stack 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", diff --git a/src/com/android/messaging/datamodel/MessageNotificationState.java b/src/com/android/messaging/datamodel/MessageNotificationState.java index b30802a..76b5b61 100644 --- a/src/com/android/messaging/datamodel/MessageNotificationState.java +++ b/src/com/android/messaging/datamodel/MessageNotificationState.java @@ -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); diff --git a/src/com/android/messaging/datamodel/NotificationState.java b/src/com/android/messaging/datamodel/NotificationState.java index 144f0fe..f867a99 100644 --- a/src/com/android/messaging/datamodel/NotificationState.java +++ b/src/com/android/messaging/datamodel/NotificationState.java @@ -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"; } diff --git a/src/com/android/messaging/datamodel/ParticipantRefresh.java b/src/com/android/messaging/datamodel/ParticipantRefresh.java index 859a7d6..2346168 100644 --- a/src/com/android/messaging/datamodel/ParticipantRefresh.java +++ b/src/com/android/messaging/datamodel/ParticipantRefresh.java @@ -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 getExistingSubIds() { + private static Set getExistingSubIds() { final DatabaseWrapper db = DataModel.get().getDatabase(); final HashSet existingSubIds = new HashSet(); diff --git a/src/com/android/messaging/datamodel/action/Action.java b/src/com/android/messaging/datamodel/action/Action.java index e4c332e..63873e8 100644 --- a/src/com/android/messaging/datamodel/action/Action.java +++ b/src/com/android/messaging/datamodel/action/Action.java @@ -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 mBackgroundActions = new LinkedList(); diff --git a/src/com/android/messaging/datamodel/action/ActionMonitor.java b/src/com/android/messaging/datamodel/action/ActionMonitor.java index ac83414..db20de8 100644 --- a/src/com/android/messaging/datamodel/action/ActionMonitor.java +++ b/src/com/android/messaging/datamodel/action/ActionMonitor.java @@ -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 sActionMonitors = + static final SimpleArrayMap sActionMonitors = new SimpleArrayMap(); /** diff --git a/src/com/android/messaging/datamodel/action/DownloadMmsAction.java b/src/com/android/messaging/datamodel/action/DownloadMmsAction.java index 2852a61..e7a8713 100644 --- a/src/com/android/messaging/datamodel/action/DownloadMmsAction.java +++ b/src/com/android/messaging/datamodel/action/DownloadMmsAction.java @@ -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); } /** diff --git a/src/com/android/messaging/datamodel/action/GetOrCreateConversationAction.java b/src/com/android/messaging/datamodel/action/GetOrCreateConversationAction.java index 7dd09c1..92685e0 100644 --- a/src/com/android/messaging/datamodel/action/GetOrCreateConversationAction.java +++ b/src/com/android/messaging/datamodel/action/GetOrCreateConversationAction.java @@ -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( diff --git a/src/com/android/messaging/datamodel/action/ReadDraftDataAction.java b/src/com/android/messaging/datamodel/action/ReadDraftDataAction.java index 7ac646b..46f584e 100644 --- a/src/com/android/messaging/datamodel/action/ReadDraftDataAction.java +++ b/src/com/android/messaging/datamodel/action/ReadDraftDataAction.java @@ -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); } /** diff --git a/src/com/android/messaging/datamodel/action/SyncCursorPair.java b/src/com/android/messaging/datamodel/action/SyncCursorPair.java index e2fd7ec..7329b71 100644 --- a/src/com/android/messaging/datamodel/action/SyncCursorPair.java +++ b/src/com/android/messaging/datamodel/action/SyncCursorPair.java @@ -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"; diff --git a/src/com/android/messaging/datamodel/action/UpdateDestinationBlockedAction.java b/src/com/android/messaging/datamodel/action/UpdateDestinationBlockedAction.java index c74096d..414ffe3 100644 --- a/src/com/android/messaging/datamodel/action/UpdateDestinationBlockedAction.java +++ b/src/com/android/messaging/datamodel/action/UpdateDestinationBlockedAction.java @@ -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 diff --git a/src/com/android/messaging/datamodel/binding/Binding.java b/src/com/android/messaging/datamodel/binding/Binding.java index 3ec01dd..bac463e 100644 --- a/src/com/android/messaging/datamodel/binding/Binding.java +++ b/src/com/android/messaging/datamodel/binding/Binding.java @@ -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 extends BindingBase { - 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; diff --git a/src/com/android/messaging/datamodel/data/BlockedParticipantsData.java b/src/com/android/messaging/datamodel/data/BlockedParticipantsData.java index 4e94ee1..fb6877f 100644 --- a/src/com/android/messaging/datamodel/data/BlockedParticipantsData.java +++ b/src/com/android/messaging/datamodel/data/BlockedParticipantsData.java @@ -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 { 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; diff --git a/src/com/android/messaging/datamodel/data/ConversationData.java b/src/com/android/messaging/datamodel/data/ConversationData.java index 2171bd1..740365f 100644 --- a/src/com/android/messaging/datamodel/data/ConversationData.java +++ b/src/com/android/messaging/datamodel/data/ConversationData.java @@ -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 { diff --git a/src/com/android/messaging/datamodel/data/ConversationListData.java b/src/com/android/messaging/datamodel/data/ConversationListData.java index 3d27ecd..41744be 100644 --- a/src/com/android/messaging/datamodel/data/ConversationListData.java +++ b/src/com/android/messaging/datamodel/data/ConversationListData.java @@ -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; diff --git a/src/com/android/messaging/datamodel/data/ConversationListItemData.java b/src/com/android/messaging/datamodel/data/ConversationListItemData.java index 46d4b64..4999282 100644 --- a/src/com/android/messaging/datamodel/data/ConversationListItemData.java +++ b/src/com/android/messaging/datamodel/data/ConversationListItemData.java @@ -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; } diff --git a/src/com/android/messaging/datamodel/data/ConversationMessageData.java b/src/com/android/messaging/datamodel/data/ConversationMessageData.java index 2a85277..c86f89e 100644 --- a/src/com/android/messaging/datamodel/data/ConversationMessageData.java +++ b/src/com/android/messaging/datamodel/data/ConversationMessageData.java @@ -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, diff --git a/src/com/android/messaging/datamodel/data/DraftMessageData.java b/src/com/android/messaging/datamodel/data/DraftMessageData.java index f63c27f..0126905 100644 --- a/src/com/android/messaging/datamodel/data/DraftMessageData.java +++ b/src/com/android/messaging/datamodel/data/DraftMessageData.java @@ -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 */ diff --git a/src/com/android/messaging/datamodel/data/MessageData.java b/src/com/android/messaging/datamodel/data/MessageData.java index b2cab48..9bed507 100644 --- a/src/com/android/messaging/datamodel/data/MessageData.java +++ b/src/com/android/messaging/datamodel/data/MessageData.java @@ -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); } diff --git a/src/com/android/messaging/datamodel/media/AvatarRequest.java b/src/com/android/messaging/datamodel/media/AvatarRequest.java index 9310321..d3915fe 100644 --- a/src/com/android/messaging/datamodel/media/AvatarRequest.java +++ b/src/com/android/messaging/datamodel/media/AvatarRequest.java @@ -45,7 +45,7 @@ import java.util.List; public class AvatarRequest extends UriImageRequest { private static final float SCALING_FACTOR = 1.33f; - private TypedArray mColors; + private final TypedArray mColors; public AvatarRequest(final Context context, final AvatarRequestDescriptor descriptor) { diff --git a/src/com/android/messaging/datamodel/media/CustomVCardEntryConstructor.java b/src/com/android/messaging/datamodel/media/CustomVCardEntryConstructor.java index 06b10a3..200e4d2 100644 --- a/src/com/android/messaging/datamodel/media/CustomVCardEntryConstructor.java +++ b/src/com/android/messaging/datamodel/media/CustomVCardEntryConstructor.java @@ -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 * */ - 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); } -} \ No newline at end of file +} diff --git a/src/com/android/messaging/datamodel/media/MediaRequest.java b/src/com/android/messaging/datamodel/media/MediaRequest.java index 78ae85e..f7e2aba 100644 --- a/src/com/android/messaging/datamodel/media/MediaRequest.java +++ b/src/com/android/messaging/datamodel/media/MediaRequest.java @@ -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 { - 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. diff --git a/src/com/android/messaging/mmslib/pdu/Base64.java b/src/com/android/messaging/mmslib/pdu/Base64.java index 2f27117..55b79b4 100644 --- a/src/com/android/messaging/mmslib/pdu/Base64.java +++ b/src/com/android/messaging/mmslib/pdu/Base64.java @@ -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 { diff --git a/src/com/android/messaging/mmslib/pdu/QuotedPrintable.java b/src/com/android/messaging/mmslib/pdu/QuotedPrintable.java index 1ce9dc1..c95dd3c 100644 --- a/src/com/android/messaging/mmslib/pdu/QuotedPrintable.java +++ b/src/com/android/messaging/mmslib/pdu/QuotedPrintable.java @@ -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; } diff --git a/src/com/android/messaging/mmslib/util/DrmConvertSession.java b/src/com/android/messaging/mmslib/util/DrmConvertSession.java index 604e391..7dda643 100644 --- a/src/com/android/messaging/mmslib/util/DrmConvertSession.java +++ b/src/com/android/messaging/mmslib/util/DrmConvertSession.java @@ -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) { diff --git a/src/com/android/messaging/mmslib/util/PduCache.java b/src/com/android/messaging/mmslib/util/PduCache.java index 939e4bd..59ade37 100644 --- a/src/com/android/messaging/mmslib/util/PduCache.java +++ b/src/com/android/messaging/mmslib/util/PduCache.java @@ -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 { mUpdating = new HashSet(); } - public static final synchronized PduCache getInstance() { + public static synchronized PduCache getInstance() { if (sInstance == null) { if (LOCAL_LOGV) { Log.v(TAG, "Constructing new PduCache instance."); diff --git a/src/com/android/messaging/sms/ApnsXmlProcessor.java b/src/com/android/messaging/sms/ApnsXmlProcessor.java index 976896c..3a8ffc3 100644 --- a/src/com/android/messaging/sms/ApnsXmlProcessor.java +++ b/src/com/android/messaging/sms/ApnsXmlProcessor.java @@ -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; diff --git a/src/com/android/messaging/sms/BugleUserAgentInfoLoader.java b/src/com/android/messaging/sms/BugleUserAgentInfoLoader.java index cce12b0..6d37f87 100644 --- a/src/com/android/messaging/sms/BugleUserAgentInfoLoader.java +++ b/src/com/android/messaging/sms/BugleUserAgentInfoLoader.java @@ -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; diff --git a/src/com/android/messaging/sms/MmsUtils.java b/src/com/android/messaging/sms/MmsUtils.java index 76e6f37..ae7aad2 100644 --- a/src/com/android/messaging/sms/MmsUtils.java +++ b/src/com/android/messaging/sms/MmsUtils.java @@ -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; diff --git a/src/com/android/messaging/sms/SmsSender.java b/src/com/android/messaging/sms/SmsSender.java index bd3add7..267cecd 100644 --- a/src/com/android/messaging/sms/SmsSender.java +++ b/src/com/android/messaging/sms/SmsSender.java @@ -60,7 +60,7 @@ public class SmsSender { /* * A map for pending sms messages. The key is the random request UUID. */ - private static ConcurrentHashMap sPendingMessageMap = + private static final ConcurrentHashMap sPendingMessageMap = new ConcurrentHashMap(); private static final Random RANDOM = new Random(); diff --git a/src/com/android/messaging/ui/AsyncImageView.java b/src/com/android/messaging/ui/AsyncImageView.java index 0d3fd16..cb6ab2e 100644 --- a/src/com/android/messaging/ui/AsyncImageView.java +++ b/src/com/android/messaging/ui/AsyncImageView.java @@ -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> 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} */ diff --git a/src/com/android/messaging/ui/AttachmentPreview.java b/src/com/android/messaging/ui/AttachmentPreview.java index f4465c4..acac58c 100644 --- a/src/com/android/messaging/ui/AttachmentPreview.java +++ b/src/com/android/messaging/ui/AttachmentPreview.java @@ -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; diff --git a/src/com/android/messaging/ui/CompositeAdapter.java b/src/com/android/messaging/ui/CompositeAdapter.java index 620e511..7f21313 100644 --- a/src/com/android/messaging/ui/CompositeAdapter.java +++ b/src/com/android/messaging/ui/CompositeAdapter.java @@ -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) { diff --git a/src/com/android/messaging/ui/CustomHeaderViewPager.java b/src/com/android/messaging/ui/CustomHeaderViewPager.java index 31505c8..064518c 100644 --- a/src/com/android/messaging/ui/CustomHeaderViewPager.java +++ b/src/com/android/messaging/ui/CustomHeaderViewPager.java @@ -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); diff --git a/src/com/android/messaging/ui/SnackBar.java b/src/com/android/messaging/ui/SnackBar.java index 2f85461..1f50609 100644 --- a/src/com/android/messaging/ui/SnackBar.java +++ b/src/com/android/messaging/ui/SnackBar.java @@ -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); diff --git a/src/com/android/messaging/ui/SnackBarInteraction.java b/src/com/android/messaging/ui/SnackBarInteraction.java index f723caa..1a6bcb6 100644 --- a/src/com/android/messaging/ui/SnackBarInteraction.java +++ b/src/com/android/messaging/ui/SnackBarInteraction.java @@ -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); } } -} \ No newline at end of file +} diff --git a/src/com/android/messaging/ui/ViewPagerTabStrip.java b/src/com/android/messaging/ui/ViewPagerTabStrip.java index c6ef539..52cc2d5 100644 --- a/src/com/android/messaging/ui/ViewPagerTabStrip.java +++ b/src/com/android/messaging/ui/ViewPagerTabStrip.java @@ -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; diff --git a/src/com/android/messaging/ui/ViewPagerTabs.java b/src/com/android/messaging/ui/ViewPagerTabs.java index 4af165a..51e525c 100644 --- a/src/com/android/messaging/ui/ViewPagerTabs.java +++ b/src/com/android/messaging/ui/ViewPagerTabs.java @@ -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; diff --git a/src/com/android/messaging/ui/appsettings/ApnSettingsActivity.java b/src/com/android/messaging/ui/appsettings/ApnSettingsActivity.java index 3ffa21c..af60dbf 100644 --- a/src/com/android/messaging/ui/appsettings/ApnSettingsActivity.java +++ b/src/com/android/messaging/ui/appsettings/ApnSettingsActivity.java @@ -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); diff --git a/src/com/android/messaging/ui/attachmentchooser/AttachmentChooserFragment.java b/src/com/android/messaging/ui/attachmentchooser/AttachmentChooserFragment.java index 75ea56d..c4f4f42 100644 --- a/src/com/android/messaging/ui/attachmentchooser/AttachmentChooserFragment.java +++ b/src/com/android/messaging/ui/attachmentchooser/AttachmentChooserFragment.java @@ -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 mBinding = BindingBase.createBinding(this); + final Binding mBinding = BindingBase.createBinding(this); @Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, diff --git a/src/com/android/messaging/ui/conversation/ConversationInput.java b/src/com/android/messaging/ui/conversation/ConversationInput.java index cf98dbe..4baaaee 100644 --- a/src/com/android/messaging/ui/conversation/ConversationInput.java +++ b/src/com/android/messaging/ui/conversation/ConversationInput.java @@ -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); diff --git a/src/com/android/messaging/ui/conversationlist/ConversationListFragment.java b/src/com/android/messaging/ui/conversationlist/ConversationListFragment.java index 269efcb..fd4fa8c 100644 --- a/src/com/android/messaging/ui/conversationlist/ConversationListFragment.java +++ b/src/com/android/messaging/ui/conversationlist/ConversationListFragment.java @@ -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; diff --git a/src/com/android/messaging/ui/conversationlist/ShareIntentFragment.java b/src/com/android/messaging/ui/conversationlist/ShareIntentFragment.java index beafb53..e5d3c19 100644 --- a/src/com/android/messaging/ui/conversationlist/ShareIntentFragment.java +++ b/src/com/android/messaging/ui/conversationlist/ShareIntentFragment.java @@ -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 mListBinding = BindingBase.createBinding(this); diff --git a/src/com/android/messaging/ui/mediapicker/CameraManager.java b/src/com/android/messaging/ui/mediapicker/CameraManager.java index fb5c9bf..c3ba751 100644 --- a/src/com/android/messaging/ui/mediapicker/CameraManager.java +++ b/src/com/android/messaging/ui/mediapicker/CameraManager.java @@ -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); diff --git a/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java b/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java index a90827f..b0e0b2a 100644 --- a/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java +++ b/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java @@ -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; diff --git a/src/com/android/messaging/ui/mediapicker/GalleryMediaChooser.java b/src/com/android/messaging/ui/mediapicker/GalleryMediaChooser.java index 6192c4f..9e9ffb1 100644 --- a/src/com/android/messaging/ui/mediapicker/GalleryMediaChooser.java +++ b/src/com/android/messaging/ui/mediapicker/GalleryMediaChooser.java @@ -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); diff --git a/src/com/android/messaging/ui/mediapicker/HardwareCameraPreview.java b/src/com/android/messaging/ui/mediapicker/HardwareCameraPreview.java index 45d9579..6e3a901 100644 --- a/src/com/android/messaging/ui/mediapicker/HardwareCameraPreview.java +++ b/src/com/android/messaging/ui/mediapicker/HardwareCameraPreview.java @@ -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); diff --git a/src/com/android/messaging/ui/mediapicker/camerafocus/FocusIndicator.java b/src/com/android/messaging/ui/mediapicker/camerafocus/FocusIndicator.java index 92ed3c1..50f0926 100644 --- a/src/com/android/messaging/ui/mediapicker/camerafocus/FocusIndicator.java +++ b/src/com/android/messaging/ui/mediapicker/camerafocus/FocusIndicator.java @@ -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(); -} \ No newline at end of file + void showStart(); + void showSuccess(boolean timeout); + void showFail(boolean timeout); + void clear(); +} diff --git a/src/com/android/messaging/ui/mediapicker/camerafocus/FocusOverlayManager.java b/src/com/android/messaging/ui/mediapicker/camerafocus/FocusOverlayManager.java index e620fc2..488dd04 100644 --- a/src/com/android/messaging/ui/mediapicker/camerafocus/FocusOverlayManager.java +++ b/src/com/android/messaging/ui/mediapicker/camerafocus/FocusOverlayManager.java @@ -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 { diff --git a/src/com/android/messaging/ui/mediapicker/camerafocus/PieItem.java b/src/com/android/messaging/ui/mediapicker/camerafocus/PieItem.java index c602852..ef8d28c 100644 --- a/src/com/android/messaging/ui/mediapicker/camerafocus/PieItem.java +++ b/src/com/android/messaging/ui/mediapicker/camerafocus/PieItem.java @@ -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); } -} \ No newline at end of file +} diff --git a/src/com/android/messaging/ui/mediapicker/camerafocus/PieRenderer.java b/src/com/android/messaging/ui/mediapicker/camerafocus/PieRenderer.java index ce8ca00..f5db115 100644 --- a/src/com/android/messaging/ui/mediapicker/camerafocus/PieRenderer.java +++ b/src/com/android/messaging/ui/mediapicker/camerafocus/PieRenderer.java @@ -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 } } -} \ No newline at end of file +} diff --git a/src/com/android/messaging/ui/mediapicker/camerafocus/RenderOverlay.java b/src/com/android/messaging/ui/mediapicker/camerafocus/RenderOverlay.java index 95cddc4..e08eaf2 100644 --- a/src/com/android/messaging/ui/mediapicker/camerafocus/RenderOverlay.java +++ b/src/com/android/messaging/ui/mediapicker/camerafocus/RenderOverlay.java @@ -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 mClients; + private final RenderView mRenderView; + private final List mClients; // reverse list of touch clients - private List mTouchClients; - private int[] mPosition = new int[2]; + private final List 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 { } } -} \ No newline at end of file +} diff --git a/src/com/android/messaging/util/Assert.java b/src/com/android/messaging/util/Assert.java index 437965c..9440771 100644 --- a/src/com/android/messaging/util/Assert.java +++ b/src/com/android/messaging/util/Assert.java @@ -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"; diff --git a/src/com/android/messaging/util/CircularArray.java b/src/com/android/messaging/util/CircularArray.java index db6cf12..7488a44 100644 --- a/src/com/android/messaging/util/CircularArray.java +++ b/src/com/android/messaging/util/CircularArray.java @@ -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 { private int mNextWriter; private boolean mHasWrapped; - private int mMaxCount; + private final int mMaxCount; Object mList[]; /** diff --git a/src/com/android/messaging/util/ConnectivityUtil.java b/src/com/android/messaging/util/ConnectivityUtil.java index 68e5b46..6516512 100644 --- a/src/com/android/messaging/util/ConnectivityUtil.java +++ b/src/com/android/messaging/util/ConnectivityUtil.java @@ -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) { diff --git a/src/com/android/messaging/util/ContentType.java b/src/com/android/messaging/util/ContentType.java index e4d9105..47e4190 100644 --- a/src/com/android/messaging/util/ContentType.java +++ b/src/com/android/messaging/util/ContentType.java @@ -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; diff --git a/src/com/android/messaging/util/DebugUtils.java b/src/com/android/messaging/util/DebugUtils.java index cab156c..aa516bd 100644 --- a/src/com/android/messaging/util/DebugUtils.java +++ b/src/com/android/messaging/util/DebugUtils.java @@ -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; } diff --git a/src/com/android/messaging/util/GifTranscoder.java b/src/com/android/messaging/util/GifTranscoder.java index 65413a0..bc9a1f0 100644 --- a/src/com/android/messaging/util/GifTranscoder.java +++ b/src/com/android/messaging/util/GifTranscoder.java @@ -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"); diff --git a/src/com/android/messaging/util/MediaUtil.java b/src/com/android/messaging/util/MediaUtil.java index f25354c..ae929ce 100644 --- a/src/com/android/messaging/util/MediaUtil.java +++ b/src/com/android/messaging/util/MediaUtil.java @@ -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() { diff --git a/src/com/android/messaging/util/NotificationPlayer.java b/src/com/android/messaging/util/NotificationPlayer.java index a4ed44e..251b9ff 100644 --- a/src/com/android/messaging/util/NotificationPlayer.java +++ b/src/com/android/messaging/util/NotificationPlayer.java @@ -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(); diff --git a/src/com/android/messaging/util/OsUtil.java b/src/com/android/messaging/util/OsUtil.java index c84fa0c..b0adabe 100644 --- a/src/com/android/messaging/util/OsUtil.java +++ b/src/com/android/messaging/util/OsUtil.java @@ -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 sPermissions = new Hashtable(); + private static final Hashtable sPermissions = new Hashtable(); /** * 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. diff --git a/src/com/android/messaging/util/SafeAsyncTask.java b/src/com/android/messaging/util/SafeAsyncTask.java index 1cce6e9..2344515 100644 --- a/src/com/android/messaging/util/SafeAsyncTask.java +++ b/src/com/android/messaging/util/SafeAsyncTask.java @@ -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 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; diff --git a/src/com/android/messaging/util/exif/ExifInterface.java b/src/com/android/messaging/util/exif/ExifInterface.java index b556748..80ad554 100644 --- a/src/com/android/messaging/util/exif/ExifInterface.java +++ b/src/com/android/messaging/util/exif/ExifInterface.java @@ -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 sOffsetTags = new HashSet(); + private static final HashSet sOffsetTags = new HashSet(); 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 sBannedDefines = new HashSet(sOffsetTags); + protected static final HashSet sBannedDefines = new HashSet(sOffsetTags); static { sBannedDefines.add(getTrueTagKey(TAG_NULL)); sBannedDefines.add(getTrueTagKey(TAG_JPEG_INTERCHANGE_FORMAT_LENGTH)); @@ -377,84 +378,84 @@ public class ExifInterface { *
  • RIGHT_BOTTOM is a 270 degree clockwise rotation.
  • * */ - 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"; diff --git a/src/com/android/messaging/util/exif/ExifParser.java b/src/com/android/messaging/util/exif/ExifParser.java index 46f253e..8b9dc86 100644 --- a/src/com/android/messaging/util/exif/ExifParser.java +++ b/src/com/android/messaging/util/exif/ExifParser.java @@ -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; diff --git a/src/com/android/messaging/util/exif/ExifTag.java b/src/com/android/messaging/util/exif/ExifTag.java index da6f4ed..cff3547 100644 --- a/src/com/android/messaging/util/exif/ExifTag.java +++ b/src/com/android/messaging/util/exif/ExifTag.java @@ -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; diff --git a/src/com/android/messaging/util/exif/IfdId.java b/src/com/android/messaging/util/exif/IfdId.java index 06a820d..1c6fe3d 100644 --- a/src/com/android/messaging/util/exif/IfdId.java +++ b/src/com/android/messaging/util/exif/IfdId.java @@ -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; } diff --git a/src/com/android/messaging/util/exif/JpegHeader.java b/src/com/android/messaging/util/exif/JpegHeader.java index 1dd12a5..7d776fc 100644 --- a/src/com/android/messaging/util/exif/JpegHeader.java +++ b/src/com/android/messaging/util/exif/JpegHeader.java @@ -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; } diff --git a/src/com/android/messaging/widget/WidgetConversationService.java b/src/com/android/messaging/widget/WidgetConversationService.java index fa7d3ef..243d11e 100644 --- a/src/com/android/messaging/widget/WidgetConversationService.java +++ b/src/com/android/messaging/widget/WidgetConversationService.java @@ -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);