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

@@ -153,7 +153,7 @@ class InstallerStatusReceiver : BaseInstallerStatusReceiver() {
Log.i(TAG, "Huawei silent install support function: $supportFunction") Log.i(TAG, "Huawei silent install support function: $supportFunction")
(supportFunction and (1 shl 5)) != 0 (supportFunction and (1 shl 5)) != 0
} catch (e: Exception) { } catch (_: Exception) {
false false
} }
} }

View File

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

View File

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

View File

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

View File

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