Android 8.0 Settings新添加的重写getMetricsCategory
在O的Settings中添加新项时,需要重写getMetricsCategory
@Override public int getMetricsCategory() { return MetricsEvent.LED_BRIGHTNESS_LEVEL; }
这个LED_BRIGHTNESS_LEVEL的定义在frameworks\base\proto\src\metrics_constants.proto
需要往后翻到预留的位置添加新的ID LED_BRIGHTNESS_LEVEL = 1146;
其他与这个MetricsEvent相关的文件在:
frameworks\base\core\java\com\android\internal\logging\MetricsLogger.java
frameworks\base\packages\SettingsLib\src\com\android\settingslib\drawer\Tile.java
frameworks\base\packages\SettingsLib\src\com\android\settingslib\drawer\TileUtils.java