Minimize the number of calls to PhoneNumberUtils.isLocalEmergencyNumber.
On a standard outgoing call, isLocalEmergencyNumber was being called
from 30-40 times. Each of these calls requires a system service
invocation.
A large number of these invocations were coming from InCall UI.
To fix this:
1. Added an isEmergencyCall property to the InCall Call object.
isLocalEmergencyNumber is recalculated any time the mTelecomCall's
handle changes.
2. Replaced calls to isLocalEmergencyNumber in CallCardPresenter with
calls to the InCall call cached version; this easily cuts out around 15
calls to isLocalEmergencyNumber.
3. Replaced code in InCallPresenter; this accounted for 2-3 calls to
isLocalEmergencyNumber.
Bug: 22985202
Change-Id: Ia61204bb0ed6171b24c116e8c681b3924ce54f1d
# Conflicts:
# src/com/android/incallui/Call.java
3 files changed
tree: b99a55657b482fe032f6909a584942ce58f6efdd
- InCallUI/