From 9a14d0f10cd0d7f6f6a84d6bb6ed82ac1d7429e9 Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Sat, 23 Oct 2021 19:21:29 -0700 Subject: [PATCH] Add background updates on Android 12 --- app/src/main/AndroidManifest.xml | 1 + app/src/main/java/com/vanced/manager/utils/PackageHelper.kt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 253ccee0d2..db8ff3480c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ + diff --git a/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt b/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt index 6141a52419..37fc618e90 100644 --- a/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt +++ b/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt @@ -163,6 +163,9 @@ object PackageHelper { val packageInstaller = context.packageManager.packageInstaller val params = PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + params.setRequireUserAction(PackageInstaller.SessionParams.USER_ACTION_NOT_REQUIRED) + } val sessionId: Int var session: PackageInstaller.Session? = null try {