在adb logcat 中有打印“ForceUnmount failed: Device or resource busy”,这个打印是在哪个文件出现的
时间: 2024-02-12 20:04:09 浏览: 23
adb: CreateFileW 'nul' failed: 系统找不到指定的文件,studio连接不上手机-附件资源
在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`文件中出现的。
阅读全文