mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-08 00:39:54 +00:00
Fix: Crash on A12 (closes #51)
This commit is contained in:
parent
129381d2f8
commit
50f40d8f3a
@ -7,6 +7,7 @@ import android.content.BroadcastReceiver
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.os.Build
|
||||||
import android.view.ContextThemeWrapper
|
import android.view.ContextThemeWrapper
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import com.looker.droidify.BuildConfig
|
import com.looker.droidify.BuildConfig
|
||||||
@ -223,7 +224,10 @@ class DownloadService : ConnectionService<DownloadService.Binder>() {
|
|||||||
0,
|
0,
|
||||||
Intent(this, Receiver::class.java)
|
Intent(this, Receiver::class.java)
|
||||||
.setAction("$ACTION_OPEN.${task.packageName}"),
|
.setAction("$ACTION_OPEN.${task.packageName}"),
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
else
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.apply {
|
.apply {
|
||||||
@ -287,7 +291,10 @@ class DownloadService : ConnectionService<DownloadService.Binder>() {
|
|||||||
Intent(this, Receiver::class.java)
|
Intent(this, Receiver::class.java)
|
||||||
.setAction("$ACTION_INSTALL.${task.packageName}")
|
.setAction("$ACTION_INSTALL.${task.packageName}")
|
||||||
.putExtra(EXTRA_CACHE_FILE_NAME, task.release.cacheFileName),
|
.putExtra(EXTRA_CACHE_FILE_NAME, task.release.cacheFileName),
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
else
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.setContentTitle(getString(R.string.downloaded_FORMAT, task.name))
|
.setContentTitle(getString(R.string.downloaded_FORMAT, task.name))
|
||||||
@ -308,7 +315,10 @@ class DownloadService : ConnectionService<DownloadService.Binder>() {
|
|||||||
Intent(this, Receiver::class.java)
|
Intent(this, Receiver::class.java)
|
||||||
.setAction("$ACTION_INSTALL.${task.packageName}")
|
.setAction("$ACTION_INSTALL.${task.packageName}")
|
||||||
.putExtra(EXTRA_CACHE_FILE_NAME, task.release.cacheFileName),
|
.putExtra(EXTRA_CACHE_FILE_NAME, task.release.cacheFileName),
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
else
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
)
|
)
|
||||||
.send()
|
.send()
|
||||||
} else showNotificationInstall(task)
|
} else showNotificationInstall(task)
|
||||||
@ -375,7 +385,10 @@ class DownloadService : ConnectionService<DownloadService.Binder>() {
|
|||||||
this,
|
this,
|
||||||
0,
|
0,
|
||||||
Intent(this, this::class.java).setAction(ACTION_CANCEL),
|
Intent(this, this::class.java).setAction(ACTION_CANCEL),
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
else
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import android.app.job.JobParameters
|
|||||||
import android.app.job.JobService
|
import android.app.job.JobService
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.os.Build
|
||||||
import android.text.SpannableStringBuilder
|
import android.text.SpannableStringBuilder
|
||||||
import android.text.style.ForegroundColorSpan
|
import android.text.style.ForegroundColorSpan
|
||||||
import android.view.ContextThemeWrapper
|
import android.view.ContextThemeWrapper
|
||||||
@ -250,7 +251,10 @@ class SyncService : ConnectionService<SyncService.Binder>() {
|
|||||||
this,
|
this,
|
||||||
0,
|
0,
|
||||||
Intent(this, this::class.java).setAction(ACTION_CANCEL),
|
Intent(this, this::class.java).setAction(ACTION_CANCEL),
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
else
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -436,7 +440,10 @@ class SyncService : ConnectionService<SyncService.Binder>() {
|
|||||||
0,
|
0,
|
||||||
Intent(this, MainActivity::class.java)
|
Intent(this, MainActivity::class.java)
|
||||||
.setAction(MainActivity.ACTION_UPDATES),
|
.setAction(MainActivity.ACTION_UPDATES),
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
else
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.setStyle(NotificationCompat.InboxStyle().applyHack {
|
.setStyle(NotificationCompat.InboxStyle().applyHack {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user