mirror of https://github.com/M66B/FairEmail.git
Prevent crash
This commit is contained in:
parent
fc33f471bb
commit
d8a15daa82
|
@ -134,11 +134,27 @@ public class Widget extends AppWidgetProvider {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, Widget.class));
|
try {
|
||||||
|
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, Widget.class));
|
||||||
|
|
||||||
Intent intent = new Intent(context, Widget.class);
|
Intent intent = new Intent(context, Widget.class);
|
||||||
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
|
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
|
||||||
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
|
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
|
||||||
context.sendBroadcast(intent);
|
context.sendBroadcast(intent);
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.e(ex);
|
||||||
|
/*
|
||||||
|
java.lang.RuntimeException: system server dead?
|
||||||
|
at android.appwidget.AppWidgetManager.getAppWidgetIds(AppWidgetManager.java:1053)
|
||||||
|
at eu.faircode.email.Widget.update(SourceFile:111)
|
||||||
|
at eu.faircode.email.ServiceSynchronize$6.onChanged(SourceFile:460)
|
||||||
|
at eu.faircode.email.ServiceSynchronize$6.onChanged(SourceFile:439)
|
||||||
|
at androidx.lifecycle.LiveData.considerNotify(SourceFile:131)
|
||||||
|
at androidx.lifecycle.LiveData.dispatchingValue(SourceFile:149)
|
||||||
|
at androidx.lifecycle.LiveData.setValue(SourceFile:307)
|
||||||
|
at androidx.lifecycle.LiveData$1.run(SourceFile:91)
|
||||||
|
Caused by: android.os.DeadObjectException
|
||||||
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,8 +107,24 @@ public class WidgetUnified extends AppWidgetProvider {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, WidgetUnified.class));
|
try {
|
||||||
appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.lv);
|
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context, WidgetUnified.class));
|
||||||
|
appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.lv);
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.e(ex);
|
||||||
|
/*
|
||||||
|
java.lang.RuntimeException: system server dead?
|
||||||
|
at android.appwidget.AppWidgetManager.getAppWidgetIds(AppWidgetManager.java:1053)
|
||||||
|
at eu.faircode.email.Widget.update(SourceFile:111)
|
||||||
|
at eu.faircode.email.ServiceSynchronize$6.onChanged(SourceFile:460)
|
||||||
|
at eu.faircode.email.ServiceSynchronize$6.onChanged(SourceFile:439)
|
||||||
|
at androidx.lifecycle.LiveData.considerNotify(SourceFile:131)
|
||||||
|
at androidx.lifecycle.LiveData.dispatchingValue(SourceFile:149)
|
||||||
|
at androidx.lifecycle.LiveData.setValue(SourceFile:307)
|
||||||
|
at androidx.lifecycle.LiveData$1.run(SourceFile:91)
|
||||||
|
Caused by: android.os.DeadObjectException
|
||||||
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue