Add throttlingDataId to deviceConfig
Currently, we don't have the ability to specify the brightnessThrottlingDataModeId when overriding values in BrightnessThrottler through the DeviceConfig. If we do use the DeviceConfig to override values, any mode-specific throttling policies will be overwritten and lost, since we do not pick and choose between the DeviceConfig values and the DisplayDeviceConfig values. This change allows us to specify the brightness throttling id in the DeviceConfig strings, in order to change the throttling policy based on the id chosen based on the current display layout. Strings passed used by the display config must specify the uniqueDisplayId, and may specify the throttling id, if unspecified, "default" will be used. Valid strings can include: 123,1,critical,0.8;456,2,moderate,0.9,critical,0.7 123,1,critical,0.8,default;123,1,moderate,0.6,mode_2;456,2,moderate,0.9,critical,0.7 Given that one BrightnessThrottler is currently created for each DisplayPowerController, the values stored for the current mode are just per display, but the String & derived data passed in via DeviceConfig will continue to be global, since this is more effective for debugging purposes. DeviceConfig values take top priority, however, throttling Id specific values take priority over default values, so an Id-specific value set from the DisplayDeviceConfig, will take priority over a default throttling id value from DeviceConfig. Bug: 267623520 Test: atest com.server.android.display Test: atest BrightnessThrottlerTest DisplayModeDirectorTest LogicalDisplayMapperTest Test: adb shell cmd device_state state 4 && adb shell device_config put display_manager brightness_throttling_data "local:4619827677550801152,3,moderate,0.5,severe,0.379518072,emergency,0.248995984\;local:4619827677550801153,1,moderate,0.75\;local:4619827677550801153,1,moderate,0.11,concurrent" Change-Id: I90bd673c794bdcf4b6522997bacd924d7e122c09
Loading
Please register or sign in to comment