SlicePurchaseController only unregister receiver if it exists
When entitlement checks fail, we throttle the request before the
broadcast receiver has been created/registered and before creating a
purchase timeout. unregister the broadcast receiver and remove the timer
only if it has been created/exists to prevent a NPE.
Update unit tests to actually send the broadcast and capture the
broadcast receiver.
Test: manual
Test: atest SlicePurchaseControllerTest
Bug: 257317287
Change-Id: Ie7dfda4d62cebc8aad94afc0c91547a9aed11b5a
2 files changed