Commit d10639e9 authored by Kenji Bungo's avatar Kenji Bungo
Browse files

match binder and handler delete functions. make SystemProperty delete the last...

match binder and handler delete functions. make SystemProperty delete the last item, make logging consistent and obvious for delete attempts.
parent 93682c92
......@@ -150,7 +150,7 @@ public class RKUpdateService extends Service {
public void deletePackage(String path) {
if (DEBUG)Log.d(TAG,"try to deletePackage...");
SystemProperties.set("debug.rm.update.img", "true");
File f = new File(path);
if (path.startsWith(DATA_ROOT) || path.startsWith(FLASH_ROOT)){
......@@ -164,11 +164,14 @@ public class RKUpdateService extends Service {
}
if(f.exists()) {
f.delete();
if (DEBUG)Log.d(TAG, "delete complete! path=" + path);
boolean success = f.delete();
if (success) Log.i(TAG, "Delete success! path=" + path);
else Log.i(TAG, "Delete failed! path="+ path);
}else {
if (DEBUG)Log.d(TAG, "path=" + path + " ,file not exists!");
Log.i(TAG, "Delete failed! File does not exist. path=" + path);
}
//catch for if file cannot be found or delete fails.
SystemProperties.set("debug.rm.update.img", "true");
}
public void unLockWorkHandler() {
......@@ -384,13 +387,15 @@ public class RKUpdateService extends Service {
if(mIsNeedDeletePackage) {
LOG("execute COMMAND_DELETE_UPDATEPACKAGE...");
File f = new File(mLastUpdatePath);
if(f.exists()) {
f.delete();
LOG("delete complete! path=" + mLastUpdatePath);
if(f.exists()) {
boolean success = f.delete();
if (success)Log.i(TAG, "Delete success! path=" + mLastUpdatePath);
else Log.i(TAG, "Delete failed! path="+ mLastUpdatePath);
}else {
LOG("path=" + mLastUpdatePath + " ,file not exists!");
Log.i(TAG, "Delete failed! File does not exist. path=" + mLastUpdatePath);
}
//catch for if file cannot be found or delete fails.
SystemProperties.set("debug.rm.update.img", "true");
mIsNeedDeletePackage = false;
mWorkHandleLocked = false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment