vibrator: common: Check whether file is opened correctly
- Add compile-time type checking inside the has() function to ensure it receives the correct type. - Add is_open() inside the has() function. Bug: 350911314 Test: alarm, ringtone vibrations Test: keyboard vibrations Test: idlcli commands Test: atest PTS, CTS, VTS Flag: EXEMPT bugfix Change-Id: Ifa8f197f6f4b25d51b2edaf6fec27a086bd4f73c
This commit is contained in:
parent
0dcee74707
commit
1d29f93863
3 changed files with 14 additions and 6 deletions
|
@ -40,10 +40,6 @@ void HwApiBase::saveName(const std::string &name, const std::ios *stream) {
|
|||
mNames[stream] = name;
|
||||
}
|
||||
|
||||
bool HwApiBase::has(const std::ios &stream) {
|
||||
return !!stream;
|
||||
}
|
||||
|
||||
void HwApiBase::debug(int fd) {
|
||||
dprintf(fd, "Kernel:\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue