mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-02 04:06:51 +01:00
Add BinaryOperationInTimber lint rule and fix existing errors
This commit is contained in:
parent
d6cdcc60d1
commit
b10e9c54b4
@ -46,4 +46,7 @@
|
||||
|
||||
<!-- Manifest -->
|
||||
<issue id="PermissionImpliesUnsupportedChromeOsHardware" severity="error" />
|
||||
|
||||
<!-- Timber -->
|
||||
<issue id="BinaryOperationInTimber" severity="error" />
|
||||
</lint>
|
||||
|
@ -144,10 +144,10 @@ fun openCamera(activity: Activity, titlePrefix: String, requestCode: Int): Strin
|
||||
Timber.e("Cannot use the external storage media to save image")
|
||||
}
|
||||
} catch (uoe: UnsupportedOperationException) {
|
||||
Timber.e(uoe, "Unable to insert camera URI into MediaStore.Images.Media.EXTERNAL_CONTENT_URI " +
|
||||
"no SD card? Attempting to insert into device storage.")
|
||||
Timber.e(uoe, "Unable to insert camera URI into MediaStore.Images.Media.EXTERNAL_CONTENT_URI.")
|
||||
Timber.e("no SD card? Attempting to insert into device storage.")
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e, "Unable to insert camera URI into MediaStore.Images.Media.EXTERNAL_CONTENT_URI. $e")
|
||||
Timber.e(e, "Unable to insert camera URI into MediaStore.Images.Media.EXTERNAL_CONTENT_URI.")
|
||||
}
|
||||
|
||||
if (null == dummyUri) {
|
||||
@ -157,13 +157,13 @@ fun openCamera(activity: Activity, titlePrefix: String, requestCode: Int): Strin
|
||||
Timber.e("Cannot use the internal storage to save media to save image")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e, "Unable to insert camera URI into internal storage. Giving up. $e")
|
||||
Timber.e(e, "Unable to insert camera URI into internal storage. Giving up.")
|
||||
}
|
||||
}
|
||||
|
||||
if (dummyUri != null) {
|
||||
captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, dummyUri)
|
||||
Timber.v("trying to take a photo on " + dummyUri.toString())
|
||||
Timber.v("trying to take a photo on $dummyUri")
|
||||
} else {
|
||||
Timber.v("trying to take a photo with no predefined uri")
|
||||
}
|
||||
|
@ -36,8 +36,8 @@ class VectorConfiguration @Inject constructor(private val context: Context) {
|
||||
// TODO Import mLanguageReceiver From Riot?
|
||||
fun onConfigurationChanged() {
|
||||
if (Locale.getDefault().toString() != VectorLocale.applicationLocale.toString()) {
|
||||
Timber.v("## onConfigurationChanged() : the locale has been updated to " + Locale.getDefault().toString()
|
||||
+ ", restore the expected value " + VectorLocale.applicationLocale.toString())
|
||||
Timber.v("## onConfigurationChanged(): the locale has been updated to ${Locale.getDefault()}")
|
||||
Timber.v("## onConfigurationChanged(): restore the expected value ${VectorLocale.applicationLocale}")
|
||||
updateApplicationSettings(VectorLocale.applicationLocale,
|
||||
FontScale.getFontScalePrefValue(context),
|
||||
ThemeUtils.getApplicationTheme(context))
|
||||
|
@ -74,7 +74,7 @@ class KeysBackupRestoreFromPassphraseViewModel @Inject constructor() : ViewModel
|
||||
isIndeterminate = true))
|
||||
}
|
||||
is StepProgressListener.Step.ImportingKey -> {
|
||||
Timber.d("backupKeys.ImportingKey.progress: " + step.progress)
|
||||
Timber.d("backupKeys.ImportingKey.progress: ${step.progress}")
|
||||
// Progress 0 can take a while, display an indeterminate progress in this case
|
||||
if (step.progress == 0) {
|
||||
sharedViewModel.loadingEvent.postValue(WaitingViewData(context.getString(R.string.keys_backup_restoring_waiting_message)
|
||||
|
@ -89,7 +89,7 @@ class LoginCaptchaFragment @Inject constructor(
|
||||
}
|
||||
|
||||
override fun onReceivedSslError(view: WebView, handler: SslErrorHandler, error: SslError) {
|
||||
Timber.d("## onReceivedSslError() : " + error.certificate)
|
||||
Timber.d("## onReceivedSslError() : ${error.certificate}")
|
||||
|
||||
if (!isAdded) {
|
||||
return
|
||||
|
@ -99,9 +99,9 @@ class VectorUncaughtExceptionHandler @Inject constructor(private val bugReporter
|
||||
val pw = PrintWriter(sw, true)
|
||||
throwable.printStackTrace(pw)
|
||||
b.append(sw.buffer.toString())
|
||||
Timber.e("FATAL EXCEPTION " + b.toString())
|
||||
|
||||
val bugDescription = b.toString()
|
||||
Timber.e("FATAL EXCEPTION $bugDescription")
|
||||
|
||||
bugReporter.saveCrashReport(context, bugDescription)
|
||||
|
||||
|
@ -423,7 +423,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
||||
uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
|
||||
}
|
||||
|
||||
Timber.v("## getNotificationRingTone() returns " + uri!!)
|
||||
Timber.v("## getNotificationRingTone() returns $uri")
|
||||
return uri
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user