Fix race in hidden_api.h

The hidden API decision logic can dedupe warnings by changing the
access flags of a previously warned about method to whitelist, thus
exiting early on the next attempt to access it. This logic had a race
in it, because it would decode the flags, make a decision and then
decode them again when printing a warning. If another thread changed
the flags in between, the warning would say "whitelist".

Change the code so that the hidden API flags are decoded only once.
This may still result in multiple warnings about the same API, but at
least the messages will be consistent.

Bug: 78327881
Bug: 64382372
Test: none
Merged-In: I956dd56536bdfce492845e6a90fdcbe29c2676b5
Change-Id: I956dd56536bdfce492845e6a90fdcbe29c2676b5
(cherry picked from commit b8c6619f16348403c3933d9e425b4b8c80af5389)
2 files changed