# ProviderSignInMethod

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/signin/ProviderSignInMethod.java+class:androidx.car.app.model.signin.ProviderSignInMethod) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@RequiresCarApi(value = 2)
@CarProtocol
public final class ProviderSignInMethod implements SignInTemplate.SignInMethod
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/car/app/model/signin/SignInTemplate.SignInMethod` that allows the user to initiate sign-in with a authentication provider.

Not all providers will be available on all devices. It is the developer's responsibility to verify the presence of the corresponding provider by using the provider's own APIs. For example, for Google Sign In, check [Integrating Google Sign-In into Your Android App](https://developers.google.com/identity/sign-in/android/sign-in)).

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/model/signin/ProviderSignInMethod#ProviderSignInMethod(androidx.car.app.model.Action)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/Action action)` Creates a `https://developer.android.com/reference/androidx/car/app/model/signin/ProviderSignInMethod` instance with the given provider `https://developer.android.com/reference/androidx/car/app/model/Action`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/signin/ProviderSignInMethod#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/Action` | `https://developer.android.com/reference/androidx/car/app/model/signin/ProviderSignInMethod#getAction()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/Action` the user can use to initiate the sign-in with a given provider. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/signin/ProviderSignInMethod#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/signin/ProviderSignInMethod#toString()()` |

## Public constructors

### ProviderSignInMethod

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
public ProviderSignInMethod(@NonNull Action action)
```

Creates a `https://developer.android.com/reference/androidx/car/app/model/signin/ProviderSignInMethod` instance with the given provider `https://developer.android.com/reference/androidx/car/app/model/Action`.

#### Requirements

The provider action must not be a standard action, and it must use a `https://developer.android.com/reference/androidx/car/app/model/ParkedOnlyOnClickListener`.

The action's title color can be customized with `https://developer.android.com/reference/androidx/car/app/model/ForegroundCarColorSpan` instances, any other spans will be ignored by the host.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `action` does not meet the requirements |
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `action` is `null` |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Action` |   |
| `https://developer.android.com/reference/androidx/car/app/model/ParkedOnlyOnClickListener` |   |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getAction

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @NonNull Action getAction()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/Action` the user can use to initiate the sign-in with a given provider.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```