Share via


BlockedNumberContract.IsBlocked(Context, String) Method

Definition

Returns whether a given number is in the blocked list.

[Android.Runtime.Register("isBlocked", "(Landroid/content/Context;Ljava/lang/String;)Z", "", ApiSince=24)]
public static bool IsBlocked (Android.Content.Context? context, string? phoneNumber);
[<Android.Runtime.Register("isBlocked", "(Landroid/content/Context;Ljava/lang/String;)Z", "", ApiSince=24)>]
static member IsBlocked : Android.Content.Context * string -> bool

Parameters

context
Context
phoneNumber
String

Returns

true if the phoneNumber is blocked.

Attributes

Remarks

Returns whether a given number is in the blocked list.

This matches the phoneNumber against the BlockedNumbers#COLUMN_ORIGINAL_NUMBER column, and the E164 representation of the phoneNumber with the BlockedNumbers#COLUMN_E164_NUMBER column.

Note that if the #canCurrentUserBlockNumbers is false for the user context context, this method will throw a SecurityException.

Java documentation for android.provider.BlockedNumberContract.isBlocked(android.content.Context, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to