Add entitlement capability for satellite
Query the entitlement server to receive entitlement configuration values for a satellite service and pass the response to the SatelliteController.
The following events can trigger a query: 1.Internet connected 2. CarrierConfigChanged.
If the query is possible (satellite_entitlement_supported_bool is true and refresh status is true), the query will be attempted.
If the airplane mode turn on and off, it will work like the first query.
If the 500 response is received, no retry until the next trigger event occurs.
If the 503 response with Retry-After header, retry is attempted according to the value in the Retry-After header up to MAX_RETRY_COUNT.
In the other cases, it performs an exponential backoff process up to MAX_RETRY_COUNT.
If the satellite configuration is still not received after 5 retries, the satellite is disabled. After the refresh time, can be queried again.
If the Internet connection is lost during the ExponentialBackoff, the ExponentialBackoff is stopped. When the Internet connection is restored, can start from the query again.
Bug: 306670992
Test: atest SatelliteControllerTest
Test: atest TeleServiceTests
Test: Manually test with mock entitlement server for satellite (ag/25356673).
1. Check if a query is triggered when data is connected or CarrierConfigChanged is received.
2. Check if the first query's response with a satellite service enabled triggers internally satellite enabled.
3. Check if a query is not made before the refresh time.
4. Check if the next query's response with a satellite service disabled triggers internally satellite disabled.
Test: Manual test - verified the ExponentialBackoff is performed up to MAX_RETRY_COUNT times.
1. Use a SIM that does not connect to the entitlement server
2. Check the retry up to MAX_RETRY_COUNT times.
3. During the ExponentialBackoff, Internet is disconnected then stop the ExponentialBackoff and reset the retry count. Internet connection is restored then trigger the query.
Test: Manual test - Internet, MO/MT call , MO/MT SMS and MO/MT MMS worked well.
Test: Manual test - Error response test with test server app and temp CL ( temp cl ag/25836650 and test server app ag/25356673 )
1. If the 500 response is received, no retry until the next trigger event occurs.
2. If the 503 response with Retry-After header, retry is attempted according to the value in the Retry-After header up to MAX_RETRY_COUNT.
3. In other cases, it performs an exponential backoff process.
Change-Id: I2f9aab83c94e584c6e56b1ef094f1e6a89c7641b
8 files changed