Add timeout for emergency calls

Currently connection managers are only able to route
emergency calls if the call can't be placed by the
normal phone account first.

Unfortunately this strategy only works for "fake" emergency
calls (for example when you set a fake number using
ril.ecclist).

When actually dialing "911" the call doesn't disconnect
even if there's no service. This means that the connection
manager never gets a chance to handle the call.

To fix this issue we're adding a timeout for emergency calls
if a connection manager is present. If after 25 seconds
the call is not yet active then we'll disconnect the call
and route it through the connection manager. The timeout
length is 60 seconds if the device is in airplane mode.
Both timeout values can be modified using config values.

To limit the impact of this change we've also added the
following extra condition:
  - only use a connection manager if we have wifi
    connectivity but no cellular connectivity

BUG: 19020123

Change-Id: Id2d740006cbf850db1cffb0d9f2aaca702ef1366
4 files changed