Dialer: Fix SecurityException when receiving a call as secondary user
From isBlocked()'s javadoc:
Note that if the canCurrentUserBlockNumbers is false for the user
context, this method will throw a SecurityException.
Change-Id: Ia5d37bf4b471b85a46fe8f4255ab82b4ad996ecf
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java
index 8d3e45f..5ef725f 100644
--- a/java/com/android/incallui/InCallPresenter.java
+++ b/java/com/android/incallui/InCallPresenter.java
@@ -204,7 +204,8 @@
return;
}
// Check if the number is blocked, to silence the ringer.
- if (BlockedNumberContract.isBlocked(context, incomingNumber)) {
+ if (BlockedNumberContract.canCurrentUserBlockNumbers(context) &&
+ BlockedNumberContract.isBlocked(context, incomingNumber)) {
TelecomUtil.silenceRinger(context);
}
}