RuntimePermissionsStubber.Matchers

public class RuntimePermissionsStubber.Matchers


A collection of hamcrest matchers to help with runtime permission stubbing.

Usually you will not need to use these matchers directly and purely rely on: intendingGrantedPermissions or intendingRevokedPermissions

Summary

Constants

static final String
ACTION_REQUEST_PERMISSIONS = "android.content.pm.action.REQUEST_PERMISSIONS"

Internal Android intent action which is used to request runtime permissions.

Public constructors

Public methods

static Matcher<Intent>

Matches any runtime permission Intent.

static Matcher<Intent>
hasPermission(String permission)

Matches runtime permission Intents for a particular permission.

static Matcher<Intent>
hasPermissions(String[] permissions)

Matches runtime permission Intents for a list of permissions.

static Matcher<Intent>
hasPermissions(Matcher<Iterable<String>> permissionsMatcher)

Matches runtime permission Intents for a list of permissions.

Constants

ACTION_REQUEST_PERMISSIONS

public static final String ACTION_REQUEST_PERMISSIONS = "android.content.pm.action.REQUEST_PERMISSIONS"

Internal Android intent action which is used to request runtime permissions.

Public constructors

Matchers

public Matchers()

Public methods

anyPermission

public static Matcher<Intent> anyPermission()

Matches any runtime permission Intent.

hasPermission

public static Matcher<Intent> hasPermission(String permission)

Matches runtime permission Intents for a particular permission.

hasPermissions

public static Matcher<Intent> hasPermissions(String[] permissions)

Matches runtime permission Intents for a list of permissions.

hasPermissions

public static Matcher<Intent> hasPermissions(Matcher<Iterable<String>> permissionsMatcher)

Matches runtime permission Intents for a list of permissions.

Parameters
Matcher<Iterable<String>> permissionsMatcher

that matches a permission string