ktlint: Format all extensions

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2025-12-30 15:53:26 +08:00
parent a084a57619
commit 13c9b946af
11 changed files with 143 additions and 149 deletions

View File

@@ -13,18 +13,26 @@ fun PackageInfo.isValidApp(packageManager: PackageManager): Boolean {
// Filter out core AOSP system apps
if (this.applicationInfo!!.flags and ApplicationInfo.FLAG_SYSTEM != 0) {
if (this.packageName.endsWith(".resources")) return false
if (this.applicationInfo!!.loadLabel(packageManager).startsWith(this.packageName)) return false
if (this.applicationInfo!!.loadLabel(packageManager).startsWith(this.packageName)) {
return false
}
if (this.versionName?.endsWith("system image") == true) return false
if (this.versionName?.endsWith("-initial") == true) return false
if (this.versionName == Build.VERSION.RELEASE && PackageInfoCompat.getLongVersionCode(this) == Build.VERSION.SDK_INT.toLong()) return false
if (this.versionName == Build.VERSION.RELEASE &&
PackageInfoCompat.getLongVersionCode(this) == Build.VERSION.SDK_INT.toLong()
) {
return false
}
}
return when {
isQAndAbove -> {
Process.isApplicationUid(this.applicationInfo!!.uid) &&
!this.applicationInfo!!.isResourceOverlay && !this.isApex
!this.applicationInfo!!.isResourceOverlay && !this.isApex
}
isNAndAbove -> Process.isApplicationUid(this.applicationInfo!!.uid)
else -> this.versionName != null
}
}