diff options
Diffstat (limited to 'InCallUI/src')
3 files changed, 26 insertions, 4 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) { diff --git a/InCallUI/src/com/android/incalluibind/ObjectFactory.java b/InCallUI/src/com/android/incalluibind/ObjectFactory.java index a2adc102f..0cb4241b2 100644 --- a/InCallUI/src/com/android/incalluibind/ObjectFactory.java +++ b/InCallUI/src/com/android/incalluibind/ObjectFactory.java @@ -19,14 +19,24 @@ package com.android.incalluibind; import android.content.Context; import android.content.Intent; +import com.android.incallui.CallCardPresenter.EmergencyCallListener; + public class ObjectFactory { + public static EmergencyCallListener getEmergencyCallListener() { + return null; + } + /** @return An {@link Intent} to be broadcast when the InCallUI is visible. */ - public static Intent getUiReadyBroadcastIntent(Context context) { return null; } + public static Intent getUiReadyBroadcastIntent(Context context) { + return null; + } /** * @return An {@link Intent} to be broadcast when the call state button in the InCallUI is * touched while in a call. */ - public static Intent getCallStateButtonBroadcastIntent(Context context) { return null; } + public static Intent getCallStateButtonBroadcastIntent(Context context) { + return null; + } } |