Revert "Prevent crash"

This reverts commit dad1cc0058.
This commit is contained in:
M66B 2022-03-26 15:33:41 +01:00
parent 2bb9ae2dc3
commit 10b299aca7
1 changed files with 0 additions and 30 deletions

View File

@ -2974,36 +2974,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
static void scheduleWatchdog(Context context) { static void scheduleWatchdog(Context context) {
try { try {
if (Helper.isXiaomi() &&
Build.VERSION.SDK_INT == 30 /* Android 11 */) {
/*
java.lang.RuntimeException: Unable to create application eu.faircode.email.ApplicationEx: java.lang.SecurityException: Too many PendingIntent created for uid 10188, aborting Key{startForegroundService pkg=eu.faircode.email intent=act=watchdog cmp=eu.faircode.email/.ServiceSynchronize flags=0x4000000 u=0} requestCode=6
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7019)
at android.app.ActivityThread.access$1600(ActivityThread.java:263)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2034)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:8057)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)
Caused by: java.lang.SecurityException: Too many PendingIntent created for uid 10188, aborting Key{startForegroundService pkg=eu.faircode.email intent=act=watchdog cmp=eu.faircode.email/.ServiceSynchronize flags=0x4000000 u=0} requestCode=6
at android.os.Parcel.createExceptionOrNull(Parcel.java:2376)
at android.os.Parcel.createException(Parcel.java:2360)
at android.os.Parcel.readException(Parcel.java:2343)
at android.os.Parcel.readException(Parcel.java:2285)
at android.app.IActivityManager$Stub$Proxy.getIntentSenderWithFeature(IActivityManager.java:6884)
at android.app.PendingIntent.buildServicePendingIntent(PendingIntent.java:657)
at android.app.PendingIntent.getForegroundService(PendingIntent.java:645)
at eu.faircode.email.PendingIntentCompat.getForegroundService(SourceFile:2)
at eu.faircode.email.ServiceSynchronize.scheduleWatchdog(SourceFile:5)
at eu.faircode.email.ApplicationEx.onCreate(SourceFile:37)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7014)
*/
return;
}
Intent intent = new Intent(context, ServiceSynchronize.class) Intent intent = new Intent(context, ServiceSynchronize.class)
.setAction("watchdog"); .setAction("watchdog");
PendingIntent pi; PendingIntent pi;