mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-07 16:29:55 +00:00
Make auto-update default on Android 12+ & stop background prompts.
Sets preference for auto updates to true by default if device runs Android 12 and later. Reverts change allowing the install prompt to show up from the background and instead require the notification on all Android versions.
This commit is contained in:
parent
fce311098d
commit
e1fc3c656a
@ -132,7 +132,7 @@ object Preferences {
|
||||
Value.EnumerationValue(Preferences.AutoSync.Wifi)
|
||||
)
|
||||
object AutoSyncInstall :
|
||||
Key<Boolean>("auto_sync_install", Value.BooleanValue(true))
|
||||
Key<Boolean>("auto_sync_install", Value.BooleanValue(Android.sdk(31)))
|
||||
|
||||
object IncompatibleVersions :
|
||||
Key<Boolean>("incompatible_versions", Value.BooleanValue(false))
|
||||
|
@ -32,9 +32,8 @@ class InstallerService : Service() {
|
||||
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
|
||||
val status = intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -1)
|
||||
|
||||
// only trigger a prompt if in foreground or below Android 10, otherwise make notification
|
||||
// launching a prompt in the background will fail silently
|
||||
if ((!Android.sdk(29) || Utils.inForeground()) && status == PackageInstaller.STATUS_PENDING_USER_ACTION) {
|
||||
// only trigger a prompt if in foreground, otherwise make notification
|
||||
if (Utils.inForeground() && status == PackageInstaller.STATUS_PENDING_USER_ACTION) {
|
||||
// Triggers the installer prompt and "unknown apps" prompt if needed
|
||||
val promptIntent: Intent? = intent.getParcelableExtra(Intent.EXTRA_INTENT)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user