Currently, the default android signal lattice is 4. How can we convert it to 5?
Because SystemUI only determines the icon and displays it based on the signal strength value transmitted by telephony, it is mainly completed in two steps to implement this function. 1. Modify the signal processing part of the telephony module. For details, refer:
Customized modification Code Description and example2. Modify the display part of the Systemui signal. There are two methods for calling SystemUI resources: customized by the carrier and default by the system. The difference between the two is that the image resource location is different, and the interface for obtaining resources is different. However, image resources are obtained based on the signal strength iconLevel.
Possible modifications include:
(1) NetworkControllerGemini. java (alpsrameworksasepackagesSystemUIsrccomandroidsystemuistatusbarpolicy)
Private final void updateTelephonySignalStrength (int slotId)
......
In this function, the variables tempLastSignalLevel [0], iconLevel [0], and tempPhoneSignalIconId [0] are used and need to be processed accordingly.
For example, the default resource calling interface is:
} Else {
IconList [0] = TelephonyIconsGemini. getTelephonySignalStrengthIconList (simColorId, false );
TempPhoneSignalIconId [0]. setResources (null );
If (iconLevel [0] <5 ){
TempPhoneSignalIconId [0]. setIconId (iconList [0] [iconLevel [0]);
}
} (2) obtain the image resource TelephonyIconsGemini. java using public static int [] getTelephonySignalStrengthIconList (int simColorId, boolean showSimIndicator) based on SIM card attributes ){
If (showSimIndicator ){
Return TELEPHONY_SIGNAL_STRENGTH_WHITE;
} Else {
Return TELEPHONY_SIGNAL_STRENGTH [simColorId];
}
} Image resource definition,
Image resource needs to be addedPrivate static final int [] TELEPHONY_SIGNAL_STRENGTH_WHITE = {
R. drawable. stat_sys_gemini_signal_0,
R. drawable. stat_sys_gemini_signal_1_white,
R. drawable. stat_sys_gemini_signal_2_white,
R. drawable. stat_sys_gemini_signal_3_white,
R. drawable. stat_sys_gemini_signal_4_white };
/** Signal level icons for normal .@{*/