Loading core/java/android/util/FeatureFlagUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class FeatureFlagUtils { DEFAULT_FLAGS.put(SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE, "false"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_SPA, "true"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_SPA_PHASE2, "false"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_SPA_METRICS, "false"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_SPA_METRICS, "true"); DEFAULT_FLAGS.put(SETTINGS_ADB_METRICS_WRITER, "false"); DEFAULT_FLAGS.put(SETTINGS_SHOW_STYLUS_PREFERENCES, "true"); DEFAULT_FLAGS.put(SETTINGS_BIOMETRICS2_ENROLLMENT, "false"); Loading packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/common/SettingsPage.kt +5 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ data class SettingsPage( // The name of the page provider, who creates this page. It is used to compute the unique id. val sppName: String, // The category id of the page provider which is the PageId at SettingsEnums. val metricsCategory: Int = 0, // The display name of the page, for better readability. val displayName: String, Loading @@ -46,6 +49,7 @@ data class SettingsPage( // TODO: cleanup it once all its usage in Settings are switched to Spp.createSettingsPage fun create( name: String, metricsCategory: Int = 0, displayName: String? = null, parameter: List<NamedNavArgument> = emptyList(), arguments: Bundle? = null Loading @@ -53,6 +57,7 @@ data class SettingsPage( return SettingsPage( id = genPageId(name, parameter, arguments), sppName = name, metricsCategory = metricsCategory, displayName = displayName ?: name, parameter = parameter, arguments = arguments Loading packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/common/SettingsPageProvider.kt +5 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,10 @@ interface SettingsPageProvider { /** The page provider name, needs to be *unique* and *stable*. */ val name: String /** The category id which is the PageId at SettingsEnums.*/ val metricsCategory: Int get() = 0 enum class NavType { Page, Dialog, Loading Loading @@ -79,6 +83,7 @@ fun SettingsPageProvider.createSettingsPage(arguments: Bundle? = null): Settings return SettingsPage( id = genPageId(name, parameter, arguments), sppName = name, metricsCategory = metricsCategory, displayName = displayName + parameter.normalizeArgList(arguments, eraseRuntimeValues = true) .joinToString("") { arg -> "/$arg" }, parameter = parameter, Loading packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/common/SpaLogger.kt +1 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ internal const val LOG_DATA_DISPLAY_NAME = "name" internal const val LOG_DATA_SWITCH_STATUS = "switch" const val LOG_DATA_SESSION_NAME = "session" const val LOG_DATA_METRICS_CATEGORY = "metricsCategory" /** * The interface of logger in Spa Loading packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/util/PageLogger.kt +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settingslib.spa.framework.util import androidx.compose.runtime.Composable import androidx.core.os.bundleOf import com.android.settingslib.spa.framework.common.LOG_DATA_DISPLAY_NAME import com.android.settingslib.spa.framework.common.LOG_DATA_METRICS_CATEGORY import com.android.settingslib.spa.framework.common.LOG_DATA_SESSION_NAME import com.android.settingslib.spa.framework.common.LogCategory import com.android.settingslib.spa.framework.common.LogEvent Loading @@ -45,6 +46,7 @@ private fun SettingsPage.logPageEvent(event: LogEvent, navController: NavControl extraData = bundleOf( LOG_DATA_DISPLAY_NAME to displayName, LOG_DATA_SESSION_NAME to navController.sessionSourceName, LOG_DATA_METRICS_CATEGORY to metricsCategory, ).apply { val normArguments = parameter.normalize(arguments) if (normArguments != null) putAll(normArguments) Loading Loading
core/java/android/util/FeatureFlagUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class FeatureFlagUtils { DEFAULT_FLAGS.put(SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE, "false"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_SPA, "true"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_SPA_PHASE2, "false"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_SPA_METRICS, "false"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_SPA_METRICS, "true"); DEFAULT_FLAGS.put(SETTINGS_ADB_METRICS_WRITER, "false"); DEFAULT_FLAGS.put(SETTINGS_SHOW_STYLUS_PREFERENCES, "true"); DEFAULT_FLAGS.put(SETTINGS_BIOMETRICS2_ENROLLMENT, "false"); Loading
packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/common/SettingsPage.kt +5 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,9 @@ data class SettingsPage( // The name of the page provider, who creates this page. It is used to compute the unique id. val sppName: String, // The category id of the page provider which is the PageId at SettingsEnums. val metricsCategory: Int = 0, // The display name of the page, for better readability. val displayName: String, Loading @@ -46,6 +49,7 @@ data class SettingsPage( // TODO: cleanup it once all its usage in Settings are switched to Spp.createSettingsPage fun create( name: String, metricsCategory: Int = 0, displayName: String? = null, parameter: List<NamedNavArgument> = emptyList(), arguments: Bundle? = null Loading @@ -53,6 +57,7 @@ data class SettingsPage( return SettingsPage( id = genPageId(name, parameter, arguments), sppName = name, metricsCategory = metricsCategory, displayName = displayName ?: name, parameter = parameter, arguments = arguments Loading
packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/common/SettingsPageProvider.kt +5 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,10 @@ interface SettingsPageProvider { /** The page provider name, needs to be *unique* and *stable*. */ val name: String /** The category id which is the PageId at SettingsEnums.*/ val metricsCategory: Int get() = 0 enum class NavType { Page, Dialog, Loading Loading @@ -79,6 +83,7 @@ fun SettingsPageProvider.createSettingsPage(arguments: Bundle? = null): Settings return SettingsPage( id = genPageId(name, parameter, arguments), sppName = name, metricsCategory = metricsCategory, displayName = displayName + parameter.normalizeArgList(arguments, eraseRuntimeValues = true) .joinToString("") { arg -> "/$arg" }, parameter = parameter, Loading
packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/common/SpaLogger.kt +1 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ internal const val LOG_DATA_DISPLAY_NAME = "name" internal const val LOG_DATA_SWITCH_STATUS = "switch" const val LOG_DATA_SESSION_NAME = "session" const val LOG_DATA_METRICS_CATEGORY = "metricsCategory" /** * The interface of logger in Spa Loading
packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/util/PageLogger.kt +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settingslib.spa.framework.util import androidx.compose.runtime.Composable import androidx.core.os.bundleOf import com.android.settingslib.spa.framework.common.LOG_DATA_DISPLAY_NAME import com.android.settingslib.spa.framework.common.LOG_DATA_METRICS_CATEGORY import com.android.settingslib.spa.framework.common.LOG_DATA_SESSION_NAME import com.android.settingslib.spa.framework.common.LogCategory import com.android.settingslib.spa.framework.common.LogEvent Loading @@ -45,6 +46,7 @@ private fun SettingsPage.logPageEvent(event: LogEvent, navController: NavControl extraData = bundleOf( LOG_DATA_DISPLAY_NAME to displayName, LOG_DATA_SESSION_NAME to navController.sessionSourceName, LOG_DATA_METRICS_CATEGORY to metricsCategory, ).apply { val normArguments = parameter.normalize(arguments) if (normArguments != null) putAll(normArguments) Loading