在O的Settings中添加新项时,需要重写getMetricsCategory
@Override public int getMetricsCategory() { return MetricsEvent.LED_BRIGHTNESS_LEVEL; }
这个LED_BRIGHTNESS_LEVEL的定义在frameworksaseprotosrcmetrics_constants.proto
需要往后翻到预留的位置添加新的ID LED_BRIGHTNESS_LEVEL = 1146;
其他与这个MetricsEvent相关的文件在:
frameworksasecorejavacomandroidinternalloggingMetricsLogger.java
frameworksasepackagesSettingsLibsrccomandroidsettingslibdrawerTile.java
frameworksasepackagesSettingsLibsrccomandroidsettingslibdrawerTileUtils.java