diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-31 18:07:17 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-31 18:07:17 +0000 |
commit | ae06b1b3b86fcaffde9f94171bbb2b5649a95f14 (patch) | |
tree | 1f6349a450779c93e514fec9948d64e50d9b4e1e /java/com/android/incallui/InCallPresenter.java | |
parent | 7f7f25f903e4649f12aaa255b32bd20cb4079183 (diff) | |
parent | 83b20211c3be04a850de3674977deee8e448d17f (diff) |
Update Dialer to v10 RC45.
am: 83b20211c3
Change-Id: Ide21415247a3ec743f5438c49d29ba2d861081b0
Diffstat (limited to 'java/com/android/incallui/InCallPresenter.java')
-rw-r--r-- | java/com/android/incallui/InCallPresenter.java | 19 |
1 files changed, 17 insertions, 2 deletions
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; } |