mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-29 13:27:57 +01:00
Formatting
This commit is contained in:
@@ -50,8 +50,8 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam
|
||||
context.resources.getQuantityString(
|
||||
R.plurals.update_check_notification_ext_updates,
|
||||
names.size,
|
||||
names.size
|
||||
)
|
||||
names.size,
|
||||
),
|
||||
)
|
||||
val extNames = names.joinToString(", ")
|
||||
setContentText(extNames)
|
||||
@@ -59,7 +59,7 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam
|
||||
setSmallIcon(R.drawable.ic_extension_24dp)
|
||||
setContentIntent(NotificationReceiver.openExtensionsPendingActivity(context))
|
||||
setAutoCancel(true)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam
|
||||
2,
|
||||
TimeUnit.DAYS,
|
||||
3,
|
||||
TimeUnit.HOURS
|
||||
TimeUnit.HOURS,
|
||||
)
|
||||
.addTag(TAG)
|
||||
.setConstraints(constraints)
|
||||
|
||||
@@ -85,7 +85,7 @@ internal class ExtensionGithubApi {
|
||||
hasChangelog = it.hasChangelog == 1,
|
||||
sources = it.sources?.toExtensionSources() ?: emptyList(),
|
||||
apkName = it.apk,
|
||||
iconUrl = "${REPO_URL_PREFIX}icon/${it.apk.replace(".apk", ".png")}"
|
||||
iconUrl = "${REPO_URL_PREFIX}icon/${it.apk.replace(".apk", ".png")}",
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ internal class ExtensionGithubApi {
|
||||
AvailableExtensionSources(
|
||||
name = it.name,
|
||||
id = it.id,
|
||||
baseUrl = it.baseUrl
|
||||
baseUrl = it.baseUrl,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ class PackageInstallerInstaller(private val service: Service) : Installer(servic
|
||||
service,
|
||||
activeSession!!.second,
|
||||
Intent(INSTALL_ACTION),
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) PendingIntent.FLAG_MUTABLE else 0
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) PendingIntent.FLAG_MUTABLE else 0,
|
||||
).intentSender
|
||||
session.commit(intentSender)
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ internal class ExtensionInstaller(private val context: Context) {
|
||||
downloadManager.query(query).use { cursor ->
|
||||
if (cursor.moveToFirst()) {
|
||||
val localUri = cursor.getString(
|
||||
cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_LOCAL_URI)
|
||||
cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_LOCAL_URI),
|
||||
).removePrefix(FILE_SCHEME)
|
||||
|
||||
installApk(id, File(localUri).getUriCompat(context))
|
||||
|
||||
@@ -120,7 +120,7 @@ internal object ExtensionLoader {
|
||||
if (libVersion < LIB_VERSION_MIN || libVersion > LIB_VERSION_MAX) {
|
||||
val exception = Exception(
|
||||
"Lib version is $libVersion, while only versions " +
|
||||
"$LIB_VERSION_MIN to $LIB_VERSION_MAX are allowed"
|
||||
"$LIB_VERSION_MIN to $LIB_VERSION_MAX are allowed",
|
||||
)
|
||||
logcat(LogPriority.WARN, exception)
|
||||
return LoadResult.Error(exception)
|
||||
@@ -190,7 +190,7 @@ internal object ExtensionLoader {
|
||||
sources = sources,
|
||||
pkgFactory = appInfo.metaData.getString(METADATA_SOURCE_FACTORY),
|
||||
isUnofficial = signatureHash != officialSignature,
|
||||
icon = context.getApplicationIcon(pkgName)
|
||||
icon = context.getApplicationIcon(pkgName),
|
||||
)
|
||||
return LoadResult.Success(extension)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user