Fix YAFFS2 support auto-detection logic.
A simpler algorithm is to look at the API level.
BUG=15732708
Change-Id: Ifdc5e458735db8734a631835ed593fda85853866
diff --git a/android/main.c b/android/main.c
index 9e2a7fb..9cba680 100644
--- a/android/main.c
+++ b/android/main.c
@@ -478,12 +478,13 @@
// Auto-detect YAFFS2 partition support if needed.
if (androidHwConfig_getKernelYaffs2Support(hw) < 0) {
+ // Essentially, anything before API level 20 supports Yaffs2
const char* newYaffs2Support = "no";
- if (kernelType == KERNEL_TYPE_3_10_OR_ABOVE) {
- D("Auto-detect: Kernel does not support YAFFS2 partitions.");
- } else {
- D("Auto-detect: Kernel does support YAFFS2 partitions.");
+ if (avdInfo_getApiLevel(avd) < 20) {
newYaffs2Support = "yes";
+ D("Auto-detect: Kernel does support YAFFS2 partitions.");
+ } else {
+ D("Auto-detect: Kernel does not support YAFFS2 partitions.");
}
AFREE(hw->kernel_supportsYaffs2);
hw->kernel_supportsYaffs2 = ASTRDUP(newYaffs2Support);