Platform: Switch all extensions to property access syntax

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2024-10-28 11:53:54 +05:30
parent 74f1d09f88
commit e2f2188e60
22 changed files with 94 additions and 118 deletions

View File

@@ -116,7 +116,7 @@ fun Context.getStyledAttributeColor(id: Int): Int {
}
fun Context.isIgnoringBatteryOptimizations(): Boolean {
return if (isMAndAbove()) {
return if (isMAndAbove) {
(getSystemService<PowerManager>())?.isIgnoringBatteryOptimizations(packageName) ?: true
} else {
true
@@ -124,7 +124,7 @@ fun Context.isIgnoringBatteryOptimizations(): Boolean {
}
fun Context.areNotificationsEnabled(): Boolean {
return if (isNAndAbove()) {
return if (isNAndAbove) {
getSystemService<NotificationManager>()!!.areNotificationsEnabled()
} else {
true
@@ -136,7 +136,7 @@ fun Context.checkManifestPermission(permission: String): Boolean {
}
fun Context.isExternalStorageAccessible(): Boolean {
return if (isRAndAbove()) {
return if (isRAndAbove) {
Environment.isExternalStorageManager()
} else {
checkManifestPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
@@ -144,7 +144,7 @@ fun Context.isExternalStorageAccessible(): Boolean {
}
fun Context.isDomainVerified(domain: String): Boolean {
return if (isSAndAbove()) {
return if (isSAndAbove) {
val domainVerificationManager = getSystemService<DomainVerificationManager>()
val userState = domainVerificationManager!!.getDomainVerificationUserState(packageName)
val domainMap = userState?.hostToStateMap?.filterKeys { it == domain }