diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-31 18:13:37 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-31 18:13:37 +0000 |
commit | c303829af8bc66a9808294804b3171f849ee81ca (patch) | |
tree | 5a2b6df3ec5c90c75f8e55aedf9859cf1bfa7022 /java/com/android/incallui | |
parent | aa2307179c64cce800dfcf184bf762abf75a92d0 (diff) | |
parent | ae06b1b3b86fcaffde9f94171bbb2b5649a95f14 (diff) |
Update Dialer to v10 RC45. am: 83b20211c3
am: ae06b1b3b8
Change-Id: I37dfc5acf163aa0942803da64ec47629622580c4
Diffstat (limited to 'java/com/android/incallui')
7 files changed, 43 insertions, 43 deletions
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index 0b3592d01..c2b99c1d1 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -465,7 +465,8 @@ public class CallCardPresenter shouldShowCallSubject(mPrimary) ? mPrimary.getCallSubject() : null, mPrimary.getCallbackNumber(), mPrimary.hasProperty(Details.PROPERTY_WIFI), - mPrimary.isConferenceCall(), + mPrimary.isConferenceCall() + && !mPrimary.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE), isWorkCall, isAttemptingHdAudioCall, isHdAudioCall, @@ -699,7 +700,7 @@ public class CallCardPresenter false /* nameIsNumber */, null /* location */, null /* label */, - getConferencePhoto(mPrimary), + null /* photo */, ContactPhotoType.DEFAULT_PLACEHOLDER, false /* isSipCall */, showContactPhoto, @@ -1043,16 +1044,6 @@ public class CallCardPresenter return mContext.getResources().getString(resId); } - private Drawable getConferencePhoto(DialerCall call) { - boolean isGenericConference = call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE); - LogUtil.v("CallCardPresenter.getConferencePhoto", "" + isGenericConference); - - final int resId = isGenericConference ? R.drawable.img_phone : R.drawable.img_conference; - Drawable photo = mContext.getResources().getDrawable(resId); - photo.setAutoMirrored(true); - return photo; - } - private boolean shouldShowEndCallButton(DialerCall primary, int callState) { if (primary == null) { return false; diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java index 4c8ede906..e45eb9746 100644 --- a/java/com/android/incallui/ContactInfoCache.java +++ b/java/com/android/incallui/ContactInfoCache.java @@ -84,7 +84,6 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { private final ConcurrentHashMap<String, ContactCacheEntry> mInfoMap = new ConcurrentHashMap<>(); private final Map<String, Set<ContactInfoCacheCallback>> mCallBacks = new ArrayMap<>(); private Drawable mDefaultContactPhotoDrawable; - private Drawable mConferencePhotoDrawable; private int mQueryId; private final DialerExecutor<CnapInformationWrapper> cachedNumberLookupExecutor = DialerExecutors.createNonUiTaskBuilder(new CachedNumberLookupWorker()).build(); @@ -675,14 +674,6 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { return mDefaultContactPhotoDrawable; } - public Drawable getConferenceDrawable() { - if (mConferencePhotoDrawable == null) { - mConferencePhotoDrawable = - mContext.getResources().getDrawable(R.drawable.img_conference_automirrored); - } - return mConferencePhotoDrawable; - } - /** Callback interface for the contact query. */ public interface ContactInfoCacheCallback { @@ -798,8 +789,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { maybeUpdateFromCequintCallerId(ci, cw.cnapName, mIsIncoming); long time = SystemClock.uptimeMillis() - start; Log.d(TAG, "Cequint Caller Id look up takes " + time + " ms."); - updateCallerInfoInCacheOnAnyThread( - cw.callId, cw.numberPresentation, ci, mIsIncoming, true, mQueryToken); + updateCallerInfoInCacheOnAnyThread(cw.callId, cw.numberPresentation, ci, mIsIncoming, true, mQueryToken); } @Override diff --git a/java/com/android/incallui/ExternalCallNotifier.java b/java/com/android/incallui/ExternalCallNotifier.java index 6ec94a631..0c2493c60 100644 --- a/java/com/android/incallui/ExternalCallNotifier.java +++ b/java/com/android/incallui/ExternalCallNotifier.java @@ -338,7 +338,9 @@ public class ExternalCallNotifier implements ExternalCallList.ExternalCallListen && !call.getDetails() .hasProperty(android.telecom.Call.Details.PROPERTY_GENERIC_CONFERENCE)) { - largeIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.img_conference); + largeIcon = + BitmapFactory.decodeResource( + context.getResources(), R.drawable.quantum_ic_group_vd_theme_24); } if (contactInfo.photo != null && (contactInfo.photo instanceof BitmapDrawable)) { largeIcon = ((BitmapDrawable) contactInfo.photo).getBitmap(); diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index 9c8120c92..2d6d83c3c 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -24,6 +24,7 @@ import android.os.Handler; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; +import android.support.v4.os.UserManagerCompat; import android.telecom.Call.Details; import android.telecom.DisconnectCause; import android.telecom.PhoneAccount; @@ -37,6 +38,7 @@ import android.view.WindowManager; import com.android.contacts.common.compat.CallCompat; import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener; +import com.android.dialer.blocking.FilteredNumberCompat; import com.android.dialer.blocking.FilteredNumbersUtil; import com.android.dialer.common.LogUtil; import com.android.dialer.enrichedcall.EnrichedCallComponent; @@ -309,7 +311,8 @@ public class InCallPresenter implements CallList.Listener { StatusBarNotifier statusBarNotifier, ExternalCallNotifier externalCallNotifier, ContactInfoCache contactInfoCache, - ProximitySensor proximitySensor) { + ProximitySensor proximitySensor, + FilteredNumberAsyncQueryHandler filteredNumberQueryHandler) { if (mServiceConnected) { Log.i(this, "New service connection replacing existing one."); if (context != mContext || callList != mCallList) { @@ -354,7 +357,7 @@ public class InCallPresenter implements CallList.Listener { VideoPauseController.getInstance().setUp(this); - mFilteredQueryHandler = new FilteredNumberAsyncQueryHandler(context); + mFilteredQueryHandler = filteredNumberQueryHandler; mContext .getSystemService(TelephonyManager.class) .listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); @@ -519,6 +522,12 @@ public class InCallPresenter implements CallList.Listener { if (call.getState() != android.telecom.Call.STATE_RINGING) { return false; } + if (!UserManagerCompat.isUserUnlocked(mContext)) { + LogUtil.i( + "InCallPresenter.shouldAttemptBlocking", + "not attempting to block incoming call because user is locked"); + return false; + } if (TelecomCallUtil.isEmergencyCall(call)) { Log.i(this, "Not attempting to block incoming emergency call"); return false; @@ -530,6 +539,12 @@ public class InCallPresenter implements CallList.Listener { if (call.getDetails().hasProperty(CallCompat.Details.PROPERTY_IS_EXTERNAL_CALL)) { return false; } + if (FilteredNumberCompat.useNewFiltering(mContext)) { + LogUtil.i( + "InCallPresenter.shouldAttemptBlocking", + "not attempting to block incoming call because framework blocking is in use"); + return false; + } return true; } diff --git a/java/com/android/incallui/InCallServiceImpl.java b/java/com/android/incallui/InCallServiceImpl.java index 4fed014c6..4ab92a797 100644 --- a/java/com/android/incallui/InCallServiceImpl.java +++ b/java/com/android/incallui/InCallServiceImpl.java @@ -22,6 +22,7 @@ import android.os.IBinder; import android.telecom.Call; import android.telecom.CallAudioState; import android.telecom.InCallService; +import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; import com.android.incallui.audiomode.AudioModeProvider; import com.android.incallui.call.CallList; import com.android.incallui.call.ExternalCallList; @@ -66,14 +67,15 @@ public class InCallServiceImpl extends InCallService { final ContactInfoCache contactInfoCache = ContactInfoCache.getInstance(context); InCallPresenter.getInstance() .setUp( - getApplicationContext(), + context, CallList.getInstance(), new ExternalCallList(), new StatusBarNotifier(context, contactInfoCache), new ExternalCallNotifier(context, contactInfoCache), contactInfoCache, new ProximitySensor( - context, AudioModeProvider.getInstance(), new AccelerometerListener(context))); + context, AudioModeProvider.getInstance(), new AccelerometerListener(context)), + new FilteredNumberAsyncQueryHandler(context)); InCallPresenter.getInstance().onServiceBind(); InCallPresenter.getInstance().maybeStartRevealAnimation(intent); TelecomAdapter.getInstance().setInCallService(this); diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java index af541b0e5..165b30b52 100644 --- a/java/com/android/incallui/StatusBarNotifier.java +++ b/java/com/android/incallui/StatusBarNotifier.java @@ -33,8 +33,8 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; +import android.content.res.Resources; import android.graphics.Bitmap; -import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; @@ -302,7 +302,7 @@ public class StatusBarNotifier // Check if data has changed; if nothing is different, don't issue another notification. final int iconResId = getIconToDisplay(call); - Bitmap largeIcon = getLargeIconToDisplay(contactInfo, call); + Bitmap largeIcon = getLargeIconToDisplay(mContext, contactInfo, call); final String content = getContentString(call, contactInfo.userType); final String contentTitle = getContentTitle(contactInfo, call); @@ -594,30 +594,29 @@ public class StatusBarNotifier } /** Gets a large icon from the contact info object to display in the notification. */ - private Bitmap getLargeIconToDisplay(ContactCacheEntry contactInfo, DialerCall call) { + private static Bitmap getLargeIconToDisplay( + Context context, ContactCacheEntry contactInfo, DialerCall call) { + Resources resources = context.getResources(); Bitmap largeIcon = null; - if (call.isConferenceCall() && !call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)) { - largeIcon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.img_conference); - } if (contactInfo.photo != null && (contactInfo.photo instanceof BitmapDrawable)) { largeIcon = ((BitmapDrawable) contactInfo.photo).getBitmap(); } if (contactInfo.photo == null) { - int width = - (int) mContext.getResources().getDimension(android.R.dimen.notification_large_icon_width); - int height = - (int) - mContext.getResources().getDimension(android.R.dimen.notification_large_icon_height); + int width = (int) resources.getDimension(android.R.dimen.notification_large_icon_width); + int height = (int) resources.getDimension(android.R.dimen.notification_large_icon_height); int contactType = LetterTileDrawable.TYPE_DEFAULT; - LetterTileDrawable lettertile = new LetterTileDrawable(mContext.getResources()); + LetterTileDrawable lettertile = new LetterTileDrawable(resources); // TODO: Deduplicate across Dialer. b/36195917 - if (CallerInfoUtils.isVoiceMailNumber(mContext, call)) { + if (CallerInfoUtils.isVoiceMailNumber(context, call)) { contactType = LetterTileDrawable.TYPE_VOICEMAIL; } else if (contactInfo.isBusiness) { contactType = LetterTileDrawable.TYPE_BUSINESS; } else if (call.getNumberPresentation() == TelecomManager.PRESENTATION_RESTRICTED) { contactType = LetterTileDrawable.TYPE_GENERIC_AVATAR; + } else if (call.isConferenceCall() + && !call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)) { + contactType = LetterTileDrawable.TYPE_CONFERENCE; } lettertile.setCanonicalDialerLetterTileDetails( contactInfo.namePrimary == null ? contactInfo.number : contactInfo.namePrimary, @@ -628,8 +627,7 @@ public class StatusBarNotifier } if (call.isSpam()) { - Drawable drawable = - mContext.getResources().getDrawable(R.drawable.blocked_contact, mContext.getTheme()); + Drawable drawable = resources.getDrawable(R.drawable.blocked_contact, context.getTheme()); largeIcon = DrawableConverter.drawableToBitmap(drawable); } return largeIcon; diff --git a/java/com/android/incallui/contactgrid/ContactGridManager.java b/java/com/android/incallui/contactgrid/ContactGridManager.java index ed533be58..1322d58ea 100644 --- a/java/com/android/incallui/contactgrid/ContactGridManager.java +++ b/java/com/android/incallui/contactgrid/ContactGridManager.java @@ -245,6 +245,8 @@ public class ContactGridManager { return LetterTileDrawable.TYPE_BUSINESS; } else if (primaryInfo.numberPresentation == TelecomManager.PRESENTATION_RESTRICTED) { return LetterTileDrawable.TYPE_GENERIC_AVATAR; + } else if (callState.isConference) { + return LetterTileDrawable.TYPE_CONFERENCE; } else { return LetterTileDrawable.TYPE_DEFAULT; } |