微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > OTA 升级重启后,提示:"fail to upgrade to version ***".

OTA 升级重启后,提示:"fail to upgrade to version ***".

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]
OTA 升级后,重新开机后提示:"fail to upgrade to version ***", 进入到setting中查看版本号时,已经成功升级到 “version ***”
[SOLUTION]
原因:客户有自定义一个 custom version,这样,在升级后通知升级结果时,原code获取的版本信息是
build.verno,并不是custom version,所以不一样,提示升级失败。
请参考以下方式修改code:
请修改 SystemUpdateReceiver.Java 的 getUpdateResult():
修改后:
private boolean getUpdateResult() {
Xlog.i(TAG, "getUpdateResult");
if (FeatureOption.mtk_EMMC_SUPPORT) {
try {
IBinder binder = ServiceManager.getService("GoogleOtaBinder");
SystemUpdateBinder agent = SystemUpdateBinder.Stub
.asInterface(binder);
if (agent == null) {
Xlog.e(TAG, "Agent is null.");
return false;
}
return agent.readUpgradeResult();
} catch (RemoteException e) {
e.printStackTrace();
return false;
}
} else {
//add by lyx begin
String strCurrentVersion =
SystemProperties.get("ro.custom.build.version");
if(strCurrentVersion ==null){
String strCurrentVersion = SystemProperties.get("ro.build.display.id");
}
//add by lyx end
if (strCurrentVersion != null) {
strCurrentVersion = strCurrentVersion.trim();
Xlog.i(TAG, "strCurrentVersion = " + strCurrentVersion);
}
DownloadInfo downloadInfo = DownloadInfo.getInstance(mContext);
String strTargetVersion = downloadInfo.getTargetVer();
if (strTargetVersion != null) {
strTargetVersion = strTargetVersion.trim();
Xlog.i(TAG, "strTargetVersion = " + strTargetVersion);
}
return (strTargetVersion.equalsIgnoreCase(strCurrentVersion));
}
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top