Simplify carrier service binding and make it more robust.

-Change bind() to rebind(), and have it ensure the binding is always
in the right state. It will drop the binding if it's unneeded,
establish a new binding if the parameters have changed, or else leave
the existing binding alone.

-Use a PackageMonitor instead of a BroadcastReceiver as a minor
simplification. Handle add/remove/update as before.

-Handle package changes by rebinding.

-Handle package force stops by explicitly unbinding and rebinding.

-Remove the bind timeout. This was designed to catch cases where
onBind returned null, but leaving the binding isn't actually harmful,
and having a timeout introduces risk that the binding is dropped when
it is legitimately taking a while to establish.

-Fix log tag which is > 23 characters and thus invalid.

Bug: 28897103
Change-Id: I2e9311588dc378bfb3bc221f2149d3e2d27ce351
1 file changed
tree: 2df50c7b41dea99757cde03b524806feefcfa704
  1. src/
  2. tests/
  3. tools/
  4. Android.mk
  5. CleanSpec.mk
  6. README.txt