-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add content provider in order to prevent the use of init in Applicati…
…on class
- Loading branch information
Showing
5 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="ptsiogas.gr.securebox"/> | ||
package="ptsiogas.gr.securebox"> | ||
|
||
<application> | ||
|
||
<provider | ||
android:name=".SecureBoxContentProvider" | ||
android:authorities="${applicationId}.SecureBoxContentProvider" /> | ||
</application> | ||
</manifest> |
47 changes: 47 additions & 0 deletions
47
securebox/src/main/java/ptsiogas/gr/securebox/SecureBoxContentProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package ptsiogas.gr.securebox | ||
|
||
import android.content.ContentProvider | ||
import android.content.ContentValues | ||
import android.database.Cursor | ||
import android.net.Uri | ||
|
||
class SecureBoxContentProvider : ContentProvider() { | ||
override fun onCreate(): Boolean { | ||
if (this.context != null) { | ||
SecureBoxHelper.instance.init(this.context) | ||
} | ||
return true | ||
} | ||
|
||
override fun insert(uri: Uri, values: ContentValues?): Uri { | ||
//do nothing | ||
return uri | ||
} | ||
|
||
override fun query( | ||
uri: Uri, | ||
projection: Array<out String>?, | ||
selection: String?, | ||
selectionArgs: Array<out String>?, | ||
sortOrder: String? | ||
): Cursor { | ||
throw Exception("unimplemented") | ||
} | ||
|
||
override fun update( | ||
uri: Uri, | ||
values: ContentValues?, | ||
selection: String?, | ||
selectionArgs: Array<out String>? | ||
): Int { | ||
throw Exception("unimplemented") | ||
} | ||
|
||
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int { | ||
throw Exception("unimplemented") | ||
} | ||
|
||
override fun getType(uri: Uri): String { | ||
throw Exception("unimplemented") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters