aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/autofill
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-01-26 11:35:10 +0530
committerGitHub <noreply@github.com>2020-01-26 11:35:10 +0530
commit2c78470642905fbaedbda02801e716dd33b70cb5 (patch)
tree5848829657dfd350d2c9b4892b9338ec1c563620 /app/src/main/java/com/zeapo/pwdstore/autofill
parent14f1fa65381375149dbb3fcdba578b6b4799645e (diff)
downloadHardenedPass-2c78470642905fbaedbda02801e716dd33b70cb5.tar.gz
HardenedPass-2c78470642905fbaedbda02801e716dd33b70cb5.zip
Switch to Timber for logging (#617)
* Switch to Timber for logging Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com> * Update changelog Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com> * Fix rebase error Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/autofill')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt4
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt10
2 files changed, 7 insertions, 7 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt
index d4625a54..c47b237f 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt
@@ -10,13 +10,13 @@ import android.content.Intent
import android.content.IntentSender
import android.content.SharedPreferences
import android.os.Bundle
-import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.zeapo.pwdstore.PasswordStore
import com.zeapo.pwdstore.utils.splitLines
import java.util.ArrayList
import java.util.Arrays
import org.eclipse.jgit.util.StringUtils
+import timber.log.Timber
// blank activity started by service for calling startIntentSenderForResult
class AutofillActivity : AppCompatActivity() {
@@ -30,7 +30,7 @@ class AutofillActivity : AppCompatActivity() {
val pi = extras.getParcelable<PendingIntent>("pending_intent") ?: return
startIntentSenderForResult(pi.intentSender, REQUEST_CODE_DECRYPT_AND_VERIFY, null, 0, 0, 0)
} catch (e: IntentSender.SendIntentException) {
- Log.e(AutofillService.Constants.TAG, "SendIntentException", e)
+ Timber.tag(AutofillService.Constants.TAG).e(e, "SendIntentException")
}
} else if (extras != null && extras.containsKey("pick")) {
val intent = Intent(applicationContext, PasswordStore::class.java)
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
index 24c4b1f5..249455ec 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
@@ -17,7 +17,6 @@ import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.provider.Settings
-import android.util.Log
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
import android.view.WindowManager
import android.view.accessibility.AccessibilityEvent
@@ -45,6 +44,7 @@ import me.msfjarvis.openpgpktx.util.OpenPgpServiceConnection
import org.apache.commons.io.FileUtils
import org.openintents.openpgp.IOpenPgpService2
import org.openintents.openpgp.OpenPgpError
+import timber.log.Timber
class AutofillService : AccessibilityService() {
private var serviceConnection: OpenPgpServiceConnection? = null
@@ -518,11 +518,11 @@ class AutofillService : AccessibilityService() {
lastPasswordMaxDate = System.currentTimeMillis() + ttl * 1000L
}
} catch (e: UnsupportedEncodingException) {
- Log.e(Constants.TAG, "UnsupportedEncodingException", e)
+ Timber.tag(Constants.TAG).e(e, "UnsupportedEncodingException")
}
}
OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED -> {
- Log.i("PgpHandler", "RESULT_CODE_USER_INTERACTION_REQUIRED")
+ Timber.tag("PgpHandler").i("RESULT_CODE_USER_INTERACTION_REQUIRED")
val pi = result.getParcelableExtra<PendingIntent>(OpenPgpApi.RESULT_INTENT)
// need to start a blank activity to call startIntentSenderForResult
val intent = Intent(this@AutofillService, AutofillActivity::class.java)
@@ -536,8 +536,8 @@ class AutofillService : AccessibilityService() {
Toast.makeText(this@AutofillService,
"Error from OpenKeyChain : " + error.message,
Toast.LENGTH_LONG).show()
- Log.e(Constants.TAG, "onError getErrorId:" + error.errorId)
- Log.e(Constants.TAG, "onError getMessage:" + error.message)
+ Timber.tag(Constants.TAG).e("onError getErrorId: ${error.errorId}")
+ Timber.tag(Constants.TAG).e("onError getMessage: ${error.message}")
}
}
}