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
|
@ -92,7 +92,7 @@ class HwApi : public Vibrator::HwApi, private HwApiBase {
|
|||
bool setRedc(std::string value) override { return set(value, &mRedc); }
|
||||
bool setQ(std::string value) override { return set(value, &mQ); }
|
||||
bool getEffectCount(uint32_t *value) override { return get(value, &mEffectCount); }
|
||||
bool hasEffectBrakingTimeBank() override { return mEffectBrakingTimeBank.is_open(); }
|
||||
bool hasEffectBrakingTimeBank() override { return has(mEffectBrakingTimeBank); }
|
||||
bool setEffectBrakingTimeBank(uint32_t value) override {
|
||||
return set(value, &mEffectBrakingTimeBank);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue