mirror of https://github.com/M66B/FairEmail.git
Prevent crash
This commit is contained in:
parent
faa71279e4
commit
b5a61240b0
|
@ -874,6 +874,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
try {
|
||||
String action = (intent == null ? null : intent.getAction());
|
||||
String reason = (intent == null ? null : intent.getStringExtra("reason"));
|
||||
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Scheduling,
|
||||
|
@ -889,8 +890,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
startForeground(NotificationHelper.NOTIFICATION_SYNCHRONIZE,
|
||||
getNotificationService(null, null).build());
|
||||
|
||||
if (action != null)
|
||||
try {
|
||||
if (action != null) {
|
||||
switch (action.split(":")[0]) {
|
||||
case "enable":
|
||||
onEnable(intent);
|
||||
|
@ -936,8 +936,20 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
default:
|
||||
Log.w("Unknown action: " + action);
|
||||
}
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
/*
|
||||
at android.app.ApplicationPackageManager.getUserIfProfile(ApplicationPackageManager.java:2190)
|
||||
at android.app.ApplicationPackageManager.getUserBadgeForDensity(ApplicationPackageManager.java:1006)
|
||||
at android.app.Notification$Builder.getProfileBadgeDrawable(Notification.java:2890)
|
||||
at android.app.Notification$Builder.hasThreeLines(Notification.java:3105)
|
||||
at android.app.Notification$Builder.build(Notification.java:3659)
|
||||
at androidx.core.app.NotificationCompatBuilder.buildInternal(NotificationCompatBuilder:426)
|
||||
at androidx.core.app.NotificationCompatBuilder.build(NotificationCompatBuilder:318)
|
||||
at androidx.core.app.NotificationCompat$Builder.build(NotificationCompat:2346)
|
||||
at eu.faircode.email.ServiceSynchronize.onStartCommand(ServiceSynchronize:890)
|
||||
*/
|
||||
}
|
||||
|
||||
return START_STICKY;
|
||||
|
|
Loading…
Reference in New Issue