1
+ package com.firebase.ui.auth.data.client
2
+
3
+ import android.content.ContentProvider
4
+ import android.content.ContentValues
5
+ import android.content.Context
6
+ import android.content.pm.ProviderInfo
7
+ import android.database.Cursor
8
+ import android.net.Uri
9
+ import com.firebase.ui.auth.AuthUI
10
+ import com.firebase.ui.auth.util.Preconditions
11
+ import androidx.annotation.RestrictTo
12
+
13
+ @RestrictTo(RestrictTo .Scope .LIBRARY_GROUP )
14
+ class AuthUiInitProvider : ContentProvider () {
15
+
16
+ override fun attachInfo (context : Context , info : ProviderInfo ) {
17
+ Preconditions .checkNotNull(info, " AuthUiInitProvider ProviderInfo cannot be null." )
18
+ if (" com.firebase.ui.auth.authuiinitprovider" == info.authority) {
19
+ throw IllegalStateException (
20
+ " Incorrect provider authority in manifest. Most likely due to a missing " +
21
+ " applicationId variable in application's build.gradle."
22
+ )
23
+ } else {
24
+ super .attachInfo(context, info)
25
+ }
26
+ }
27
+
28
+ override fun onCreate (): Boolean {
29
+ val context = context ? : throw IllegalStateException (" Context cannot be null" )
30
+ AuthUI .setApplicationContext(context)
31
+ return false
32
+ }
33
+
34
+ override fun query (
35
+ uri : Uri ,
36
+ projection : Array <out String >? ,
37
+ selection : String? ,
38
+ selectionArgs : Array <out String >? ,
39
+ sortOrder : String?
40
+ ): Cursor ? = null
41
+
42
+ override fun getType (uri : Uri ): String? = null
43
+
44
+ override fun insert (uri : Uri , values : ContentValues ? ): Uri ? = null
45
+
46
+ override fun delete (uri : Uri , selection : String? , selectionArgs : Array <out String >? ): Int = 0
47
+
48
+ override fun update (
49
+ uri : Uri ,
50
+ values : ContentValues ? ,
51
+ selection : String? ,
52
+ selectionArgs : Array <out String >?
53
+ ): Int = 0
54
+ }
0 commit comments