When deleting a db file,
Context.deleteDatabase() has to be called instead of File.delete()
to guarantee all db related files
like journal, wal, shm, etc are deleted together.
Signed-off-by: jangwon.lee<jangwon.lee@lge.com>
Change-Id: I3c3d7dfa13ffbe709ab7d8a5c7cfe6cfa2864fea
diff --git a/media/java/android/mtp/MtpDatabase.java b/media/java/android/mtp/MtpDatabase.java
old mode 100644
new mode 100755
index 487585e..bd318c2
--- a/media/java/android/mtp/MtpDatabase.java
+++ b/media/java/android/mtp/MtpDatabase.java
@@ -218,7 +218,7 @@
if (c != null) c.close();
if (db != null) db.close();
}
- databaseFile.delete();
+ context.deleteDatabase(devicePropertiesName);
}
}