System Icon Shape Setup and Initialization

Time:
The company does not allow csdn before 2020/11/05, and the notes are written elsewhere. recently tidied up

1. The main code of icon shape Overlay

The main code of icon shape is in frameworks/base/services/core/java/com/android/server/om

frameworks/base/core/java/android/content/om/OverlayManager.java
setEnabled
setEnabledExclusiveInCategory
↑↓aidl
frameworks/base/services/core/java/com/android/server/om/OverlayManagerService.java
↓真正的实现
frameworks/base/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java
updateOverlaysForUser
setEnabled
setEnabledExclusiveInCategory

2. Set the default shape

frameworks/base/core/res/res/values/config.xml
The shape and bool value should be changed together, cts will detect whether the shape of the icon is a circle

<bool name="config_useRoundIcon">true</bool>
<string name="config_icon_mask" translatable="false">"M50 0C77.6 0 100 22.4 100 50C100 77.6 77.6 100 50 100C22.4 100 0 77.6 0 50C0 22.4 22.4 0 50 0Z"</string>

3. Bugs encountered

Set the shape of the icon to be round, and it will become a square after restarting.
In /vendor/partner_gms/products/gms.mk, the default override set again causes

Spreadtrum android11

#PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
#    ro.boot.vendor.overlay.theme=com.android.internal.systemui.navbar.threebutton;com.android.theme.icon.squircle

mtk android11
​​/device/mediatek/system/common/ago/device.mk

ro.boot.vendor.overlay.theme=com.android.theme.icon.roundedrect

Summary
When it is found that the icon shape set by the framework does not take effect, search globally for the package name of the current icon shape orro.boot.vendor.overlay.theme

Guess you like

Origin blog.csdn.net/a396604593/article/details/129820851