在adb logcat 中有打印“ForceUnmount failed: Device or resource busy”,这个打印是在哪个文件出现的
时间: 2024-02-12 08:04:10 浏览: 83
android-adb-logcat-enhanced:增强的“ adb logcat”命令,使用过滤器“包名称”打印日志
在Android系统中,可以使用grep命令在源代码中搜索指定的文本。对于你提到的打印信息“ForceUnmount failed: Device or resource busy”,可以通过以下命令在Android源代码中搜索:
```
grep -r "ForceUnmount failed: Device or resource busy" .
```
其中,`.`表示从当前目录开始搜索,`-r`表示递归搜索所有子目录。
经过搜索,可以发现该打印信息在`frameworks/native/services/surfaceflinger/DisplayDevice.cpp`文件中的以下位置出现:
```cpp
if (res & static_cast<int32_t>(Error::NOT_UNIQUE)) {
// This may have happened if the display was already removed but the
// SurfaceFlinger still had a handle on it. Try to force the unmount.
LOG(WARNING) << "doGetDisplayTokenLocked(" << name << "): display not "
"unique, forcing unmount (old type=0x" << std::hex << type
<< std::dec << ")";
if (mState == State::REMOVED) {
res = NAME_NOT_FOUND;
} else {
res = forceRemoveDisplayLocked(token);
}
if (res != NO_ERROR) {
ALOGW("ForceUnmount failed: %d", res);
}
}
```
因此,该打印信息是在`DisplayDevice.cpp`文件中出现的。
阅读全文