summaryrefslogtreecommitdiff
path: root/app/src/nonFree/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-05-15 12:56:49 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-05-15 15:40:20 +0530
commit7e2eb2425e7b9b6ccb37b7b89f19de3fa7a20c44 (patch)
tree6b8a9557ac51b5fab5d2ad7611084cf0de6c57cf /app/src/nonFree/java
parent2fcb285e276594842798be6990b92ba09e733f49 (diff)
all: reformat with Spotless again
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/nonFree/java')
-rw-r--r--app/src/nonFree/java/dev/msfjarvis/aps/autofill/oreo/ui/AutofillSmsActivity.kt30
1 files changed, 20 insertions, 10 deletions
diff --git a/app/src/nonFree/java/dev/msfjarvis/aps/autofill/oreo/ui/AutofillSmsActivity.kt b/app/src/nonFree/java/dev/msfjarvis/aps/autofill/oreo/ui/AutofillSmsActivity.kt
index ab9f3d12..5e53bf3e 100644
--- a/app/src/nonFree/java/dev/msfjarvis/aps/autofill/oreo/ui/AutofillSmsActivity.kt
+++ b/app/src/nonFree/java/dev/msfjarvis/aps/autofill/oreo/ui/AutofillSmsActivity.kt
@@ -77,7 +77,12 @@ class AutofillSmsActivity : AppCompatActivity() {
fun makeFillOtpFromSmsIntentSender(context: Context): IntentSender {
val intent = Intent(context, AutofillSmsActivity::class.java)
- return PendingIntent.getActivity(context, fillOtpFromSmsRequestCode++, intent, PendingIntent.FLAG_CANCEL_CURRENT)
+ return PendingIntent.getActivity(
+ context,
+ fillOtpFromSmsRequestCode++,
+ intent,
+ PendingIntent.FLAG_CANCEL_CURRENT
+ )
.intentSender
}
}
@@ -122,15 +127,17 @@ class AutofillSmsActivity : AppCompatActivity() {
private suspend fun waitForSms() {
val smsClient = SmsCodeRetriever.getAutofillClient(this@AutofillSmsActivity)
- runCatching { withContext(Dispatchers.IO) { smsClient.startSmsCodeRetriever().suspendableAwait() } }.onFailure { e
- ->
- if (e is ResolvableApiException) {
- e.startResolutionForResult(this@AutofillSmsActivity, 1)
- } else {
- e(e)
- withContext(Dispatchers.Main) { finish() }
- }
+ runCatching {
+ withContext(Dispatchers.IO) { smsClient.startSmsCodeRetriever().suspendableAwait() }
}
+ .onFailure { e ->
+ if (e is ResolvableApiException) {
+ e.startResolutionForResult(this@AutofillSmsActivity, 1)
+ } else {
+ e(e)
+ withContext(Dispatchers.Main) { finish() }
+ }
+ }
}
private val smsCodeRetrievedReceiver =
@@ -144,7 +151,10 @@ class AutofillSmsActivity : AppCompatActivity() {
clientState,
AutofillAction.FillOtpFromSms
)
- setResult(RESULT_OK, Intent().apply { putExtra(AutofillManager.EXTRA_AUTHENTICATION_RESULT, fillInDataset) })
+ setResult(
+ RESULT_OK,
+ Intent().apply { putExtra(AutofillManager.EXTRA_AUTHENTICATION_RESULT, fillInDataset) }
+ )
finish()
}
}