commit | 380ee5525304812ef2559730e6bb30d0ee449d4e | [log] [tgz] |
---|---|---|
author | Yu Shan <shanyu@google.com> | Fri Apr 15 14:36:54 2022 -0700 |
committer | Yu Shan <shanyu@google.com> | Tue Apr 19 23:53:22 2022 +0000 |
tree | c1a3c514635b97240b451b78181f6cf0140cf684 | |
parent | 70abad5696c5c157ccb584b0e14efcc00784fd4b [diff] |
Fix unregisterListener bug in CarPropertyService. There is a bug in CarPropertyService that might cause property unsubscribed from PropertyHalService when unregisterListener is called even when there are other listeners for the property. This bug is due to using upateMaxRate == 0 to check whether there are other clients. However, sampleRate might be 0 for on_change event so even if updateMaxRate is 0, it doesn't mean the client array is empty. Test: Add unit test in CarPropertyServiceTest Bug: 229327788 Change-Id: Iff5d18a2f5d05ea9be9b8af28908026306a7a99e
Native (C++) code format is required to be compatible with .clang-format file. Run
git clang-format --style=file --extension='h,cpp,cc' HEAD~
Note that clang-format is not desirable for Android java files. Therefore the command line above is limited to specific extensions.