添加开关KCM_HIDE_CUSTOM_BUILD_VERSION,控制之定义版本号隐藏,KCM_CUSTOM_BUILD_DISPLAY_ID 控制系统版本号自定义
packages/apps/Settings/src/com/android/settings/DeviceInfoSettings.java
@@ -64,6 +64,8 @@ import java.util.regex.Pattern;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
//fota end
+import android.os.SystemProperties;// CUSTOM_BUILD_DISPLAY_ID
public class DeviceInfoSettings extends SettingsPreferenceFragment implements Indexable {
@@ -133,7 +135,10 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
setStringSummary(KEY_DEVICE_MODEL, Build.MODEL + getMsvSuffix());
setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
setStringSummary(KEY_DEVICE_MODEL, Build.MODEL);
- setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
+ // CUSTOM_BUILD_DISPLAY_ID
+ //setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
+ setStringSummary(KEY_BUILD_NUMBER, SystemProperties.get("ro.custom_kernel_version",Build.DISPLAY));
+ //modify end
findPreference(KEY_BUILD_NUMBER).setEnabled(true);
findPreference(KEY_KERNEL_VERSION).setSummary(getFormattedKernelVersion());
packages/apps/Settings/src/com/mediatek/settings/deviceinfo/DeviceInfoSettingsExts.java
@@ -107,6 +107,10 @@ public class DeviceInfoSettingsExts {
if (FeatureOption.MTK_A1_FEATURE) {
removePreference(findPreference(KEY_CUSTOM_BUILD_VERSION));
}
+ // KCM_HIDE_CUSTOM_BUILD_VERSION
+ if (SystemProperties.get("ro.hide_custom_build_version").equals("1")){
+ removePreference(findPreference(KEY_CUSTOM_BUILD_VERSION));
+ }
}
private void updateTitleToActivityLabel(String key) {
#KCM added by cyl hide custom build version
+ifeq ($(strip $(KCM_HIDE_CUSTOM_BUILD_VERSION)), yes)
+ PRODUCT_PROPERTY_OVERRIDES += ro.hide_custom_build_version=1
+endif
+
+#KCM custom build version
+ifeq ($(strip $(KCM_CUSTOM_BUILD_DISPLAY_ID)), yes)
+ PRODUCT_PROPERTY_OVERRIDES += ro.custom_build_display_id=1
+endif
device/along/common/ProjectConfig.mk
#KCM custom build version
+KCM_HIDE_CUSTOM_BUILD_VERSION = no
+
+#KCM custom Build number 在项目的system.prop中添加ro.custom_kernel_version=xxx
+KCM_CUSTOM_BUILD_DISPLAY_ID = no