Skip to content

Commit 39f2817

Browse files
neelanshsahaiNeelansh Sahai
and
Neelansh Sahai
authored
Add snippets for Credential Provider (#501)
Co-authored-by: Neelansh Sahai <[email protected]>
1 parent e5dfba3 commit 39f2817

File tree

6 files changed

+841
-2
lines changed

6 files changed

+841
-2
lines changed

identity/credentialmanager/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ dependencies {
5050
implementation(libs.androidx.compose.ui.graphics)
5151
implementation(libs.androidx.compose.ui.tooling.preview)
5252
implementation(libs.androidx.compose.material3)
53+
54+
// [START android_identity_credman_dependency]
55+
implementation(libs.androidx.credentials)
56+
// [END android_identity_credman_dependency]
57+
5358
// [START android_identity_gradle_dependencies]
5459
implementation(libs.androidx.credentials)
5560

identity/credentialmanager/src/main/AndroidManifest.xml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
~ limitations under the License.
1616
-->
1717

18-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
18+
<manifest xmlns:tools="http://schemas.android.com/tools"
19+
xmlns:android="http://schemas.android.com/apk/res/android">
1920

2021
<application
2122
android:allowBackup="true"
@@ -38,6 +39,24 @@
3839
<!-- // [START android_identity_assetlinks_manifest] -->
3940
<meta-data android:name="asset_statements" android:resource="@string/asset_statements" />
4041
<!-- // [END android_identity_assetlinks_manifest] -->
42+
43+
<!-- // [START android_identity_credential_provider_service_manifest] -->
44+
<service android:name=".MyCredentialProviderService"
45+
android:enabled="true"
46+
android:exported="true"
47+
android:label="My Credential Provider"
48+
android:icon="<any drawable icon>"
49+
android:permission="android.permission.BIND_CREDENTIAL_PROVIDER_SERVICE"
50+
tools:targetApi="upside_down_cake">
51+
<intent-filter>
52+
<action android:name="android.service.credentials.CredentialProviderService"/>
53+
</intent-filter>
54+
<meta-data
55+
android:name="android.credentials.provider"
56+
android:resource="@xml/provider"/>
57+
</service>
58+
<!-- // [END android_identity_credential_provider_service_manifest] -->
59+
4160
</application>
4261

43-
</manifest>
62+
</manifest>

0 commit comments

Comments
 (0)