Fix a bug in RuleIndexingController where StackOverflowError occurs
A map with a single entry passed into searchKeysRangeContainingKey()
will lead to StackOverflowError due to infinite recursion. There is
a possibility that it could happen if the indexing file is corrupted
and has a few bytes.
This fix adds a termination condition of recursion to break out
and a check to make sure the indexing file is not corrupted.
Test: atest FrameworksServicesTests:RuleIndexingControllerTest
Bug: 178185562
Change-Id: Ic79584d7fabd56ae298d452060ce8d588bc02d21
2 files changed