imx8qxp support OTA?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8qxp support OTA?

2,403 Views
ucwenux5
Contributor I

HI Guys,

 imx8 support OTA? Why does "make otapackage" compile without output u-boot-imx8qxp.imx?

and  Mfgtool needs u-boot-imx8qxp.imx to upgrade img for the first time.How to do it?

If the first “make -j4" can generate u-boot-imx8qxp.imx, but if I first time  completely recompile directly with the following command:

cd  ${MY_ANDROID}

build/envsetup. Sh

lunch mek_8q - userdebug

make otapackage - j4

Not generated u-boot-imx8qxp.imx.

Tags (1)
0 Kudos
Reply
4 Replies

1,973 Views
darshan_talati
Contributor I

Hi,

Do you have OTA update working for Android pie on iMX8M?

0 Kudos
Reply

1,973 Views
ucwenux5
Contributor I

全包升级:

1make otapackage –jx编译OTA全包;

2:解压OTA包,获取payload.binpayload_properties.txt文件,将两个文件拷贝到U盘的OTAlocal文件夹中(OTAlocal文件存在并且还是一个文件夹才可以进行OTA本地升级);

3:将out/target/product/mek_8q/system/build.prop文件拷贝到U盘的OTAlocal文件夹中;

4:查看当前系统的版本号并且修改build.prop中的ro.build.display.id(当前系统的版本号与拷贝到U盘中的build.prop文件中的ro.build.display.id值不相等时,则表示全包升级);

5:最后手动点击Upgrade进行全包升级,升级成功之后点击reboot重启;

差分升级:

1make target-files-package -jx编译OTA差分包(注意是要在全包升级的基础上编译差分包升级);

2:当有新的改动时再进行make target-files-package -jx编译新的OTA差分包;

3:将两个差分包文件通过. build/tools/releasetools/ota_from_target_files –i进行合并成一个ota_update.zip文件;

4:解压合并之后的ota_update.zip文件,获取payload.binpayload_properties.txt文件,将两个文件拷贝到U盘的JTDlocal文件夹中(OTAlocal文件存在并且还是一个文件夹才可以进行OTA本地升级);

3:将out/target/product/mek_8q/system/build.prop文件拷贝到U盘的OTAlocal文件夹中;

4:查看当前系统的版本号并且修改build.prop中的ro.build.display.id(当前系统的版本号与拷贝到U盘中的build.prop文件中的ro.build.display.id值不相等时,则表示差分升级);

5:最后手动点击DiffUpgrade进行差分升级,升级成功之后点击reboot重启;

0 Kudos
Reply

1,973 Views
ucwenux5
Contributor I

From 2113rx5953d021ccf2419kt70000acfdfce70111 Mon Sep 23 00:00:00 2019
From: xxx <xxx@xxx.com>
Date: Mon, 22 Apr 2019 15:35:39 +0800
Subject: [PATCH] =OTAlocal!!
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: I222abd55ce4ced8ab23efd7155238131b1f2e445
---
FSLOta/AndroidManifest.xml | 19 +-
FSLOta/res/layout/main.xml | 2 +-
FSLOta/res/values/strings.xml | 0
.../src/com/fsl/android/ota/BuildPropParser.java | 16 +-
.../src/com/fsl/android/ota/OTAServerConfig.java | 48 +++-
.../src/com/fsl/android/ota/OTAServerManager.java | 254 ++++++++++++++++++---
FSLOta/src/com/fsl/android/ota/OtaAppActivity.java | 39 +++-
7 files changed, 329 insertions(+), 49 deletions(-)
mode change 100644 => 100755 FSLOta/AndroidManifest.xml
mode change 100644 => 100755 FSLOta/res/layout/main.xml
mode change 100644 => 100755 FSLOta/res/values/strings.xml
mode change 100644 => 100755 FSLOta/src/com/fsl/android/ota/BuildPropParser.java
mode change 100644 => 100755 FSLOta/src/com/fsl/android/ota/OTAServerConfig.java
mode change 100644 => 100755 FSLOta/src/com/fsl/android/ota/OTAServerManager.java
mode change 100644 => 100755 FSLOta/src/com/fsl/android/ota/OtaAppActivity.java

diff --git a/FSLOta/AndroidManifest.xml b/FSLOta/AndroidManifest.xml
old mode 100644
new mode 100755
index 61ca776..7700e83
--- a/FSLOta/AndroidManifest.xml
+++ b/FSLOta/AndroidManifest.xml
@@ -3,7 +3,7 @@
coreApp="true"
package="com.fsl.android.ota"
android:versionCode="1"
- android:versionName="1.0" >
+ android:versionName="1.0">

<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
@@ -13,7 +13,24 @@
<uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.VIBRATE" />
+ <uses-permission android:name="android.permission.WRITE_SETTINGS" />
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
+ <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.BROADCAST_STICKY" />
+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+ <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
+ <uses-permission android:name="android.permission.GET_TASKS" />
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"/>
+ <uses-permission android:name="android.permission.READ_MEDIA_STORAGE"/>
+ <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
+ <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
+ <uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>

+
<application
android:icon="@drawable/ic_launcher"
android:usesCleartextTraffic="true"
diff --git a/FSLOta/res/layout/main.xml b/FSLOta/res/layout/main.xml
old mode 100644
new mode 100755
index 0b61ba4..8e4581e
--- a/FSLOta/res/layout/main.xml
+++ b/FSLOta/res/layout/main.xml
@@ -67,7 +67,7 @@
android:id="@+id/diff_upgrade_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_column="3"
+ android:layout_column="6"
android:layout_columnSpan="3"
android:layout_row="5"
android:layout_rowSpan="2"
diff --git a/FSLOta/res/values/strings.xml b/FSLOta/res/values/strings.xml
old mode 100644
new mode 100755
diff --git a/FSLOta/src/com/fsl/android/ota/BuildPropParser.java b/FSLOta/src/com/fsl/android/ota/BuildPropParser.java
old mode 100644
new mode 100755
index 4f85d44..6c054d4
--- a/FSLOta/src/com/fsl/android/ota/BuildPropParser.java
+++ b/FSLOta/src/com/fsl/android/ota/BuildPropParser.java
@@ -39,10 +39,12 @@ public class BuildPropParser {
mContext = context;
propHM = new HashMap<String, String>();
setFile(file);
+ Log.d(TAG, "BuildPropParser() ---> file:" + file);
}

public HashMap<String, String> getPropMap() { return propHM;};
public String getProp(String propname) {
+ Log.d(TAG, "getProp() ---> propname:" + propname);
if (propHM != null)
return (String) propHM.get(propname);
else
@@ -51,17 +53,22 @@ public class BuildPropParser {

private void setByteArrayStream(ByteArrayOutputStream out) {
try {
+ Log.d(TAG, "setByteArrayStream() ---> out:" + out);
File tmpDir = null;
if (mContext != null)
tmpDir = mContext.getFilesDir();
Log.d(TAG, "tmpDir:" + tmpDir.toString() + "\n");
tmpFile = File.createTempFile("buildprop", "ss", tmpDir);
+ Log.d(TAG, "setByteArrayStream() ---> tmpFile:" + tmpFile);

tmpFile.deleteOnExit();
FileOutputStream o2 = new FileOutputStream(tmpFile);
+ Log.d(TAG, "setByteArrayStream() ---> o2:" + o2);
out.writeTo(o2);
+ Log.d(TAG, "setByteArrayStream() ---> out writeTo:" + out);
o2.close();
setFile(tmpFile);
+ Log.d(TAG, "setByteArrayStream() ---> setFile tmpFile:" + tmpFile);
tmpFile.delete();
} catch (IOException e) {
e.printStackTrace();
@@ -70,14 +77,19 @@ public class BuildPropParser {

private void setFile(File file) throws IOException {
try {
+ Log.d(TAG, "setFile() ---> file:" + file);
FileReader reader = new FileReader(file);
+ Log.d(TAG, "setFile() ---> reader:" + reader);
BufferedReader in = new BufferedReader(reader);
+ Log.d(TAG, "setFile() ---> in:" + in);
String string;
while ((string = in.readLine()) != null) {
Scanner scan = new Scanner(string);
+ Log.d(TAG, "setFile() ---> scan:" + scan);
scan.useDelimiter("=");
try {
propHM.put(scan.next(), scan.next());
+ Log.d(TAG, "setFile() ---> propHM:" + propHM);
} catch (NoSuchElementException e) {
continue;
}
@@ -90,13 +102,15 @@ public class BuildPropParser {
}

public String getRelease() {
+ Log.d(TAG, "getRelease()");
if (propHM != null)
return propHM.get("ro.build.version.release");
else
return null;
}
public String getNumRelease() {
- if (propHM != null)
+ Log.d(TAG, "getNumRelease()");
+ if (propHM != null)
return propHM.get("ro.build.version.incremental");
else
return null;
diff --git a/FSLOta/src/com/fsl/android/ota/OTAServerConfig.java b/FSLOta/src/com/fsl/android/ota/OTAServerConfig.java
old mode 100644
new mode 100755
index 2e141d2..da7428b
--- a/FSLOta/src/com/fsl/android/ota/OTAServerConfig.java
+++ b/FSLOta/src/com/fsl/android/ota/OTAServerConfig.java
@@ -48,6 +48,8 @@ public class OTAServerConfig {
final String server_ip_config = "server";
final String port_config_str = "port";
final String android_nickname = "ota_folder_suffix";
+ final String OTAlocaldata_str = "OTAlocaldata";
+ String udisk;
public OTAServerConfig (String productname) throws MalformedURLException {
if (loadConfigureFromFile(configFile, productname) == false)
defaultConfigure(productname);
@@ -72,6 +74,8 @@ public class OTAServerConfig {

String version = SystemProperties.get("ro.build.version.release");
String platform = SystemProperties.get("ro.board.platform");
+ udisk = SystemProperties.get("persist.sys.udisk");
+ Log.d(TAG, "loadConfigureFromFile ---> udisk : " + udisk);
ota_folder = new String(product + "_" + android_name + "_" + version + "/");
fileaddr = new String(ota_folder + product + "-ota-" + version_incremental + ".zip");
buildconfigAddr = new String(ota_folder + "build.prop");
@@ -81,6 +85,7 @@ public class OTAServerConfig {
payloadAddr = new String(ota_folder + "payload.bin");
diffPayloadAddr = new String(ota_folder + "payload_diff.bin");
if (platform.indexOf("imx8") != -1) {
+ Log.d(TAG, "loadConfigureFromFile ---> platform : " + platform);
ab_slot = true;
}

@@ -94,9 +99,12 @@ public class OTAServerConfig {
diffbuildpropURL = new URL(default_protocol, server, port, diffbuildconfigAddr);
diffPayloadPropertiesURL = new URL(default_protocol, server, port, diffPayloadPropertiesAddr);
diffPayloadURL = new URL(default_protocol, server, port, diffPayloadAddr);
- Log.d(TAG, "build.prop: " + buildpropURL.toString());
- Log.d(TAG, "payload.bin: " + payloadURL.toString());
- Log.d(TAG, "payload_properties.txt" + payloadPropertiesURL.toString());
+ Log.d(TAG, "loadConfigureFromFile() ---> build.prop: " + buildpropURL.toString());
+ Log.d(TAG, "loadConfigureFromFile() ---> payload.bin: " + payloadURL.toString());
+ Log.d(TAG, "loadConfigureFromFile() ---> payload_properties.txt" + payloadPropertiesURL.toString());
+ Log.d(TAG, "loadConfigureFromFile() ---> diffbuildpropURL : " + diffbuildpropURL.toString());
+ Log.d(TAG, "loadConfigureFromFile() ---> diffPayloadPropertiesURL : " + diffPayloadPropertiesURL.toString());
+ Log.d(TAG, "loadConfigureFromFile() ---> diffPayloadURL : " + diffPayloadURL.toString());
}
} catch (Exception e) {
Log.e(TAG, "wrong format/error of OTA configure file.");
@@ -114,27 +122,35 @@ public class OTAServerConfig {
String buildconfigAddr = new String(product + "/" + "build.prop");
updatePackageURL = new URL(default_protocol, default_serveraddr, default_port, fileaddr );
buildpropURL = new URL(default_protocol, default_serveraddr, default_port, buildconfigAddr);
- Log.d(TAG, "create a new server config: package url " + updatePackageURL.toString() + "port:" + updatePackageURL.getPort());
- Log.d(TAG, "build.prop URL:" + buildpropURL.toString());
+ Log.d(TAG, "defaultConfigure() ---> create a new server config: package url " + updatePackageURL.toString() + "port:" + updatePackageURL.getPort());
+ Log.d(TAG, "defaultConfigure() ---> build.prop URL:" + buildpropURL.toString());
+ }
+
+ public String getUdisk(){
+ return udisk;
}

public boolean ab_slot()
{
+ Log.d(TAG, "ab_slot() ---> ab_slot:" + ab_slot);
return ab_slot;
}

public boolean getDiffUpgrade()
{
+ Log.d(TAG, "getDiffUpgrade() ---> is_diff_upgrade:" + is_diff_upgrade);
return is_diff_upgrade;
}

public void setDiffUpgrade()
{
+ Log.d(TAG, "config setDiffUpgrade() --->" + is_diff_upgrade);
is_diff_upgrade = true;
}

public URL getPackageURL ()
{
+ Log.d(TAG, "getPackageURL() ---> ab_slot:" + ab_slot);
if (ab_slot) {
if (getDiffUpgrade())
return diffPayloadURL;
@@ -147,14 +163,32 @@ public class OTAServerConfig {

public URL getPayloadPropertiesURL ()
{
+ Log.d(TAG, "getPayloadPropertiesURL() ---> :");
if (getDiffUpgrade())
return diffPayloadPropertiesURL;
else
return payloadPropertiesURL;
}

- public URL getBuildPropURL() { return buildpropURL; }
+ public URL getBuildPropURL() {
+ Log.d(TAG, "getBuildPropURL() ---> :");
+ return buildpropURL;
+ }

- public URL getBuildPropDiffURL() { return diffbuildpropURL; }
+ public URL getBuildPropDiffURL() {
+ Log.d(TAG, "getBuildPropDiffURL() ---> :");
+ return diffbuildpropURL;
+ }
+
+ public boolean isFileExists(){
+ Log.d(TAG, "isFileExists() ---> :");
+ File file =new File(udisk + "/OTAlocal");
+ if (file.exists()&& file.isDirectory()){
+ Log.d(TAG, "isFileExists() ---> : file true");
+ return true;
+ }else{
+ return false;
+ }
+ }

}
diff --git a/FSLOta/src/com/fsl/android/ota/OTAServerManager.java b/FSLOta/src/com/fsl/android/ota/OTAServerManager.java
old mode 100644
new mode 100755
index e4aaa1e..567ea56
--- a/FSLOta/src/com/fsl/android/ota/OTAServerManager.java
+++ b/FSLOta/src/com/fsl/android/ota/OTAServerManager.java
@@ -34,6 +34,7 @@ import android.os.RecoverySystem;
import android.os.UpdateEngine;
import android.os.UpdateEngineCallback;
import android.util.Log;
+import android.net.Uri;

public class OTAServerManager {
public interface OTAStateChangeListener {
@@ -108,6 +109,7 @@ public class OTAServerManager {

public OTAServerManager(Context context) throws MalformedURLException {
mConfig = new OTAServerConfig(Build.PRODUCT);
+ Log.d(TAG, "OTAServerManager ---> mConfig:" + mConfig + "Build.PRODUCT : " + Build.PRODUCT);
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
mWakelock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "OTA Wakelock");
mContext = context;
@@ -123,12 +125,15 @@ public class OTAServerManager {
}

public boolean checkNetworkOnline() {
+ Log.d(TAG, "checkNetworkOnline --->");
ConnectivityManager conMgr = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);

if (conMgr.getNetworkInfo(ConnectivityManager.TYPE_ETHERNET).isConnectedOrConnecting()||
conMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting()) {
+ Log.d(TAG, "checkNetworkOnline wifi isConnectedOrConnecting--->");
return true;
} else {
+ Log.d(TAG, "checkNetworkOnline wifi false--->");
return false;
}
}
@@ -136,7 +141,10 @@ public class OTAServerManager {
public void startCheckingVersion() {

Log.v(TAG, "startCheckingVersion");
- if (checkURLOK(mConfig.getBuildPropURL()) == false) {
+ if(mConfig.isFileExists() == false){
+ //Network upgrade
+ if (checkURLOK(mConfig.getBuildPropURL()) == false) {
+ Log.d(TAG, "startCheckingVersion() ---> mConfig.getBuildPropURL(): " + mConfig.getBuildPropURL());
if (this.mListener != null) {
if (this.checkNetworkOnline()) {
reportCheckingError(OTAStateChangeListener.ERROR_CANNOT_FIND_SERVER);
@@ -152,8 +160,11 @@ public class OTAServerManager {
}

parser = getTargetPackagePropertyList(mConfig.getBuildPropURL());
+ Log.d(TAG, "startCheckingVersion() ---> parser: " + parser + "mConfig.getBuildPropURL():" + mConfig.getBuildPropURL());
if (ab_slot()) {
+ Log.d(TAG, "startCheckingVersion() ---> ab_slot(): " + ab_slot());
parser_diff = getTargetPackagePropertyList(mConfig.getBuildPropDiffURL());
+ Log.d(TAG, "startCheckingVersion() ---> parser_diff: " + parser_diff + "mConfig.getBuildPropDiffURL():" +mConfig.getBuildPropDiffURL());
}

if (parser != null) {
@@ -162,24 +173,40 @@ public class OTAServerManager {
OTAStateChangeListener.NO_ERROR, parser);
} else {
reportCheckingError(OTAStateChangeListener.ERROR_WRITE_FILE_ERROR);
+ Log.d(TAG, "startCheckingVersion() ---> OTAStateChangeListener.ERROR_WRITE_FILE_ERROR ");
}
+
+ }else{
+ //Local upgrade
+ Log.v(TAG, "startCheckingVersion ota.conf getLocal exists");
+ if (this.mListener != null)
+ this.mListener.onStateOrProgress(OTAStateChangeListener.STATE_IN_CHECKED,
+ OTAStateChangeListener.NO_ERROR, null);
+ Log.d(TAG, "startCheckingVersion() ---> OTAStateChangeListener.ERROR_WRITE_FILE_ERROR ");
+ }
+
}

public boolean getUpdateHeader(URL propertiesURL)
{
try {
+ Log.d(TAG, "getUpdateHeader() ---> propertiesURL: " + propertiesURL);
URL url = propertiesURL;
+ Log.d(TAG, "getUpdateHeader() ---> url: " + url);
url.openConnection();
InputStream is = url.openStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ Log.d(TAG, "getUpdateHeader() ---> br: " + br);
List<String> lines = new ArrayList<String>();
String line = null;
while ((line = br.readLine()) != null) {
lines.add(line);
+ Log.d(TAG, "getUpdateHeader() ---> lines.add(line): " + line);
}
br.close();
is.close();
mUpdateHeader = lines.toArray(new String[lines.size()]);
+ Log.d(TAG, "getUpdateHeader() ---> mUpdateHeader: " + mUpdateHeader);
mUpdateEngine.bind(new OTAUpdateEngineCallback(this.mListener));

return true;
@@ -191,7 +218,38 @@ public class OTAServerManager {
return false;
}
}
+
+ // read payload_properties.txt
+ public boolean getPayloadProperties(String payloadProperties) {
+ try {
+ File file = new File(payloadProperties);
+ Log.d(TAG, "getPayloadProperties file: " + file);
+ InputStreamReader is = new InputStreamReader(new FileInputStream(file));
+ Log.d(TAG, "getPayloadProperties is: " + is);
+ BufferedReader br = new BufferedReader(is);
+ Log.d(TAG, "getPayloadProperties br: " + br);
+ List<String> lines = new ArrayList<String>();
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ Log.d(TAG, "getPayloadProperties line: " + line);
+ lines.add(line);
+ }
+ br.close();
+ is.close();
+ mUpdateHeader = lines.toArray(new String[lines.size()]);
+ Log.d(TAG, "getPayloadProperties() ---> mUpdateHeader: " + mUpdateHeader);
+ mUpdateEngine.bind(new OTAUpdateEngineCallback(this.mListener));
+ return true;
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }

+ String remoteBulidId;
// return true if needs to upgrade
public OtaTypeSelect compareLocalVersionToServer() {
boolean diff_ota = false;
@@ -199,40 +257,99 @@ public class OTAServerManager {
Long remoteDiffBuildUTC = 0L;
Long remoteDiffBuildBaseUTC = 0L;

- if (parser == null) {
- Log.d(TAG, "compareLocalVersion Without fetch remote prop list.");
+ /*if (parser == null) {
+ Log.d(TAG, "compareLocalVersion Without fetch remote prop list." + OtaTypeSelect.NONE);
return OtaTypeSelect.NONE;
- }
+ }*/
OtaTypeSelect upgrade = OtaTypeSelect.NONE;
- Long buildutc = Build.TIME;
+ Log.d(TAG, "compareLocalVersionToServer() ---> upgrade: " + upgrade);
+ /*Long buildutc = Build.TIME;
+ Log.d(TAG, "compareLocalVersionToServer() ---> buildutc: " + buildutc);
// *1000 because Build.java also *1000, align with it.
Long remoteBuildUTC = (Long.parseLong(parser.getProp("ro.build.date.utc"))) * 1000;
+ Log.d(TAG, "compareLocalVersionToServer() ---> remoteBuildUTC: " + remoteBuildUTC);
if (buildutc < remoteBuildUTC)
full_ota = true;
if (ab_slot()) {
remoteDiffBuildUTC = (Long.parseLong(parser_diff.getProp("ro.build.date.utc"))) * 1000;
remoteDiffBuildBaseUTC = (Long.parseLong(parser_diff.getProp("base.ro.build.date.utc"))) * 1000;
+ Log.d(TAG, "compareLocalVersionToServer() ---> remoteDiffBuildUTC: " + remoteDiffBuildUTC + "remoteDiffBuildBaseUTC:" + remoteDiffBuildBaseUTC);
if (buildutc < remoteDiffBuildUTC && buildutc.equals(remoteDiffBuildBaseUTC))
diff_ota = true;
+ }*/
+
+
+ String build_display_id = Build.DISPLAY;
+ Log.d(TAG, "compareLocalVersionToServer() ---> build_display_id: " + build_display_id);
+ if(mConfig.isFileExists() == false){
+ //Network upgrade
+ remoteBulidId = parser_diff.getProp("ro.build.display.id");
+ Log.d(TAG, "compareLocalVersionToServer() ---> remoteBulidId: " + remoteBulidId);
+
+ }else{
+ //Local upgrade
+ String path = mConfig.getUdisk()+"/OTAlocal/build.prop";
+ Log.d(TAG, "compareLocalVersionToServer() ---> path: " + path);
+ try {
+ File file = new File(path);
+ InputStreamReader is = new InputStreamReader(new FileInputStream(file));
+ BufferedReader br = new BufferedReader(is);
+ List<String> lines = new ArrayList<String>();
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ Log.d(TAG, "compareLocalVersionToServer line: " + line);
+ lines.add(line);
+ }
+ br.close();
+ is.close();
+ String[] buildProp = lines.toArray(new String[lines.size()]);
+ Log.d(TAG, "compareLocalVersionToServer buildProp: " + buildProp);
+ for(String str : buildProp){
+ if(str.contains("ro.build.display.id=")){
+ String [] split = str.split("=");
+ Log.d(TAG, "compareLocalVersionToServer split: " + split);
+ remoteBulidId = split[1];
+ Log.d(TAG, "compareLocalVersionToServer str: " + str + "split : " + split + "remoteBulidId:" + remoteBulidId);
+ }
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ if(build_display_id != remoteBulidId){
+ full_ota = true;
+ diff_ota = true;
}
- if (full_ota && diff_ota)
+
+ Log.d(TAG, "compareLocalVersionToServer() ---> full_ota: " + full_ota + "diff_ota:" + diff_ota);
+ /*if (full_ota && diff_ota)
upgrade = OtaTypeSelect.BOTH_OTA;
else if (full_ota)
upgrade = OtaTypeSelect.FULL_OTA;
else if (diff_ota)
- upgrade = OtaTypeSelect.DIFF_OTA;
+ upgrade = OtaTypeSelect.DIFF_OTA;*/
+ if (full_ota || diff_ota){
+ upgrade = OtaTypeSelect.BOTH_OTA;
+ Log.d(TAG, "compareLocalVersionToServer() ---> OtaTypeSelect.BOTH_OTA:");
+ }
// here only check build time, in your case, you may also check build id, etc.
- Log.d(TAG, "remote BUILD TIME: " + remoteBuildUTC + " remote DIFF BUILD TIME: " + remoteDiffBuildUTC + " remote DIFF BUILD BASE TIME: " + remoteDiffBuildBaseUTC + " local BUILD TIME:" + buildutc);
+ //Log.d(TAG, "remote BUILD TIME: " + remoteBuildUTC + " remote DIFF BUILD TIME: " + remoteDiffBuildUTC + " remote DIFF BUILD BASE TIME: " + remoteDiffBuildBaseUTC + " local BUILD TIME:" + buildutc);
return upgrade;
}

void publishDownloadProgress(long total, long downloaded) {
- //Log.v(TAG, "download Progress: total: " + total + "download:" + downloaded);
+ Log.v(TAG, "publishDownloadProgress() ---> download Progress: total: " + total + "download:" + downloaded);
Long progress = new Long((downloaded*100)/total);
if (this.mListener != null && progress.longValue() != mCacheProgress) {
this.mListener.onStateOrProgress(OTAStateChangeListener.MESSAGE_DOWNLOAD_PROGRESS,
0, progress);
mCacheProgress = progress.longValue();
+ Log.v(TAG, "publishDownloadProgress() ---> mCacheProgress: " + mCacheProgress);
}
}

@@ -256,20 +373,25 @@ public class OTAServerManager {
}

public long getUpgradePackageSize() {
- if (checkURLOK(mConfig.getPackageURL()) == false) {
- Log.e(TAG, "getUpgradePckageSize Failed");
- return -1;
- }
-
- URL url = mConfig.getPackageURL();
- URLConnection con;
- try {
- con = url.openConnection();
- return con.getContentLength();
- } catch (IOException e) {
- e.printStackTrace();
- return -1;
+ if(mConfig.isFileExists() == false){
+ Log.e(TAG, "getUpgradePckageSize() ---> mConfig.getPackageURL()" + mConfig.getPackageURL());
+ if (checkURLOK(mConfig.getPackageURL()) == false) {
+ Log.e(TAG, "getUpgradePckageSize Failed");
+ return -1;
+ }
+ URL url = mConfig.getPackageURL();
+ Log.e(TAG, "getUpgradePckageSize() ---> url" + url);
+ URLConnection con;
+ try {
+ con = url.openConnection();
+ Log.e(TAG, "getUpgradePckageSize() ---> con.getContentLength()" + con.getContentLength());
+ return con.getContentLength();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return -1;
+ }
}
+ return -1;
}

public void onStop() {
@@ -279,29 +401,62 @@ public class OTAServerManager {
public void startDownloadUpgradePackage() {

Log.v(TAG, "startDownloadUpgradePackage()");
-
- if (checkURLOK(mConfig.getPackageURL()) == false) {
- if (this.mListener != null)
- reportDownloadError(OTAStateChangeListener.ERROR_CANNOT_FIND_SERVER);
- return;
+ //Log.v(TAG, "startDownloadUpgradePackage() mConfig.getPackageURL() : " + mConfig.getPackageURL());
+ //Network upgrade
+ if(mConfig.isFileExists() == false){
+ if (checkURLOK(mConfig.getPackageURL()) == false) {
+ Log.v(TAG, "startDownloadUpgradePackage() mConfig.getPackageURL() : " + mConfig.getPackageURL());
+ if (this.mListener != null)
+ reportDownloadError(OTAStateChangeListener.ERROR_CANNOT_FIND_SERVER);
+ return;
+ }
}
-
+ Log.v(TAG, "startDownloadUpgradePackage() ab_slot() : " + ab_slot());
if (ab_slot()) {
- if (getUpdateHeader(mConfig.getPayloadPropertiesURL()) == false) {
- reportCheckingError(OTAStateChangeListener.ERROR_CANNOT_FIND_SERVER);
- Log.v(TAG, "error cannot find server!");
- return;
+ //Network upgrade
+ if(mConfig.isFileExists() == false){
+ if (getUpdateHeader(mConfig.getPayloadPropertiesURL()) == false) {
+ Log.v(TAG, "startDownloadUpgradePackage() mConfig.getPayloadPropertiesURL() : " + mConfig.getPayloadPropertiesURL());
+ reportCheckingError(OTAStateChangeListener.ERROR_CANNOT_FIND_SERVER);
+ Log.v(TAG, "error cannot find server!");
+ return;
+ }
+ }else{
+ //Local upgrade
+ if(getPayloadProperties(mConfig.getUdisk()+"/OTAlocal/payload_properties.txt") == false){
+ Log.v(TAG, "startDownloadUpgradePackage() mConfig.getUdisk() : " + mConfig.getUdisk());
+ reportCheckingError(OTAStateChangeListener.ERROR_CANNOT_FIND_SERVER);
+ Log.v(TAG, "error cannot find server!");
+ return;
+ }
}
-
+
+
+
mWakelock.acquire();
- mUpdateEngine.applyPayload(mConfig.getPackageURL().toString(), 0l, 0l, mUpdateHeader);
+
+
+ if(mConfig.isFileExists() == false){
+ //Network upgrade
+ Log.v(TAG, "___->startDownloadUpgradePackage() mConfig.getPackageURL().toString() : " + mConfig.getPackageURL().toString() + "mUpdateHeader :" + mUpdateHeader);
+ mUpdateEngine.applyPayload(mConfig.getPackageURL().toString(), 0l, 0l, mUpdateHeader);
+ }else{
+ //Local upgrade
+ String packageUrl = mConfig.getUdisk()+"/OTAlocal/payload.bin";
+ Log.v(TAG, "startDownloadUpgradePackage() packageUrl: " + packageUrl.toString());
+ Uri uri = Uri.fromFile(new File(packageUrl));
+ mUpdateEngine.applyPayload(uri.toString(), 0l, 0l, mUpdateHeader);
+ Log.v(TAG, "startDownloadUpgradePackage() uri.toString() : " + uri.toString() + "mUpdateHeader :" + mUpdateHeader);
+ }
mWakelock.release();
return;
}

File targetFile = new File(mUpdatePackageLocation);
+ Log.v(TAG, "startDownloadUpgradePackage() targetFile : " + targetFile);
try {
targetFile.createNewFile();
+ Log.d(TAG, "startDownloadUpgradePackage() targetFile try : " + targetFile.createNewFile());
} catch (IOException e) {
e.printStackTrace();
reportDownloadError(OTAStateChangeListener.ERROR_WRITE_FILE_ERROR);
@@ -322,16 +477,18 @@ public class OTAServerManager {
// download the file
InputStream input = new BufferedInputStream(url.openStream());
OutputStream output = new FileOutputStream(targetFile);
+ Log.d(TAG, "startDownloadUpgradePackage() input : " + input + "output : " + output);

- Log.d(TAG, "file size:" + lengthOfFile);
+ Log.d(TAG, "startDownloadUpgradePackage() ---> file size:" + lengthOfFile);
byte data[] = new byte[100 * 1024];
long total = 0, count;
while ((count = input.read(data)) >= 0 && !mStop) {
total += count;
-
+ Log.d(TAG, "startDownloadUpgradePackage() ---> total:" + total + "data:" + data +"mStop : " + mStop);
// publishing the progress....
publishDownloadProgress(lengthOfFile, total);
output.write(data, 0, (int)count);
+ Log.d(TAG, "startDownloadUpgradePackage() ---> while output:" + output);
}

output.flush();
@@ -339,9 +496,11 @@ public class OTAServerManager {
input.close();
if (this.mListener != null && !mStop)
this.mListener.onStateOrProgress(OTAStateChangeListener.STATE_IN_DOWNLOADING, 0, null);
+ Log.d(TAG, "startDownloadUpgradePackage() ---> OTAStateChangeListener.STATE_IN_DOWNLOADING");
} catch (IOException e) {
e.printStackTrace();
reportDownloadError(OTAStateChangeListener.ERROR_WRITE_FILE_ERROR);
+ Log.d(TAG, "startDownloadUpgradePackage() ---> OTAStateChangeListener.ERROR_WRITE_FILE_ERROR");
} finally {
mWakelock.release();
mWakelock.acquire(2);
@@ -354,29 +513,35 @@ public class OTAServerManager {
if (mListener != null)
mListener.onStateOrProgress(OTAStateChangeListener.MESSAGE_VERIFY_PROGRESS,
0, new Long(progress));
+ Log.d(TAG, "recoveryVerifyListener MESSAGE_VERIFY_PROGRESS ");
}
};

public void startInstallUpgradePackage() {
if (ab_slot()) {
+ Log.d(TAG, "startInstallUpgradePackage() ---> ab_slot() " + ab_slot());
if (mListener != null) {
+ Log.d(TAG, "startInstallUpgradePackage() ---> MESSAGE_WAIT_REBOOT() ");
mListener.onStateOrProgress(OTAStateChangeListener.MESSAGE_WAIT_REBOOT, 0, null);
}
return;
}

File recoveryFile = new File(mUpdatePackageLocation);
-
+ Log.d(TAG, "startInstallUpgradePackage() ---> recoveryFile : " + recoveryFile + "mUpdatePackageLocation:" + mUpdatePackageLocation);
// first verify package
try {
mWakelock.acquire();
RecoverySystem.verifyPackage(recoveryFile, recoveryVerifyListener, null);
+ Log.d(TAG, "startInstallUpgradePackage() ---> RecoverySystem.verifyPackage : " + recoveryFile + "mUpdatePackageLocation:" + mUpdatePackageLocation);
} catch (IOException e1) {
reportInstallError(OTAStateChangeListener.ERROR_PACKAGE_VERIFY_FALIED);
+ Log.d(TAG, "startInstallUpgradePackage() ---> ERROR_PACKAGE_VERIFY_FALIED: ");
e1.printStackTrace();
return;
} catch (GeneralSecurityException e1) {
reportInstallError(OTAStateChangeListener.ERROR_PACKAGE_VERIFY_FALIED);
+ Log.d(TAG, "startInstallUpgradePackage() ---> ERROR_PACKAGE_VERIFY_FALIED: ");
e1.printStackTrace();
return;
} finally {
@@ -387,14 +552,17 @@ public class OTAServerManager {
try {
mWakelock.acquire();
RecoverySystem.installPackage(mContext, recoveryFile);
+ Log.d(TAG, "startInstallUpgradePackage() ---> RecoverySystem.installPackage : " + recoveryFile);
} catch (IOException e) {
// TODO Auto-generated catch block
reportInstallError(OTAStateChangeListener.ERROR_PACKAGE_INSTALL_FAILED);
+ Log.d(TAG, "startInstallUpgradePackage() ---> ERROR_PACKAGE_INSTALL_FAILED ");
e.printStackTrace();
return;
} catch (SecurityException e){
e.printStackTrace();
reportInstallError(OTAStateChangeListener.ERROR_PACKAGE_INSTALL_FAILED);
+ Log.d(TAG, "startInstallUpgradePackage() ---> ERROR_PACKAGE_INSTALL_FAILED ");
return;
} finally {
mWakelock.release();
@@ -408,6 +576,7 @@ public class OTAServerManager {
HttpURLConnection.setFollowRedirects(false);

HttpURLConnection con = (HttpURLConnection) url.openConnection();
+ Log.d(TAG, "checkURLOK() ---> url: " + url);

con.setRequestMethod("HEAD");

@@ -427,26 +596,33 @@ public class OTAServerManager {
// first try to download the property list file. the build.prop of target image.
try {
URL url = configURL;
+ Log.d(TAG, "getTargetPackagePropertyList() ---> url: " + url + "configURL :" + configURL);
url.openConnection();
InputStream reader = url.openStream();
+ Log.d(TAG, "getTargetPackagePropertyList() ---> reader: " + reader);
ByteArrayOutputStream writer = new ByteArrayOutputStream();
+ Log.d(TAG, "getTargetPackagePropertyList() ---> writer: " + writer);
byte[] buffer = new byte[153600];
+ Log.d(TAG, "getTargetPackagePropertyList() ---> buffer: " + buffer);
int totalBufRead = 0;
int bytesRead;

Log.d(TAG, "start download: " + url.toString() + "to buffer");

while ((bytesRead = reader.read(buffer)) > 0) {
+ Log.d(TAG, "getTargetPackagePropertyList() ---> bytesRead before: " + bytesRead);
writer.write(buffer, 0, bytesRead);
+ Log.d(TAG, "getTargetPackagePropertyList() ---> bytesRead later: " + bytesRead + "writer : " + writer);
buffer = new byte[153600];
totalBufRead += bytesRead;
+ Log.d(TAG, "getTargetPackagePropertyList() ---> totalBufRead: " + totalBufRead);
}

Log.d(TAG, "download finish:" + (new Integer(totalBufRead).toString()) + "bytes download");
reader.close();

BuildPropParser parser = new BuildPropParser(writer, mContext);
-
+ Log.d(TAG, "getTargetPackagePropertyList() parser:" + parser);
return parser;

} catch (IOException e) {
@@ -464,10 +640,12 @@ public class OTAServerManager {
}

public boolean ab_slot() {
+ Log.d(TAG, "manager ab_slot() mConfig.ab_slot():" + mConfig.ab_slot());
return mConfig.ab_slot();
}

public void setDiffUpgrade() {
+ Log.d(TAG, "manager setDiffUpgrade() mConfig.setDiffUpgrade()");
mConfig.setDiffUpgrade();
}
}
diff --git a/FSLOta/src/com/fsl/android/ota/OtaAppActivity.java b/FSLOta/src/com/fsl/android/ota/OtaAppActivity.java
old mode 100644
new mode 100755
index 6554c9e..acdd11c
--- a/FSLOta/src/com/fsl/android/ota/OtaAppActivity.java
+++ b/FSLOta/src/com/fsl/android/ota/OtaAppActivity.java
@@ -64,6 +64,7 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
public void handleMessage(Message msg) {
switch (msg.what) {
case IDLE:
+ Log.d(TAG, "MainHandler : IDLE");
mVersionTextView.setVisibility(View.INVISIBLE);
mDownloadProgress.setVisibility(View.INVISIBLE);
mUpgradeButton.setVisibility(View.INVISIBLE);
@@ -71,10 +72,12 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
mRebootButton.setVisibility(View.INVISIBLE);
break;
case CHECKED:
+ Log.d(TAG, "MainHandler : CHECKED");
mVersionTextView.setVisibility(View.VISIBLE);
mSpinner.setVisibility(View.INVISIBLE);
break;
case DOWNLOADING:
+ Log.d(TAG, "MainHandler : DOWNLOADING");
mVersionTextView.setVisibility(View.INVISIBLE);
mUpgradeButton.setVisibility(View.INVISIBLE);
mDiffUpgradeButton.setVisibility(View.INVISIBLE);
@@ -83,15 +86,19 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
mDownloadProgress.setVisibility(View.VISIBLE);
break;
case WIFI_NOT_AVALIBLE:
+ Log.d(TAG, "MainHandler : WIFI_NOT_AVALIBLE");
mMessageTextView.setText(getText(R.string.error_needs_wifi));
break;
case CANNOT_FIND_SERVER:
+ Log.d(TAG, "MainHandler : CANNOT_FIND_SERVER");
mMessageTextView.setText(getText(R.string.error_cannot_connect_server));
break;
case WRITE_FILE_ERROR:
+ Log.d(TAG, "MainHandler : WRITE_FILE_ERROR");
mMessageTextView.setText(getText(R.string.error_write_file));
break;
case WAIT_REBOOT:
+ Log.d(TAG, "MainHandler : WAIT_REBOOT");
mDownloadProgress.setVisibility(View.INVISIBLE);
mMessageTextView.setText(getText(R.string.wait_for_reboot));
mRebootButton.setVisibility(View.VISIBLE);
@@ -107,7 +114,8 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

- Log.d(TAG, "OTAAppActivity : onCreate");
+ Log.d(TAG, "<----------------OTAAppActivity : onCreate ---------------->");
+ Log.d(TAG, "<----onCreate target-files-packag------->");
setContentView(R.layout.main);
(mUpgradeButton = (Button) findViewById(R.id.upgrade_button))
.setOnClickListener(mUpgradeListener);
@@ -212,25 +220,33 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
Log.v(TAG, "onStateOrProgress: " + "message: " + message + " error:" + error + " info: " + info );
switch (message) {
case STATE_IN_CHECKED:
+ Log.v(TAG, "onStateOrProgress: STATE_IN_CHECKED");
onStateChangeUI(message);
mState = STATE_IN_CHECKED;
+ Log.v(TAG, "onStateOrProgress: STATE_IN_CHECKED mState :" +mState);
onStateInChecked(error, info);
break;
case STATE_IN_DOWNLOADING:
+ Log.v(TAG, "onStateOrProgress: STATE_IN_DOWNLOADING");
onStateChangeUI(message);
mState = STATE_IN_DOWNLOADING;
+ Log.v(TAG, "onStateOrProgress: STATE_IN_DOWNLOADING mState :" +mState);
onStateDownload(error, info);
break;
case STATE_IN_UPGRADING:
+ Log.v(TAG, "onStateOrProgress: STATE_IN_UPGRADING");
onStateChangeUI(message);
mState = STATE_IN_UPGRADING;
+ Log.v(TAG, "onStateOrProgress: STATE_IN_UPGRADING mState :" +mState);
onStateUpgrade(error, info);
break;
case MESSAGE_DOWNLOAD_PROGRESS:
case MESSAGE_VERIFY_PROGRESS:
+ Log.v(TAG, "onStateOrProgress: MESSAGE_DOWNLOAD_PROGRESS MESSAGE_VERIFY_PROGRESS");
onProgress(message, error, info);
break;
case MESSAGE_WAIT_REBOOT:
+ Log.v(TAG, "onStateOrProgress: MESSAGE_WAIT_REBOOT");
mHandler.sendEmptyMessageDelayed(WAIT_REBOOT,0);
break;
}
@@ -242,13 +258,17 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
void onStateChangeUI(int newstate)
{
mState = newstate;
+ Log.d(TAG, "onStateChangeUI() ---> mState : " + mState + "newstate : " + newstate);
if (newstate == STATE_IN_IDLE) {
mHandler.sendEmptyMessageDelayed(IDLE,0);
+ Log.d(TAG, "onStateChangeUI() ---> STATE_IN_IDLE newstate : " + newstate);
}else if (newstate == STATE_IN_CHECKED) {
mHandler.sendEmptyMessageDelayed(CHECKED,0);
+ Log.d(TAG, "onStateChangeUI() ---> STATE_IN_CHECKED newstate : " + newstate);
}else if (newstate == STATE_IN_DOWNLOADING) {
// from start download, it start hide the version again.
mHandler.sendEmptyMessageDelayed(DOWNLOADING,0);
+ Log.d(TAG, "onStateChangeUI() ---> STATE_IN_DOWNLOADING newstate : " + newstate);
}
}

@@ -264,6 +284,7 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
// meet error in Verify, fall back to check.
// TODO which state should ?
} else if (error == ERROR_PACKAGE_INSTALL_FAILED) {
+ Log.d(TAG, "onStateUpgrade() ---> ERROR_PACKAGE_INSTALL_FAILED ");
mMessageTextView.post(new Runnable() {
public void run() {
mMessageTextView.setText(getText(R.string.error_package_install_failed));
@@ -282,6 +303,7 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat

Log.v(TAG, "progress : " + progress);
if (message == MESSAGE_DOWNLOAD_PROGRESS) {
+ Log.d(TAG, "onProgress() ---> MESSAGE_DOWNLOAD_PROGRESS ");
onStateChangeUI(STATE_IN_DOWNLOADING);
mMessageTextView.post(new Runnable() {

@@ -301,6 +323,7 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat

void onStateDownload(int error, Object info) {
if (error == ERROR_CANNOT_FIND_SERVER) {
+ Log.d(TAG, "onStateDownload() ---> ERROR_CANNOT_FIND_SERVER ");
// in this case, the build.prop already found but the server don't have upgrade package
// report as "Server Error: Not have upgrade package";
mMessageTextView.post(new Runnable() {
@@ -310,6 +333,7 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
}
});
} else if (error == ERROR_WRITE_FILE_ERROR) {
+ Log.d(TAG, "onStateDownload() ---> ERROR_WRITE_FILE_ERROR ");
mMessageTextView.post(new Runnable() {

public void run() {
@@ -321,6 +345,7 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
}

if (error == 0) {
+ Log.d(TAG, "onStateDownload() ---> error == 0 ");
// success download, let try to start with install package...
// we should already in another thread, no needs to create a thread.
mOTAManager.startInstallUpgradePackage();
@@ -336,6 +361,7 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
}

void onStateInChecked(int error, Object info) {
+ Log.d(TAG, "onStateInChecked() ---> error --------> " + error);
mSpinner.post(new Runnable() {
public void run() {
mSpinner.setVisibility(View.INVISIBLE);
@@ -343,6 +369,7 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
});

if (error == 0) {
+ Log.d(TAG, "onStateInChecked() ---> error == 0 ");
// return no error, usually means have a version info from remote server, release name is in @info
// needs check here whether the local version is newer then remote version
if (mOTAManager.compareLocalVersionToServer() == OTAServerManager.OtaTypeSelect.NONE) {
@@ -356,7 +383,9 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat

} else {
final BuildPropParser parser = (BuildPropParser) info;
+ Log.d(TAG, "onStateInChecked() ---> parser" + parser);
final long bytes = mOTAManager.getUpgradePackageSize();
+ Log.d(TAG, "onStateInChecked() ---> bytes" + bytes);
mMessageTextView.post(new Runnable() {
public void run() {
onStateChangeUI(STATE_IN_CHECKED);
@@ -368,18 +397,23 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
parser.getProp("ro.build.id") + "\n" +
getText(R.string.full_version) + ":" +
parser.getProp("ro.build.description") + "\n");
+ Log.d(TAG, "onStateInChecked() ---> bytes > 0 && parser != null version :" + parser.getProp("ro.build.id") + parser.getProp("ro.build.description"));
}
mUpgradeButton.setVisibility(View.VISIBLE);
if (mOTAManager.ab_slot()) {
+ Log.d(TAG, "onStateInChecked() ---> mOTAManager.ab_slot() :" +mOTAManager.ab_slot());
mDiffUpgradeButton.setVisibility(View.VISIBLE);
}
if (mOTAManager.compareLocalVersionToServer() == OTAServerManager.OtaTypeSelect.BOTH_OTA) {
+ Log.d(TAG, "onStateInChecked() ---> mOTAManager.compareLocalVersionToServer() == OTAServerManager.OtaTypeSelect.BOTH_OTA");
mUpgradeButton.setEnabled(true);
mDiffUpgradeButton.setEnabled(true);
} else if (mOTAManager.compareLocalVersionToServer() == OTAServerManager.OtaTypeSelect.FULL_OTA) {
+ Log.d(TAG, "onStateInChecked() ---> mOTAManager.compareLocalVersionToServer() == OTAServerManager.OtaTypeSelect.FULL_OTA");
mUpgradeButton.setEnabled(true);
mDiffUpgradeButton.setEnabled(false);
} else if (mOTAManager.compareLocalVersionToServer() == OTAServerManager.OtaTypeSelect.DIFF_OTA) {
+ Log.d(TAG, "onStateInChecked() ---> mOTAManager.compareLocalVersionToServer() == OTAServerManager.OtaTypeSelect.DIFF_OTA");
mUpgradeButton.setEnabled(false);
mDiffUpgradeButton.setEnabled(true);
}
@@ -387,10 +421,13 @@ public class OtaAppActivity extends Activity implements OTAServerManager.OTAStat
});
}
} else if (error == ERROR_WIFI_NOT_AVALIBLE) {
+ Log.d(TAG, "onStateInChecked() ---> error == ERROR_WIFI_NOT_AVALIBLE");
mHandler.sendEmptyMessageDelayed(WIFI_NOT_AVALIBLE,0);
} else if (error == ERROR_CANNOT_FIND_SERVER) {
+ Log.d(TAG, "onStateInChecked() ---> error == ERROR_CANNOT_FIND_SERVER");
mHandler.sendEmptyMessageDelayed(CANNOT_FIND_SERVER,0);
} else if (error == ERROR_WRITE_FILE_ERROR ) {
+ Log.d(TAG, "onStateInChecked() ---> error == ERROR_WRITE_FILE_ERROR");
mHandler.sendEmptyMessageDelayed(WRITE_FILE_ERROR,0);
}
}
--
1.9.1

0 Kudos
Reply

1,973 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello,

The i.MX8QXP it is in Beta Phase,  since the device it is still under pre-production, so the BSP it is not completed, and when you are compiling OTA, all the components are separated build.  Uboot + Kernel + Android.

Have a nice day!

0 Kudos
Reply