Messaging: Remove unnecessary toString() and String.valueOf() calls

Change-Id: I5d5624386ba72b9e7074a7da909f78baaee73f75
This commit is contained in:
Michael W
2024-12-26 14:55:12 +01:00
parent 21cb2b6289
commit e35d385149
18 changed files with 40 additions and 34 deletions
+1 -1
View File
@@ -208,7 +208,7 @@ public final class Assert {
if (caller != null) {
// This log message can be de-obfuscated by the Proguard retrace tool, just like a
// full stack trace from a crash.
LogUtil.e(LogUtil.BUGLE_TAG, "\tat " + caller.toString());
LogUtil.e(LogUtil.BUGLE_TAG, "\tat " + caller);
}
}
}
@@ -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 class BugleSubscriptionPrefs extends BuglePrefsImpl {
@Override
public String getSharedPreferencesName() {
return SHARED_PREFERENCES_PER_SUBSCRIPTION_PREFIX + String.valueOf(mSubId);
return SHARED_PREFERENCES_PER_SUBSCRIPTION_PREFIX + mSubId;
}
@Override
@@ -250,7 +250,7 @@ public class DebugUtils {
public static void dumpSms(final long id, final android.telephony.SmsMessage[] messages,
final String format) {
try {
final String dumpFileName = MmsUtils.SMS_DUMP_PREFIX + Long.toString(id);
final String dumpFileName = MmsUtils.SMS_DUMP_PREFIX + id;
final File dumpFile = DebugUtils.getDebugFile(dumpFileName, true);
if (dumpFile != null) {
final FileOutputStream fos = new FileOutputStream(dumpFile);
@@ -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.
@@ -291,7 +292,7 @@ class ExifOutputStream extends FilterOutputStream {
dataOutputStream.writeShort(tag.getDataType());
dataOutputStream.writeInt(tag.getComponentCount());
if (DEBUG) {
Log.v(TAG, "\n" + tag.toString());
Log.v(TAG, "\n" + tag);
}
if (tag.getDataSize() > 4) {
dataOutputStream.writeInt(tag.getOffset());
@@ -659,22 +659,22 @@ public class ExifParser {
Object event = mCorrespondingEvent.firstEntry().getValue();
if (event instanceof ImageEvent) {
// Tag value overlaps thumbnail, ignore thumbnail.
Log.w(TAG, "Thumbnail overlaps value for tag: \n" + tag.toString());
Log.w(TAG, "Thumbnail overlaps value for tag: \n" + tag);
Entry<Integer, Object> entry = mCorrespondingEvent.pollFirstEntry();
Log.w(TAG, "Invalid thumbnail offset: " + entry.getKey());
} else {
// Tag value overlaps another tag, shorten count
if (event instanceof IfdEvent) {
Log.w(TAG, "Ifd " + ((IfdEvent) event).ifd
+ " overlaps value for tag: \n" + tag.toString());
+ " overlaps value for tag: \n" + tag);
} else if (event instanceof ExifTagEvent) {
Log.w(TAG, "Tag value for tag: \n"
+ ((ExifTagEvent) event).tag.toString()
+ " overlaps value for tag: \n" + tag.toString());
+ " overlaps value for tag: \n" + tag);
}
size = mCorrespondingEvent.firstEntry().getKey()
- mTiffStream.getReadByteCount();
Log.w(TAG, "Invalid size of tag: \n" + tag.toString()
Log.w(TAG, "Invalid size of tag: \n" + tag
+ " setting count to: " + size);
tag.forceSetComponentCount(size);
}
@@ -734,7 +734,7 @@ public class ExifParser {
break;
}
if (LOGV) {
Log.v(TAG, "\n" + tag.toString());
Log.v(TAG, "\n" + tag);
}
}