How does Android change the status bar signal to 5

Source: Internet
Author: User

 

 

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 .@{*/

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.