[WifiCoex] Avoid division by 0 when calculating overlap percent
CoexUtils#getOverlapPercent() should avoid division by 0 when the victim
bandwidth is 0. This was caused by an issue in
get2gHarmonicCoexUnsafeChannels passing in the upper/lower frequencies
of invalid channel 0 or channel 15, which resulted in invalid
frequencies in getOverlapPercent(). As an extra precaution, the division
by 0 should be explicitly avoided by returning 0 overlap in this case.
Bug: 188196290
Test: atest CoexUtilsTest
Change-Id: Ic4cc513a526c74102d76ff7386a441aaf9006ba3
2 files changed