Dialer 拨号显示版本号
定义全局变量:
private static final String VERSION_DISPLAY = "*#88#" ;
方法内新增判断:
static boolean handleDeviceIdDisplay(Context context, String input) {
...
...
if (telephonyManager != null && input.equals(VERSION_DISPLAY)) { // 判断Diler拨号等于输入密码(VERSION_DISPLAY),则往下执行
int labelResId = R.string.version;
String versionInfo = "";
String product = SystemProperties.get("ro.build.product", "");
android.util.Log.e("yangyulin", "------>product<------>" + product);
if (product.equals("Chameleon")) {
//[l936]*#88 mdf sw version in buildinfo.sh tiansheng 20210107 -b
versionInfo = SystemProperties.get("ro.build.cust_display", ""); //根据出货到不同国家的产品,Dialer输入密码显示的版本号不同(versionInfo)
} else if (product.equals("Chameleon_EEA")) {
versionInfo = SystemProperties.get("ro.build.cust_display_eea", "");
}else{
versionInfo = SystemProperties.get("ro.build.cust_display", "");
}
android.util.Log.e("yangyulin", "------>versionInfo<------>" + versionInfo);
if (!TextUtils.isEmpty(versionInfo)) {
AlertDialog alert = new AlertDialog.Builder(context)
.setTitle(labelResId)
.setMessage(versionInfo)
.setPositiveButton(android.R.string.ok, null)
.setCancelable(false)
.show();
return true;
}
...
...
}
标签:...,product,get,版本号,----,Dialer,versionInfo From: https://www.cnblogs.com/a-n-yan/p/17602955.html