Rename unused caught exceptions to _
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user