Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Commit

Permalink
Add background updates on Android 12
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed Oct 24, 2021
1 parent 25f8f80 commit 9a14d0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNET" />

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/vanced/manager/utils/PackageHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9a14d0f

Please sign in to comment.