diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 12 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/ContactInfoCache.java | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 535ba3bf0..e4da71e68 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -60,6 +60,13 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> implements InCallStateListener, IncomingCallListener, InCallDetailsListener, InCallEventListener { + public interface EmergencyCallListener { + public void onCallUpdated(BaseFragment fragment, boolean isEmergency); + } + + private static final EmergencyCallListener mEmergencyCallListener = + ObjectFactory.newEmergencyCallListener(); + private static final String TAG = CallCardPresenter.class.getSimpleName(); private static final long CALL_TIME_UPDATE_INTERVAL_MS = 1000; @@ -526,6 +533,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> ui.setPrimary(null, null, false, null, null, false); } + if (mEmergencyCallListener != null) { + boolean isEmergencyCall = PhoneNumberUtils.isEmergencyNumber( + getNumberFromHandle(mPrimary.getHandle())); + mEmergencyCallListener.onCallUpdated((BaseFragment) ui, isEmergencyCall); + } } private void updateSecondaryDisplayInfo() { diff --git a/InCallUI/src/com/android/incallui/ContactInfoCache.java b/InCallUI/src/com/android/incallui/ContactInfoCache.java index 49621695b..27bf5a8f6 100644 --- a/InCallUI/src/com/android/incallui/ContactInfoCache.java +++ b/InCallUI/src/com/android/incallui/ContactInfoCache.java @@ -29,7 +29,7 @@ import android.text.TextUtils; import com.android.contacts.common.util.PhoneNumberHelper; import com.android.incallui.service.PhoneNumberService; -import com.android.incalluibind.ServiceFactory; +import com.android.incalluibind.ObjectFactory; import com.android.services.telephony.common.MoreStrings; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -69,7 +69,7 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete private ContactInfoCache(Context context) { mContext = context; - mPhoneNumberService = ServiceFactory.newPhoneNumberService(context); + mPhoneNumberService = ObjectFactory.newPhoneNumberService(context); } public ContactCacheEntry getInfo(String callId) { |