TestLocationButtonProvider


public class TestLocationButtonProvider implements LocationButtonProvider


A test implementation of LocationButtonProvider which provides a fake of the LocationButton and provides additional methods to allow tests to fake user interactions so that the client side flows can be tested.

Summary

Public constructors

Public methods

static final @NonNull TestLocationButtonProvider

Construct a TestLocationButtonProvider that runs a fake location button session.

final void
notifyPermissionResult(
    @NonNull LocationButtonSession session,
    boolean isGranted
)
void
openSession(
    @NonNull Activity activity,
    @NonNull IBinder hostToken,
    int displayId,
    @NonNull LocationButtonRequest request,
    @NonNull Executor executor,
    @NonNull LocationButtonClient client
)

Protected methods

void

Public constructors

TestLocationButtonProvider

Added in 1.0.0-alpha01
public TestLocationButtonProvider(@NonNull Context context)

Public methods

create

Added in 1.0.0-alpha01
public static final @NonNull TestLocationButtonProvider create()

Construct a TestLocationButtonProvider that runs a fake location button session.

Returns
@NonNull TestLocationButtonProvider

A test only implementation of LocationButtonProvider.

notifyPermissionResult

Added in 1.0.0-alpha01
public final void notifyPermissionResult(
    @NonNull LocationButtonSession session,
    boolean isGranted
)

openSession

Added in 1.0.0-alpha01
public void openSession(
    @NonNull Activity activity,
    @NonNull IBinder hostToken,
    int displayId,
    @NonNull LocationButtonRequest request,
    @NonNull Executor executor,
    @NonNull LocationButtonClient client
)

Protected methods

onSessionRequestReceived

Added in 1.0.0-alpha01
protected void onSessionRequestReceived(
    @NonNull LocationButtonRequest request,
    @NonNull LocationButtonSession session
)