Loading packages/SystemUI/plugin/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ java_library { static_libs: [ "androidx.annotation_annotation", "androidx-constraintlayout_constraintlayout", "com.android.systemui.log.table-api", "PlatformAnimationLib", "PluginCoreLib", "SystemUICommon", Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/log/TableLogBufferBase.kt +3 −48 Original line number Diff line number Diff line Loading @@ -14,9 +14,6 @@ package com.android.systemui.plugins.log import com.android.systemui.log.table.Diffable import com.android.systemui.log.table.TableRowLogger /** * Base interface for a logger that logs changes in table format. * Loading @@ -32,11 +29,7 @@ interface TableLogBufferBase { logChange(prefix, columnName, value, isInitial = false) } /** * Logs a String? change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ /** Logs a String? change. */ fun logChange(prefix: String = "", columnName: String, value: String?, isInitial: Boolean) /** Loading @@ -48,11 +41,7 @@ interface TableLogBufferBase { logChange(prefix, columnName, value, isInitial = false) } /** * Logs a Boolean change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ /** Logs a Boolean change. */ fun logChange(prefix: String = "", columnName: String, value: Boolean, isInitial: Boolean) /** Loading @@ -64,40 +53,6 @@ interface TableLogBufferBase { logChange(prefix, columnName, value, isInitial = false) } /** * Logs an Int? change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ /** Logs an Int? change. */ fun logChange(prefix: String = "", columnName: String, value: Int?, isInitial: Boolean) /** * Log the differences between [prevVal] and [newVal]. * * The [newVal] object's method [Diffable.logDiffs] will be used to fetch the diffs. * * @param columnPrefix a prefix that will be applied to every column name that gets logged. This * ensures that all the columns related to the same state object will be grouped together in * the table. * @throws IllegalArgumentException if [columnPrefix] or column name contain "|". "|" is used as * the separator token for parsing, so it can't be present in any part of the column name. */ fun <T : Diffable<T>> logDiffs(columnPrefix: String = "", prevVal: T, newVal: T) /** * Logs change(s) to the buffer using [rowInitializer]. * * @param columnPrefix see [logDiffs]. * @param rowInitializer a function that will be called immediately to store relevant data on * the row. * @param isInitial true if this change represents the starting value for a particular column * (as opposed to a value that was updated after receiving new information). This is used to * help us identify which values were just default starting values, and which values were * derived from updated information. Most callers should use false for this value. */ fun logChange( columnPrefix: String = "", isInitial: Boolean = false, rowInitializer: (TableRowLogger) -> Unit, ) } packages/SystemUI/src/com/android/systemui/log/table/TableLogBuffer.kt +41 −4 Original line number Diff line number Diff line Loading @@ -112,8 +112,19 @@ class TableLogBuffer( tableLogBuffer = this, ) /** * Log the differences between [prevVal] and [newVal]. * * The [newVal] object's method [Diffable.logDiffs] will be used to fetch the diffs. * * @param columnPrefix a prefix that will be applied to every column name that gets logged. This * ensures that all the columns related to the same state object will be grouped together in * the table. * @throws IllegalArgumentException if [columnPrefix] or column name contain "|". "|" is used as * the separator token for parsing, so it can't be present in any part of the column name. */ @Synchronized override fun <T : Diffable<T>> logDiffs(columnPrefix: String, prevVal: T, newVal: T) { fun <T : Diffable<T>> logDiffs(columnPrefix: String = "", prevVal: T, newVal: T) { val row = tempRow row.timestamp = systemClock.currentTimeMillis() row.columnPrefix = columnPrefix Loading @@ -122,10 +133,21 @@ class TableLogBuffer( newVal.logDiffs(prevVal, row) } /** * Logs change(s) to the buffer using [rowInitializer]. * * @param columnPrefix see [logDiffs]. * @param rowInitializer a function that will be called immediately to store relevant data on * the row. * @param isInitial true if this change represents the starting value for a particular column * (as opposed to a value that was updated after receiving new information). This is used to * help us identify which values were just default starting values, and which values were * derived from updated information. Most callers should use false for this value. */ @Synchronized override fun logChange( columnPrefix: String, isInitial: Boolean, fun logChange( columnPrefix: String = "", isInitial: Boolean = false, rowInitializer: (TableRowLogger) -> Unit, ) { val row = tempRow Loading @@ -135,14 +157,29 @@ class TableLogBuffer( rowInitializer(row) } /** * Logs a String? change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ override fun logChange(prefix: String, columnName: String, value: String?, isInitial: Boolean) { logChange(systemClock.currentTimeMillis(), prefix, columnName, value, isInitial) } /** * Logs a boolean change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ override fun logChange(prefix: String, columnName: String, value: Boolean, isInitial: Boolean) { logChange(systemClock.currentTimeMillis(), prefix, columnName, value, isInitial) } /** * Logs a Int change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ override fun logChange(prefix: String, columnName: String, value: Int?, isInitial: Boolean) { logChange(systemClock.currentTimeMillis(), prefix, columnName, value, isInitial) } Loading Loading
packages/SystemUI/plugin/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ java_library { static_libs: [ "androidx.annotation_annotation", "androidx-constraintlayout_constraintlayout", "com.android.systemui.log.table-api", "PlatformAnimationLib", "PluginCoreLib", "SystemUICommon", Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/log/TableLogBufferBase.kt +3 −48 Original line number Diff line number Diff line Loading @@ -14,9 +14,6 @@ package com.android.systemui.plugins.log import com.android.systemui.log.table.Diffable import com.android.systemui.log.table.TableRowLogger /** * Base interface for a logger that logs changes in table format. * Loading @@ -32,11 +29,7 @@ interface TableLogBufferBase { logChange(prefix, columnName, value, isInitial = false) } /** * Logs a String? change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ /** Logs a String? change. */ fun logChange(prefix: String = "", columnName: String, value: String?, isInitial: Boolean) /** Loading @@ -48,11 +41,7 @@ interface TableLogBufferBase { logChange(prefix, columnName, value, isInitial = false) } /** * Logs a Boolean change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ /** Logs a Boolean change. */ fun logChange(prefix: String = "", columnName: String, value: Boolean, isInitial: Boolean) /** Loading @@ -64,40 +53,6 @@ interface TableLogBufferBase { logChange(prefix, columnName, value, isInitial = false) } /** * Logs an Int? change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ /** Logs an Int? change. */ fun logChange(prefix: String = "", columnName: String, value: Int?, isInitial: Boolean) /** * Log the differences between [prevVal] and [newVal]. * * The [newVal] object's method [Diffable.logDiffs] will be used to fetch the diffs. * * @param columnPrefix a prefix that will be applied to every column name that gets logged. This * ensures that all the columns related to the same state object will be grouped together in * the table. * @throws IllegalArgumentException if [columnPrefix] or column name contain "|". "|" is used as * the separator token for parsing, so it can't be present in any part of the column name. */ fun <T : Diffable<T>> logDiffs(columnPrefix: String = "", prevVal: T, newVal: T) /** * Logs change(s) to the buffer using [rowInitializer]. * * @param columnPrefix see [logDiffs]. * @param rowInitializer a function that will be called immediately to store relevant data on * the row. * @param isInitial true if this change represents the starting value for a particular column * (as opposed to a value that was updated after receiving new information). This is used to * help us identify which values were just default starting values, and which values were * derived from updated information. Most callers should use false for this value. */ fun logChange( columnPrefix: String = "", isInitial: Boolean = false, rowInitializer: (TableRowLogger) -> Unit, ) }
packages/SystemUI/src/com/android/systemui/log/table/TableLogBuffer.kt +41 −4 Original line number Diff line number Diff line Loading @@ -112,8 +112,19 @@ class TableLogBuffer( tableLogBuffer = this, ) /** * Log the differences between [prevVal] and [newVal]. * * The [newVal] object's method [Diffable.logDiffs] will be used to fetch the diffs. * * @param columnPrefix a prefix that will be applied to every column name that gets logged. This * ensures that all the columns related to the same state object will be grouped together in * the table. * @throws IllegalArgumentException if [columnPrefix] or column name contain "|". "|" is used as * the separator token for parsing, so it can't be present in any part of the column name. */ @Synchronized override fun <T : Diffable<T>> logDiffs(columnPrefix: String, prevVal: T, newVal: T) { fun <T : Diffable<T>> logDiffs(columnPrefix: String = "", prevVal: T, newVal: T) { val row = tempRow row.timestamp = systemClock.currentTimeMillis() row.columnPrefix = columnPrefix Loading @@ -122,10 +133,21 @@ class TableLogBuffer( newVal.logDiffs(prevVal, row) } /** * Logs change(s) to the buffer using [rowInitializer]. * * @param columnPrefix see [logDiffs]. * @param rowInitializer a function that will be called immediately to store relevant data on * the row. * @param isInitial true if this change represents the starting value for a particular column * (as opposed to a value that was updated after receiving new information). This is used to * help us identify which values were just default starting values, and which values were * derived from updated information. Most callers should use false for this value. */ @Synchronized override fun logChange( columnPrefix: String, isInitial: Boolean, fun logChange( columnPrefix: String = "", isInitial: Boolean = false, rowInitializer: (TableRowLogger) -> Unit, ) { val row = tempRow Loading @@ -135,14 +157,29 @@ class TableLogBuffer( rowInitializer(row) } /** * Logs a String? change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ override fun logChange(prefix: String, columnName: String, value: String?, isInitial: Boolean) { logChange(systemClock.currentTimeMillis(), prefix, columnName, value, isInitial) } /** * Logs a boolean change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ override fun logChange(prefix: String, columnName: String, value: Boolean, isInitial: Boolean) { logChange(systemClock.currentTimeMillis(), prefix, columnName, value, isInitial) } /** * Logs a Int change. * * @param isInitial see [TableLogBuffer.logChange(String, Boolean, (TableRowLogger) -> Unit]. */ override fun logChange(prefix: String, columnName: String, value: Int?, isInitial: Boolean) { logChange(systemClock.currentTimeMillis(), prefix, columnName, value, isInitial) } Loading