Skip to content

Commit

Permalink
Code fluff
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rken committed Aug 20, 2023
1 parent 414aa65 commit 3d238f8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.graphics.drawable.Drawable
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import eu.darken.myperm.R
import eu.darken.myperm.apps.core.Pkg
Expand Down Expand Up @@ -54,11 +55,13 @@ fun Installed.isSideloaded(): Boolean {
suspend fun PackageInfo.getInstallerInfo(
ipcFunnel: IPCFunnel,
): InstallerInfo = if (hasApiLevel(Build.VERSION_CODES.R)) {
@Suppress("NewApi")
getInstallerInfoApi30(ipcFunnel)
} else {
getInstallerInfoLegacy(ipcFunnel)
}

@RequiresApi(Build.VERSION_CODES.R)
private suspend fun PackageInfo.getInstallerInfoApi30(ipcFunnel: IPCFunnel): InstallerInfo {
val sourceInfo = try {
ipcFunnel.packageManager.getInstallSourceInfo(packageName)
Expand Down

0 comments on commit 3d238f8

Please sign in to comment.