Messaging: Further code improvements

* Remove redundant casts
* getParcelable(ArrayList|Exra) without class argument is deprecated
* ViewPager.setOnPageChangeListener -> addOnPageChangeListener
* RecyclerView.setOnScrollListener -> addOnScrollListener
* Remove unused initializations
* Remove unused code

Change-Id: I21beb6c90c675a4f2cfd7e3d5ebbd18b745f5911
This commit is contained in:
Michael W
2025-03-04 18:52:05 +01:00
parent 47f5533a73
commit b2f5e3190e
110 changed files with 289 additions and 561 deletions
@@ -466,7 +466,7 @@ public class BugleApnSettingsLoader implements ApnSettingsLoader {
LogUtil.i(LogUtil.BUGLE_TAG, "Loading APNs from local APN table");
final SQLiteDatabase database = ApnDatabase.getApnDatabase().getWritableDatabase();
final String mccMnc = PhoneUtils.getMccMncString(PhoneUtils.getDefault().getMccMnc());
Cursor cursor = null;
Cursor cursor;
cursor = queryLocalDatabase(database, mccMnc, apnName);
if (cursor == null) {
cursor = queryLocalDatabase(database, mccMnc, null/*apnName*/);
@@ -513,7 +513,7 @@ public class BugleApnSettingsLoader implements ApnSettingsLoader {
selection = SELECTION_NUMERIC + " AND " + SELECTION_APN;
selectionArgs = new String[] { numeric, apnName };
}
Cursor cursor = null;
Cursor cursor;
try {
cursor = db.query(ApnDatabase.APN_TABLE, APN_PROJECTION_LOCAL, selection, selectionArgs,
null/*groupBy*/, null/*having*/, ORDER_BY, null/*limit*/);
@@ -476,7 +476,7 @@ public class DatabaseMessages {
mParts = new ArrayList<>();
mPartsProcessed = false;
for (int i = 0; i < nParts; i++) {
mParts.add((MmsPart) in.readParcelable(getClass().getClassLoader()));
mParts.add(in.readParcelable(getClass().getClassLoader()));
}
}
+1 -1
View File
@@ -1544,7 +1544,7 @@ public class MmsUtils {
public static int bugleStatusForMms(final boolean isOutgoing, final boolean isNotification,
final int messageBox) {
int bugleStatus = MessageData.BUGLE_STATUS_UNKNOWN;
int bugleStatus;
// For a message we sync either
if (isOutgoing) {
if (messageBox == Mms.MESSAGE_BOX_OUTBOX || messageBox == Mms.MESSAGE_BOX_FAILED) {