summaryrefslogtreecommitdiff
authorTing Li <ting.li@amlogic.com>2018-01-04 11:04:54 (GMT)
committer Ting Li <ting.li@amlogic.com>2018-01-08 08:00:18 (GMT)
commitc3bce37da72f48ea963719d56b0e1cea54511855 (patch)
treeb0ed141e092e31bacfd9fff3ca10315acc7687d1
parentc75898a9b76be3590f0ff9189f9f02a135e02a3a (diff)
downloadOTAUpgrade2-c3bce37da72f48ea963719d56b0e1cea54511855.zip
OTAUpgrade2-c3bce37da72f48ea963719d56b0e1cea54511855.tar.gz
OTAUpgrade2-c3bce37da72f48ea963719d56b0e1cea54511855.tar.bz2
OTA: remove wipe data and wipe media since recovery has no function[1/1]
PD# 158029 remove wipe data and wipe media since recovery has no function Change-Id: Iffe334e4da68dda7a085dfd1805f3af4954ed767
Diffstat
-rw-r--r--res/values/config.xml7
-rw-r--r--src/com/droidlogic/otaupgrade/MainActivity.java11
2 files changed, 14 insertions, 4 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 8e6ce94..35dfcd9 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -1,3 +1,4 @@
-
- <resources>
- </resources>
+<?xml version="1.0" encoding="utf-8"?>
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <bool name="device_custom_recovery">true</bool>
+</resources>
diff --git a/src/com/droidlogic/otaupgrade/MainActivity.java b/src/com/droidlogic/otaupgrade/MainActivity.java
index b5dae44..410d67a 100644
--- a/src/com/droidlogic/otaupgrade/MainActivity.java
+++ b/src/com/droidlogic/otaupgrade/MainActivity.java
@@ -96,6 +96,12 @@ public class MainActivity extends Activity implements OnClickListener {
mRestoreBtn = (Button) findViewById(R.id.restore);
mWipeDate = (CheckBox) findViewById(R.id.wipedata);
mWipeMedia = (CheckBox) findViewById(R.id.wipemedia);
+ boolean recoveryUsd = getResources().getBoolean(R.bool.device_custom_recovery);
+
+ if (!recoveryUsd) {
+ mWipeDate.setVisibility(View.GONE);
+ mWipeMedia.setVisibility(View.GONE);
+ }
//mWipeCache = (CheckBox) findViewById(R.id.wipecache);
filename = (TextView) findViewById(R.id.update_file_name);
filepath = (TextView) findViewById(R.id.update_full_name);
@@ -293,7 +299,10 @@ public class MainActivity extends Activity implements OnClickListener {
String fullname = filepath.getText().toString();
if ( fullname.lastIndexOf("/") > 0 && (filename != null) && (filename.length() > 0)) {
- UpdateMode = mPreference.createAmlScript(fullname,mWipeDate.isChecked(),mWipeMedia.isChecked());
+ if (mWipeDate == null)
+ UpdateMode = mPreference.createAmlScript(fullname, false, false);
+ else
+ UpdateMode = mPreference.createAmlScript(fullname,mWipeDate.isChecked(),mWipeMedia.isChecked());
UpdateDialog(fullname);
} else {
Toast.makeText(this, getString(R.string.file_not_exist), 2000).show();