Skip to content
Commit 7581efdb authored by Nathan Harold's avatar Nathan Harold
Browse files

Add Executor Support for PhoneStateListener

Support an Executor so that PhoneStateListener
can invoke callbacks not only on a user's preferred
Looper but also on a preferred Handler or in another
thread management scheme.

PhoneStateListener uses an odd pattern for its API,
so to support the historical use cases of having the
internal callback instance be instantiated during
object construction, the Executor needs to be passed
in to the PhoneStateListener during construction. This
also permits the listen() method in TelephonyManager to
avoid odd situations of having a version with an
Executor be passed in when requesting to stop listening
for events.

Bug: 118350385
Test: atest PhoneStateListenerTest
      atest PhoneStateListenerExecutorTest
Change-Id: I8eeb2e156f6d67d192d17586e6aa5579ff6d675d
parent b499af86
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment