Merge "Hardcode the className instead of class.getSimpleName()." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
798340dc6d
@@ -47,7 +47,7 @@ public class DevicePaddings {
|
||||
private static final String WORKSPACE_BOTTOM_PADDING = "workspaceBottomPadding";
|
||||
private static final String HOTSEAT_BOTTOM_PADDING = "hotseatBottomPadding";
|
||||
|
||||
private static final String TAG = DevicePaddings.class.getSimpleName();
|
||||
private static final String TAG = "DevicePaddings";
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
ArrayList<DevicePadding> mDevicePaddings = new ArrayList<>();
|
||||
|
||||
@@ -788,7 +788,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
if (mScroller.isFinished() && pageScrollChanged) {
|
||||
// TODO(b/246283207): Remove logging once root cause of flake detected.
|
||||
if (Utilities.isRunningInTestHarness() && !(this instanceof Workspace)) {
|
||||
Log.d("b/246283207", this.getClass().getSimpleName() + "#onLayout() -> "
|
||||
Log.d("b/246283207", TAG + "#onLayout() -> "
|
||||
+ "if(mScroller.isFinished() && pageScrollChanged) -> getNextPage(): "
|
||||
+ getNextPage() + ", getScrollForPage(getNextPage()): "
|
||||
+ getScrollForPage(getNextPage()));
|
||||
|
||||
@@ -73,6 +73,7 @@ import java.util.Optional;
|
||||
* Represents an item in the launcher.
|
||||
*/
|
||||
public class ItemInfo {
|
||||
private static final String TAG = "ItemInfo";
|
||||
|
||||
public static final boolean DEBUG = false;
|
||||
public static final int NO_ID = -1;
|
||||
@@ -285,7 +286,7 @@ public class ItemInfo {
|
||||
@Override
|
||||
@NonNull
|
||||
public final String toString() {
|
||||
return getClass().getSimpleName() + "(" + dumpProperties() + ")";
|
||||
return TAG + "(" + dumpProperties() + ")";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.os.UserHandle;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public final class PackageInstallInfo {
|
||||
private static final String TAG = "PackageInstallInfo";
|
||||
|
||||
public static final int STATUS_INSTALLED = 0;
|
||||
public static final int STATUS_INSTALLING = 1;
|
||||
@@ -61,7 +62,7 @@ public final class PackageInstallInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + "(" + dumpProperties() + ")";
|
||||
return TAG + "(" + dumpProperties() + ")";
|
||||
}
|
||||
|
||||
private String dumpProperties() {
|
||||
|
||||
@@ -135,7 +135,7 @@ data class HotseatSpec(
|
||||
hotseatQsbSpace.fixedSize + edgePadding.fixedSize <= maxAvailableSize
|
||||
|
||||
private fun logError(message: String) {
|
||||
Log.e(LOG_TAG, "${this::class.simpleName}#isValid - $message - $this")
|
||||
Log.e(LOG_TAG, "$LOG_TAG #isValid - $message - $this")
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -31,7 +31,7 @@ class ResponsiveCellSpecsProvider(groupOfSpecs: List<ResponsiveSpecGroup<CellSpe
|
||||
groupOfSpecs
|
||||
.onEach { group ->
|
||||
check(group.widthSpecs.isEmpty() && group.heightSpecs.isNotEmpty()) {
|
||||
"${this::class.simpleName} is invalid, only heightSpecs are allowed - " +
|
||||
"$LOG_TAG is invalid, only heightSpecs are allowed - " +
|
||||
"width list size = ${group.widthSpecs.size}; " +
|
||||
"height list size = ${group.heightSpecs.size}."
|
||||
}
|
||||
@@ -65,6 +65,7 @@ class ResponsiveCellSpecsProvider(groupOfSpecs: List<ResponsiveSpecGroup<CellSpe
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val LOG_TAG = "ResponsiveCellSpecsProvider"
|
||||
@JvmStatic
|
||||
fun create(resourceHelper: ResourceHelper): ResponsiveCellSpecsProvider {
|
||||
val parser = ResponsiveSpecsParser(resourceHelper)
|
||||
@@ -137,11 +138,11 @@ data class CellSpec(
|
||||
}
|
||||
|
||||
private fun logError(message: String) {
|
||||
Log.e(LOG_TAG, "${this::class.simpleName}#isValid - $message - $this")
|
||||
Log.e(LOG_TAG, "$LOG_TAG#isValid - $message - $this")
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val LOG_TAG = "CellSpec"
|
||||
const val LOG_TAG = "CellSpec"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,6 +183,7 @@ data class CalculatedCellSpec(
|
||||
)
|
||||
|
||||
companion object {
|
||||
private const val LOG_TAG = "CalculatedCellSpec"
|
||||
private fun getCalculatedValue(
|
||||
availableSpace: Int,
|
||||
spec: SizeSpec,
|
||||
@@ -191,10 +193,10 @@ data class CalculatedCellSpec(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "${this::class.simpleName}(" +
|
||||
return "$LOG_TAG(" +
|
||||
"availableSpace=$availableSpace, iconSize=$iconSize, " +
|
||||
"iconTextSize=$iconTextSize, iconDrawablePadding=$iconDrawablePadding, " +
|
||||
"${spec::class.simpleName}.maxAvailableSize=${spec.maxAvailableSize}" +
|
||||
"${CellSpec.LOG_TAG}.maxAvailableSize=${spec.maxAvailableSize}" +
|
||||
")"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ data class ResponsiveSpec(
|
||||
}
|
||||
|
||||
private fun logError(message: String) {
|
||||
Log.e(LOG_TAG, "${this::class.simpleName}#isValid - $message - $this")
|
||||
Log.e(LOG_TAG, "$LOG_TAG#isValid - $message - $this")
|
||||
}
|
||||
|
||||
enum class DimensionType {
|
||||
|
||||
@@ -40,7 +40,7 @@ class ResponsiveSpecsProvider(
|
||||
groupOfSpecs
|
||||
.onEach { group ->
|
||||
check(group.widthSpecs.isNotEmpty() && group.heightSpecs.isNotEmpty()) {
|
||||
"${this::class.simpleName} is incomplete - " +
|
||||
"$LOG_TAG is incomplete - " +
|
||||
"width list size = ${group.widthSpecs.size}; " +
|
||||
"height list size = ${group.heightSpecs.size}."
|
||||
}
|
||||
@@ -124,6 +124,7 @@ class ResponsiveSpecsProvider(
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val LOG_TAG = "ResponsiveSpecsProvider"
|
||||
@JvmStatic
|
||||
fun create(
|
||||
resourceHelper: ResourceHelper,
|
||||
|
||||
@@ -84,7 +84,7 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
public class ItemClickHandler {
|
||||
|
||||
private static final String TAG = ItemClickHandler.class.getSimpleName();
|
||||
private static final String TAG = "ItemClickHandler";
|
||||
|
||||
/**
|
||||
* Instance used for click handling on items
|
||||
|
||||
@@ -54,7 +54,7 @@ import com.android.launcher3.graphics.TriangleShape;
|
||||
*/
|
||||
public class ArrowTipView extends AbstractFloatingView {
|
||||
|
||||
private static final String TAG = ArrowTipView.class.getSimpleName();
|
||||
private static final String TAG = "ArrowTipView";
|
||||
private static final long AUTO_CLOSE_TIMEOUT_MILLIS = 10 * 1000;
|
||||
private static final long SHOW_DELAY_MS = 200;
|
||||
private static final long SHOW_DURATION_MS = 300;
|
||||
|
||||
@@ -68,7 +68,7 @@ import java.util.function.Supplier;
|
||||
public class FloatingIconView extends FrameLayout implements
|
||||
Animator.AnimatorListener, OnGlobalLayoutListener, FloatingView {
|
||||
|
||||
private static final String TAG = FloatingIconView.class.getSimpleName();
|
||||
private static final String TAG = "FloatingIconView";
|
||||
|
||||
// Manages loading the icon on a worker thread
|
||||
private static @Nullable IconLoadResult sIconLoadResult;
|
||||
|
||||
Reference in New Issue
Block a user