Run default Android Studio formatter on code

This commit is contained in:
arkon
2020-02-17 17:23:37 -05:00
parent a1fadce7c6
commit 3ecc883944
109 changed files with 640 additions and 585 deletions
@@ -206,7 +206,7 @@ class ExtensionManager(
*
* @param extension The extension to be updated.
*/
fun updateExtension(extension: Extension.Installed): Observable<InstallStep> {
fun updateExtension(extension: Extension.Installed): Observable<InstallStep> {
val availableExt = availableExtensions.find { it.pkgName == extension.pkgName }
?: return Observable.empty()
return installExtension(availableExt)
@@ -25,7 +25,7 @@ internal class ExtensionGithubApi {
val call = GET("$REPO_URL/index.json")
return withContext(Dispatchers.IO) {
parseResponse(network.client.newCall(call).await())
parseResponse(network.client.newCall(call).await())
}
}
@@ -31,12 +31,13 @@ internal class ExtensionInstallReceiver(private val listener: Listener) :
/**
* Returns the intent filter this receiver should subscribe to.
*/
private val filter get() = IntentFilter().apply {
addAction(Intent.ACTION_PACKAGE_ADDED)
addAction(Intent.ACTION_PACKAGE_REPLACED)
addAction(Intent.ACTION_PACKAGE_REMOVED)
addDataScheme("package")
}
private val filter
get() = IntentFilter().apply {
addAction(Intent.ACTION_PACKAGE_ADDED)
addAction(Intent.ACTION_PACKAGE_REPLACED)
addAction(Intent.ACTION_PACKAGE_REMOVED)
addDataScheme("package")
}
/**
* Called when one of the events of the [filter] is received. When the package is an extension,
@@ -61,7 +62,8 @@ internal class ExtensionInstallReceiver(private val listener: Listener) :
when (result) {
is LoadResult.Success -> listener.onExtensionUpdated(result.extension)
// Not needed as a package can't be upgraded if the signature is different
is LoadResult.Untrusted -> {}
is LoadResult.Untrusted -> {
}
}
}
}
@@ -92,8 +94,8 @@ internal class ExtensionInstallReceiver(private val listener: Listener) :
* @param intent The intent containing the package name of the extension.
*/
private suspend fun getExtensionFromIntent(context: Context, intent: Intent?): LoadResult {
val pkgName = getPackageNameFromIntent(intent) ?:
return LoadResult.Error("Package name not found")
val pkgName = getPackageNameFromIntent(intent)
?: return LoadResult.Error("Package name not found")
return GlobalScope.async(Dispatchers.Default, CoroutineStart.DEFAULT) { ExtensionLoader.loadExtensionFromPkgName(context, pkgName) }.await()
}
@@ -95,8 +95,8 @@ internal object ExtensionLoader {
return LoadResult.Error(error)
}
val extName = pkgManager.getApplicationLabel(appInfo)?.toString()
.orEmpty().substringAfter("Tachiyomi: ")
val extName = pkgManager.getApplicationLabel(appInfo).toString()
.orEmpty().substringAfter("Tachiyomi: ")
val versionName = pkgInfo.versionName
val versionCode = pkgInfo.versionCode