mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 22:37:56 +01:00 
			
		
		
		
	Use .toUri() extension function
				
					
				
			This commit is contained in:
		| @@ -44,6 +44,7 @@ import tachiyomi.presentation.core.i18n.stringResource | ||||
| import tachiyomi.presentation.core.util.collectAsState | ||||
| import tachiyomi.presentation.core.util.secondaryItemAlpha | ||||
| import uy.kohesive.injekt.injectLazy | ||||
| import androidx.core.net.toUri | ||||
|  | ||||
| internal class PermissionStep : OnboardingStep { | ||||
|  | ||||
| @@ -112,7 +113,7 @@ internal class PermissionStep : OnboardingStep { | ||||
|                 onButtonClick = { | ||||
|                     @SuppressLint("BatteryLife") | ||||
|                     val intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS).apply { | ||||
|                         data = Uri.parse("package:${context.packageName}") | ||||
|                         data = "package:${context.packageName}".toUri() | ||||
|                     } | ||||
|                     context.startActivity(intent) | ||||
|                 }, | ||||
|   | ||||
| @@ -54,6 +54,7 @@ import uy.kohesive.injekt.api.get | ||||
| import java.io.File | ||||
| import kotlin.time.Duration.Companion.hours | ||||
| import kotlin.time.Duration.Companion.seconds | ||||
| import androidx.core.net.toUri | ||||
|  | ||||
| /** | ||||
|  * Cache where we dump the downloads directory from the filesystem. This class is needed because | ||||
| @@ -454,7 +455,7 @@ private object UniFileAsStringSerializer : KSerializer<UniFile?> { | ||||
|  | ||||
|     override fun deserialize(decoder: Decoder): UniFile? { | ||||
|         return if (decoder.decodeNotNullMark()) { | ||||
|             UniFile.fromUri(Injekt.get<Application>(), Uri.parse(decoder.decodeString())) | ||||
|             UniFile.fromUri(Injekt.get<Application>(), decoder.decodeString().toUri()) | ||||
|         } else { | ||||
|             decoder.decodeNull() | ||||
|         } | ||||
|   | ||||
| @@ -14,6 +14,7 @@ import kotlinx.coroutines.SupervisorJob | ||||
| import kotlinx.coroutines.launch | ||||
| import logcat.LogPriority | ||||
| import tachiyomi.core.common.util.system.logcat | ||||
| import androidx.core.net.toUri | ||||
|  | ||||
| /** | ||||
|  * Broadcast receiver that listens for the system's packages installed, updated or removed, and only | ||||
| @@ -138,7 +139,7 @@ internal class ExtensionInstallReceiver(private val listener: Listener) : Broadc | ||||
|  | ||||
|         private fun notify(context: Context, pkgName: String, action: String) { | ||||
|             Intent(action).apply { | ||||
|                 data = Uri.parse("package:$pkgName") | ||||
|                 data = "package:$pkgName".toUri() | ||||
|                 `package` = context.packageName | ||||
|                 context.sendBroadcast(this) | ||||
|             } | ||||
|   | ||||
| @@ -158,7 +158,7 @@ val Context.isShizukuInstalled get() = isPackageInstalled("moe.shizuku.privilege | ||||
|  | ||||
| fun Context.launchRequestPackageInstallsPermission() { | ||||
|     Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES).apply { | ||||
|         data = Uri.parse("package:$packageName") | ||||
|         data = "package:$packageName".toUri() | ||||
|         startActivity(this) | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user