Android 12.0 sets the default screen brightness percentage

1 Overview

  In 12.0 system product development, in some product development, the function of setting the default screen brightness and screen brightness percentage is also a common function in development. There may be some differences in the platform settings of 10.0. Generally, it is in SettingProvider The method of setting
the default screen brightness in the system after 11.0 is different. Next, the realization of the specific analysis function

2. The core class that sets the default screen brightness percentage

    packages\apps\Settings\src\com\android\settings\display\BrightnessLevelPreferenceController.java
    frameworks\base\services\core\java\com\android\server\power\PowerManagerService.java
    frameworks/base/res/res/values/config.xml

3. Analysis and implementation of the core function of setting the default screen brightness percentage

   PowerManagerServcie is the core service of the power management of the android system. It establishes a policy control scheme at the Framework layer
, and makes downward decisions on the HAL layer and the kernel layer to control the standby state of the device, control the display screen,
backlight, distance sensor, light sensor and other hardware devices status. Provide the corresponding operation interface to the application program,
such as keeping the system awake while listening to music, application notification coming to wake up the mobile phone screen and other scenarios, etc.
PMS is also the core service of the system, so the specific management of the default screen brightness is also
managed in PowerManagerServcie Yes, next, first look at the relevant methods of adjusting the screen brightness in the system settings

  3.1 How to set the default brightness percentage

    In the implementation of the function of setting the default screen brightness percentage, through the system Set

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/132590667