image: fix bad coverprovider conventions
This commit is contained in:
parent
b4a9f9af96
commit
07a0d01a06
2 changed files with 13 additions and 9 deletions
|
@ -105,7 +105,7 @@
|
||||||
-->
|
-->
|
||||||
<provider
|
<provider
|
||||||
android:name=".image.CoverProvider"
|
android:name=".image.CoverProvider"
|
||||||
android:authorities="org.oxycblt.auxio.image"
|
android:authorities="org.oxycblt.auxio.image.CoverProvider"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
tools:ignore="ExportedContentProvider" />
|
tools:ignore="ExportedContentProvider" />
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
package org.oxycblt.auxio.image
|
package org.oxycblt.auxio.image
|
||||||
|
|
||||||
import android.content.ContentProvider
|
import android.content.ContentProvider
|
||||||
|
import android.content.ContentResolver
|
||||||
import android.content.ContentValues
|
import android.content.ContentValues
|
||||||
import android.content.UriMatcher
|
import android.content.UriMatcher
|
||||||
import android.database.Cursor
|
import android.database.Cursor
|
||||||
|
@ -59,25 +60,28 @@ class CoverProvider : ContentProvider() {
|
||||||
sortOrder: String?
|
sortOrder: String?
|
||||||
): Cursor = throw UnsupportedOperationException()
|
): Cursor = throw UnsupportedOperationException()
|
||||||
|
|
||||||
override fun insert(uri: Uri, values: ContentValues?): Uri =
|
override fun insert(uri: Uri, values: ContentValues?): Uri? = null
|
||||||
throw UnsupportedOperationException()
|
|
||||||
|
|
||||||
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int =
|
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int = 0
|
||||||
throw UnsupportedOperationException()
|
|
||||||
|
|
||||||
override fun update(
|
override fun update(
|
||||||
uri: Uri,
|
uri: Uri,
|
||||||
values: ContentValues?,
|
values: ContentValues?,
|
||||||
selection: String?,
|
selection: String?,
|
||||||
selectionArgs: Array<out String>?
|
selectionArgs: Array<out String>?
|
||||||
): Int = throw UnsupportedOperationException()
|
): Int = 0
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val AUTHORITY = "org.oxycblt.auxio.image"
|
private const val AUTHORITY = "org.oxycblt.auxio.image.CoverProvider"
|
||||||
private const val IMAGES_PATH = "covers"
|
private const val IMAGES_PATH = "covers"
|
||||||
private val uriMatcher =
|
private val uriMatcher =
|
||||||
UriMatcher(UriMatcher.NO_MATCH).apply { addURI(AUTHORITY, "$IMAGES_PATH/*", 1) }
|
UriMatcher(UriMatcher.NO_MATCH).apply { addURI(AUTHORITY, "$IMAGES_PATH/*", 1) }
|
||||||
|
|
||||||
val CONTENT_URI: Uri = Uri.parse("content://$AUTHORITY/$IMAGES_PATH")
|
val CONTENT_URI: Uri =
|
||||||
|
Uri.Builder()
|
||||||
|
.scheme(ContentResolver.SCHEME_CONTENT)
|
||||||
|
.authority(AUTHORITY)
|
||||||
|
.appendPath(IMAGES_PATH)
|
||||||
|
.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue