Share via


BlockedNumberContract.Unblock(Context, String) Method

Definition

Unblocks the phoneNumber if it is blocked.

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

Parameters

context
Context
phoneNumber
String

Returns

the number of rows deleted in the blocked number provider as a result of unblock.

Attributes

Remarks

Unblocks the phoneNumber if it is blocked.

This deletes all rows where the phoneNumber matches the BlockedNumbers#COLUMN_ORIGINAL_NUMBER column or the E164 representation of the phoneNumber matches the BlockedNumbers#COLUMN_E164_NUMBER column.

To delete rows based on exact match with specific columns such as BlockedNumbers#COLUMN_ID use android.content.ContentProvider#delete(Uri, String, String[]) with BlockedNumbers#CONTENT_URI URI.

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

Java documentation for android.provider.BlockedNumberContract.unblock(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