-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from vestrel00/25-sim-card-access
Implemented SIM card query, insert, update, and delete!
- Loading branch information
Showing
43 changed files
with
2,453 additions
and
63 deletions.
There are no files selected for viewing
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
async/src/main/java/contacts/async/sim/SimContactsDeleteAsync.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,33 @@ | ||
package contacts.async.sim | ||
|
||
import contacts.async.ASYNC_DISPATCHER | ||
import contacts.core.sim.SimContactsDelete | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Deferred | ||
import kotlinx.coroutines.async | ||
import kotlinx.coroutines.withContext | ||
import kotlin.coroutines.CoroutineContext | ||
|
||
/** | ||
* Suspends the current coroutine, performs the operation in the given [context], then returns the | ||
* result. | ||
* | ||
* Computations automatically stops if the parent coroutine scope / job is cancelled. | ||
* | ||
* See [SimContactsDelete.commit]. | ||
*/ | ||
suspend fun SimContactsDelete.commitWithContext( | ||
context: CoroutineContext = ASYNC_DISPATCHER | ||
): SimContactsDelete.Result = withContext(context) { commit() } | ||
|
||
/** | ||
* Creates a [CoroutineScope] with the given [context], performs the operation in that scope, then | ||
* returns the [Deferred] result. | ||
* | ||
* Computations automatically stops if the parent coroutine scope / job is cancelled. | ||
* | ||
* See [SimContactsDelete.commit]. | ||
*/ | ||
fun SimContactsDelete.commitAsync( | ||
context: CoroutineContext = ASYNC_DISPATCHER | ||
): Deferred<SimContactsDelete.Result> = CoroutineScope(context).async { commit() } |
29 changes: 29 additions & 0 deletions
29
async/src/main/java/contacts/async/sim/SimContactsInsertAsync.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,29 @@ | ||
package contacts.async.sim | ||
|
||
import contacts.async.ASYNC_DISPATCHER | ||
import contacts.core.sim.SimContactsInsert | ||
import kotlinx.coroutines.* | ||
import kotlin.coroutines.CoroutineContext | ||
|
||
/** | ||
* Suspends the current coroutine, performs the operation in the given [context], then returns the | ||
* result. | ||
* | ||
* Computations automatically stops if the parent coroutine scope / job is cancelled. | ||
* | ||
* See [SimContactsInsert.commit]. | ||
*/ | ||
suspend fun SimContactsInsert.commitWithContext(context: CoroutineContext = ASYNC_DISPATCHER): | ||
SimContactsInsert.Result = withContext(context) { commit { !isActive } } | ||
|
||
|
||
/** | ||
* Creates a [CoroutineScope] with the given [context], performs the operation in that scope, then | ||
* returns the [Deferred] result. | ||
* | ||
* Computations automatically stops if the parent coroutine scope / job is cancelled. | ||
* | ||
* See [SimContactsInsert.commit]. | ||
*/ | ||
fun SimContactsInsert.commitAsync(context: CoroutineContext = ASYNC_DISPATCHER): | ||
Deferred<SimContactsInsert.Result> = CoroutineScope(context).async { commit { !isActive } } |
28 changes: 28 additions & 0 deletions
28
async/src/main/java/contacts/async/sim/SimContactsQueryAsync.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,28 @@ | ||
package contacts.async.sim | ||
|
||
import contacts.async.ASYNC_DISPATCHER | ||
import contacts.core.sim.SimContactsQuery | ||
import kotlinx.coroutines.* | ||
import kotlin.coroutines.CoroutineContext | ||
|
||
/** | ||
* Suspends the current coroutine, performs the operation in the given [context], then returns the | ||
* result. | ||
* | ||
* Computations automatically stops if the parent coroutine scope / job is cancelled. | ||
* | ||
* See [SimContactsQuery.find]. | ||
*/ | ||
suspend fun SimContactsQuery.findWithContext(context: CoroutineContext = ASYNC_DISPATCHER): | ||
SimContactsQuery.Result = withContext(context) { find { !isActive } } | ||
|
||
/** | ||
* Creates a [CoroutineScope] with the given [context], performs the operation in that scope, then | ||
* returns the [Deferred] result. | ||
* | ||
* Computations automatically stops if the parent coroutine scope / job is cancelled. | ||
* | ||
* See [SimContactsQuery.find]. | ||
*/ | ||
fun SimContactsQuery.findAsync(context: CoroutineContext = ASYNC_DISPATCHER): | ||
Deferred<SimContactsQuery.Result> = CoroutineScope(context).async { find { !isActive } } |
29 changes: 29 additions & 0 deletions
29
async/src/main/java/contacts/async/sim/SimContactsUpdateAsync.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,29 @@ | ||
package contacts.async.sim | ||
|
||
import contacts.async.ASYNC_DISPATCHER | ||
import contacts.core.sim.SimContactsUpdate | ||
import kotlinx.coroutines.* | ||
import kotlin.coroutines.CoroutineContext | ||
|
||
/** | ||
* Suspends the current coroutine, performs the operation in the given [context], then returns the | ||
* result. | ||
* | ||
* Computations automatically stops if the parent coroutine scope / job is cancelled. | ||
* | ||
* See [SimContactsUpdate.commit]. | ||
*/ | ||
suspend fun SimContactsUpdate.commitWithContext(context: CoroutineContext = ASYNC_DISPATCHER): | ||
SimContactsUpdate.Result = withContext(context) { commit { !isActive } } | ||
|
||
|
||
/** | ||
* Creates a [CoroutineScope] with the given [context], performs the operation in that scope, then | ||
* returns the [Deferred] result. | ||
* | ||
* Computations automatically stops if the parent coroutine scope / job is cancelled. | ||
* | ||
* See [SimContactsUpdate.commit]. | ||
*/ | ||
fun SimContactsUpdate.commitAsync(context: CoroutineContext = ASYNC_DISPATCHER): | ||
Deferred<SimContactsUpdate.Result> = CoroutineScope(context).async { commit { !isActive } } |
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
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
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
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
Oops, something went wrong.