Rename unused caught exceptions to _

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2026-01-01 13:05:19 +08:00
parent 0f09429a97
commit 5d28591d8e
5 changed files with 8 additions and 8 deletions

View File

@@ -72,7 +72,7 @@ class BlacklistProvider @Inject constructor(
} else {
json.decodeFromString<MutableSet<String>>(rawBlacklist)
}
} catch (e: Exception) {
} catch (_: Exception) {
mutableSetOf()
}
}

View File

@@ -144,7 +144,7 @@ object PackageUtil {
fun isArchived(context: Context, packageName: String): Boolean = try {
isVAndAbove && context.packageManager.getArchivedPackage(packageName) != null
} catch (e: Exception) {
} catch (_: Exception) {
false
}
@@ -178,7 +178,7 @@ object PackageUtil {
return try {
val packageInfo = getPackageInfo(context, packageName)
return versionCode > PackageInfoCompat.getLongVersionCode(packageInfo)
} catch (e: PackageManager.NameNotFoundException) {
} catch (_: PackageManager.NameNotFoundException) {
false
}
}
@@ -194,13 +194,13 @@ object PackageUtil {
fun getInstalledVersionName(context: Context, packageName: String): String = try {
getPackageInfo(context, packageName).versionName ?: ""
} catch (e: PackageManager.NameNotFoundException) {
} catch (_: PackageManager.NameNotFoundException) {
""
}
fun getInstalledVersionCode(context: Context, packageName: String): Long = try {
PackageInfoCompat.getLongVersionCode(getPackageInfo(context, packageName))
} catch (e: PackageManager.NameNotFoundException) {
} catch (_: PackageManager.NameNotFoundException) {
0
}

View File

@@ -44,7 +44,7 @@ class DeviceMiuiSheet : BaseDialogSheet<SheetDeviceMiuiBinding>() {
binding.btnPrimary.setOnClickListener {
try {
startActivity(Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS))
} catch (e: Exception) {
} catch (_: Exception) {
toast(R.string.toast_developer_setting_failed)
}
}

View File

@@ -345,7 +345,7 @@ class AppDetailsViewModel @Inject constructor(
val exodusReport = json.decodeFromString<ExodusReport>(exodusObject.toString())
return exodusReport.reports
} catch (e: Exception) {
} catch (_: Exception) {
return emptyList()
}
}