contentProvider

pull/302/head
gedoor 4 years ago
parent 8beeea869d
commit 323731d72e
  1. 12
      app/src/main/java/io/legado/app/api/ReaderProvider.kt

@ -28,12 +28,11 @@ class ReaderProvider : ContentProvider() {
} }
private val postBodyKey = "json" private val postBodyKey = "json"
private val authority by lazy {
"${context?.applicationInfo?.packageName}.ReaderProvider"
}
private val sMatcher = UriMatcher(UriMatcher.NO_MATCH) private val sMatcher = UriMatcher(UriMatcher.NO_MATCH)
init { override fun onCreate(): Boolean {
val authority = "${context?.applicationInfo?.packageName}.ReaderProvider"
print(authority)
sMatcher.addURI( sMatcher.addURI(
authority, authority,
"source/insert", "source/insert",
@ -79,6 +78,7 @@ class ReaderProvider : ContentProvider() {
"book/content/query", "book/content/query",
RequestCode.getBookContent.ordinal RequestCode.getBookContent.ordinal
) )
return false
} }
override fun delete( override fun delete(
@ -119,10 +119,6 @@ class ReaderProvider : ContentProvider() {
return null return null
} }
override fun onCreate(): Boolean {
return false
}
override fun query( override fun query(
uri: Uri, projection: Array<String>?, selection: String?, uri: Uri, projection: Array<String>?, selection: String?,
selectionArgs: Array<String>?, sortOrder: String? selectionArgs: Array<String>?, sortOrder: String?

Loading…
Cancel
Save