Android5.1
When the machine is not brushed into the baseband, in the Settings-about tablet, the Baseband version column displays unknown
You now want to not show this column when the baseband version is unknown
Refer to the Android5.1 wallpaper source option with two "wallpapers" option, which shows that these settings are dynamically loaded fragment
First find the place to load about the tablet
packages/apps/settings/src/com/android/settings/ Deviceinfosettings.java
You can see the public class deviceinfosettings extends settingspreferencefragment Implements indexable
Find information about baseband
Private Static FinalString key_baseband_version = "Baseband_version";..... setvaluesummary (key_baseband_version,"Gsm.version.baseband");......//Remove Baseband version if wifi-only deviceif(Utils.iswifionly (Getactivity ())) {
Getpreferencescreen (). Removepreference (Findpreference (key_baseband_version));} ......Private voidsetvaluesummary (string preference, string property) {Try{findpreference (preference). Setsummary (Systemproperties.get (Property,getresources (). getString (r.string. (Device_info_default))); } Catch(RuntimeException e) {//No Recovery } }
WiFi only, non-SIM-enabled machines are not showing baseband versions
Setvaluesummary, took the R.string.device_info_default
Search Device_info_default can be "unknown", "Unknown" and so on.
Add the criteria for deleting baseband, refer to the method used in Setvaluesummary
Private Boolean Isnobaseband () { // Add this method to determine the baseband version return systemproperties.get (KEY _baseband_version, getresources (). getString (R.string.device_info_default)) . Equals (Getresources (). GetString (R.string.device_info_default)); } // Remove Baseband version if wifi-only device plus a judging condition if (utils.iswifionly (Getactivity ()) | | Isnobaseband ()) { getpreferencescreen (). Removepreference (Findpreference (key_baseband_version)); }
Never use a specific string to determine
such as this:
Systemproperties.get (Key_baseband_version,getresources (). getString (R.string.device_info_default))
. Equals ("Unknown")
If you change a system language, for example, to Chinese, then this judgment will expire.
After the modification is complete, the compilation push goes in, you can see the effect
Auto Hide when Android-baseband version is unknown