summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlamefire <alex@grundis.de>2014-01-20 21:21:59 +0100
committerFlamefire <alex@grundis.de>2014-01-28 17:07:02 +0100
commit1a71660f30201b839a2d857eeb3d2baf8809bdef (patch)
tree2cd85770e042f2c3079dfc5cad2fba92301b1662
parent080517da784376126c7122d7271fff5fc67724a1 (diff)
downloadandroid_system_vold-1a71660f30201b839a2d857eeb3d2baf8809bdef.tar.gz
android_system_vold-1a71660f30201b839a2d857eeb3d2baf8809bdef.tar.bz2
android_system_vold-1a71660f30201b839a2d857eeb3d2baf8809bdef.zip
Do not show disk errors if they are expected.
An error shows up during boot if vold disk has different majors. On some devices this is expected and set in config, so do not confuse users and skip the error (as it ain't one) Bonus: Better log for duplicate state. It was useless... Change-Id: Ibc047729432e2f6746a9439b828d1443951ade1f
-rw-r--r--DirectVolume.cpp11
-rw-r--r--DirectVolume.h4
-rw-r--r--Volume.cpp2
3 files changed, 13 insertions, 4 deletions
diff --git a/DirectVolume.cpp b/DirectVolume.cpp
index 57dc555..8ed2a51 100644
--- a/DirectVolume.cpp
+++ b/DirectVolume.cpp
@@ -191,7 +191,9 @@ void DirectVolume::handleDiskAdded(const char *devpath, NetlinkEvent *evt) {
#ifdef PARTITION_DEBUG
SLOGD("Dv::diskIns - No partitions - good to go son!");
#endif
- setState(Volume::State_Idle);
+ // Do not leave idle state if already in (avoids warnings)
+ if (getState() != Volume::State_Idle)
+ setState(Volume::State_Idle);
} else {
#ifdef PARTITION_DEBUG
SLOGD("Dv::diskIns - waiting for %d partitions (mask 0x%x)",
@@ -228,13 +230,16 @@ void DirectVolume::handlePartitionAdded(const char *devpath, NetlinkEvent *evt)
}
if (major != mDiskMajor) {
- SLOGE("Partition '%s' has a different major than its disk!", devpath);
#ifdef VOLD_DISC_HAS_MULTIPLE_MAJORS
ValuePair vp;
vp.major = major;
vp.part_num = part_num;
badPartitions.push_back(vp);
-#else
+ // Errors with internal volume are expected, so do not show them
+ if(strcmp(getLabel(), VOLD_INTERNAL_VOLUME))
+#endif
+ SLOGE("Partition '%s' of '%s' has a different major than its disk!", devpath, getLabel());
+#ifndef VOLD_DISC_HAS_MULTIPLE_MAJORS
return;
#endif
}
diff --git a/DirectVolume.h b/DirectVolume.h
index 396ac91..ab95871 100644
--- a/DirectVolume.h
+++ b/DirectVolume.h
@@ -25,6 +25,10 @@
#define VOLD_MAX_PARTITIONS 32
#endif
+#if defined(VOLD_DISC_HAS_MULTIPLE_MAJORS) && !defined(VOLD_INTERNAL_VOLUME)
+#define VOLD_INTERNAL_VOLUME "sdcard0"
+#endif
+
typedef android::List<char *> PathCollection;
class DirectVolume : public Volume {
diff --git a/Volume.cpp b/Volume.cpp
index 2535e6a..ecf5b0f 100644
--- a/Volume.cpp
+++ b/Volume.cpp
@@ -219,7 +219,7 @@ void Volume::setState(int state) {
int oldState = mState;
if (oldState == state) {
- SLOGW("Duplicate state (%d)\n", state);
+ SLOGW("Volume %s: Duplicate state (%d)\n", mLabel, state);
return;
}