Skip to content

Commit 82cd9ca

Browse files
author
Neelansh Sahai
committed
Add snippets for Credential Provider
1 parent 1702667 commit 82cd9ca

File tree

6 files changed

+842
-3
lines changed

6 files changed

+842
-3
lines changed

Diff for: identity/credentialmanager/build.gradle.kts

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ dependencies {
4848
implementation(libs.androidx.compose.ui.graphics)
4949
implementation(libs.androidx.compose.ui.tooling.preview)
5050
implementation(libs.androidx.compose.material3)
51+
52+
// [START android_identity_credman_dependency]
53+
implementation(libs.androidx.credentials)
54+
// [END android_identity_credman_dependency]
55+
5156
// [START android_identity_gradle_dependencies]
5257
implementation(libs.androidx.credentials)
5358

@@ -62,4 +67,4 @@ dependencies {
6267
// [END android_identity_siwg_gradle_dependencies]
6368
debugImplementation(libs.androidx.compose.ui.tooling)
6469
debugImplementation(libs.androidx.compose.ui.test.manifest)
65-
}
70+
}

Diff for: identity/credentialmanager/src/main/AndroidManifest.xml

+21-2
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)