author | Ting Li <ting.li@amlogic.com> | 2014-08-21 06:40:26 (GMT) |
---|---|---|
committer | Sandy lUo <sandy.luo@amlogic.com> | 2014-08-21 11:30:35 (GMT) |
commit | 8f05c9b8b0806a8f579f711073866c7dd5639722 (patch) | |
tree | 16272bf5049b8c5783ba013ceeaf48930b11dd4d | |
parent | a9764c5fa947b9f5da17b4cf66d204394261efb5 (diff) | |
download | OTAUpgrade2-8f05c9b8b0806a8f579f711073866c7dd5639722.zip OTAUpgrade2-8f05c9b8b0806a8f579f711073866c7dd5639722.tar.gz OTAUpgrade2-8f05c9b8b0806a8f579f711073866c7dd5639722.tar.bz2 |
pd#96391 fix bug of cache-recovery directory is not exist when update with usb-burningup
Change-Id: I1205bfa9be89d13beb836a7651c794287a12bdd7
-rwxr-xr-x | src/com/amlapp/update/otaupgrade/MainActivity.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/amlapp/update/otaupgrade/MainActivity.java b/src/com/amlapp/update/otaupgrade/MainActivity.java index 9772c22..37df8b7 100755 --- a/src/com/amlapp/update/otaupgrade/MainActivity.java +++ b/src/com/amlapp/update/otaupgrade/MainActivity.java @@ -291,6 +291,17 @@ public class MainActivity extends Activity implements OnClickListener { return false;
}
file = new File("/cache/recovery/command");
+ try{
+ File parent = file.getParentFile();
+ if(!parent.exists()){
+ parent.mkdirs();
+ }
+ if(!file.exists()){
+ file.createNewFile();
+ }
+ }catch(IOException e){
+ e.printStackTrace();
+ }
res += "--update_package=";
if (Environment.MEDIA_MOUNTED.equals(Environment
.getExternalStorage2State()) && FileSelector.isSdcard(fullpath)) {
|