2018-08-02 13:33:06 +00:00
|
|
|
package eu.faircode.email;
|
|
|
|
|
|
|
|
/*
|
2018-08-14 05:53:24 +00:00
|
|
|
This file is part of FairEmail.
|
2018-08-02 13:33:06 +00:00
|
|
|
|
2018-08-14 05:53:24 +00:00
|
|
|
FairEmail is free software: you can redistribute it and/or modify
|
2018-08-02 13:33:06 +00:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
2018-10-29 10:46:49 +00:00
|
|
|
FairEmail is distributed in the hope that it will be useful,
|
2018-08-02 13:33:06 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2018-10-29 10:46:49 +00:00
|
|
|
along with FairEmail. If not, see <http://www.gnu.org/licenses/>.
|
2018-08-02 13:33:06 +00:00
|
|
|
|
2020-01-05 17:32:53 +00:00
|
|
|
Copyright 2018-2020 by Marcel Bokhorst (M66B)
|
2018-08-02 13:33:06 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
import android.app.Application;
|
2018-08-15 07:40:18 +00:00
|
|
|
import android.app.Notification;
|
|
|
|
import android.app.NotificationChannel;
|
2019-03-17 18:06:51 +00:00
|
|
|
import android.app.NotificationChannelGroup;
|
2018-08-15 07:40:18 +00:00
|
|
|
import android.app.NotificationManager;
|
2018-12-09 17:49:52 +00:00
|
|
|
import android.content.Context;
|
2019-03-27 10:37:27 +00:00
|
|
|
import android.content.SharedPreferences;
|
|
|
|
import android.content.res.Configuration;
|
2019-03-13 13:42:33 +00:00
|
|
|
import android.webkit.CookieManager;
|
2018-08-03 18:07:12 +00:00
|
|
|
|
2020-01-22 15:18:21 +00:00
|
|
|
import androidx.lifecycle.Observer;
|
2019-05-06 11:59:26 +00:00
|
|
|
import androidx.preference.PreferenceManager;
|
2019-04-17 18:21:44 +00:00
|
|
|
|
2020-01-22 15:18:21 +00:00
|
|
|
import java.util.ArrayList;
|
2019-08-12 11:30:33 +00:00
|
|
|
import java.util.HashMap;
|
2020-01-22 15:18:21 +00:00
|
|
|
import java.util.List;
|
2019-03-27 10:37:27 +00:00
|
|
|
import java.util.Locale;
|
2019-08-12 11:30:33 +00:00
|
|
|
import java.util.Map;
|
2019-05-10 13:44:36 +00:00
|
|
|
|
2018-08-02 13:33:06 +00:00
|
|
|
public class ApplicationEx extends Application {
|
2018-08-03 18:07:12 +00:00
|
|
|
private Thread.UncaughtExceptionHandler prev = null;
|
|
|
|
|
2019-03-27 10:37:27 +00:00
|
|
|
@Override
|
|
|
|
protected void attachBaseContext(Context base) {
|
|
|
|
super.attachBaseContext(getLocalizedContext(base));
|
|
|
|
}
|
|
|
|
|
2020-01-23 07:46:38 +00:00
|
|
|
static Context getLocalizedContext(Context context) {
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
boolean english = prefs.getBoolean("english", false);
|
|
|
|
|
|
|
|
if (english) {
|
|
|
|
Configuration config = new Configuration(context.getResources().getConfiguration());
|
|
|
|
config.setLocale(Locale.US);
|
|
|
|
return context.createConfigurationContext(config);
|
|
|
|
} else
|
|
|
|
return context;
|
|
|
|
}
|
|
|
|
|
2018-08-03 18:07:12 +00:00
|
|
|
@Override
|
|
|
|
public void onCreate() {
|
|
|
|
super.onCreate();
|
2019-05-10 06:53:45 +00:00
|
|
|
|
2019-08-12 11:17:55 +00:00
|
|
|
Log.logMemory(this, "App create version=" + BuildConfig.VERSION_NAME);
|
2018-08-03 18:07:12 +00:00
|
|
|
|
2019-08-11 11:36:18 +00:00
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
|
|
|
final boolean crash_reports = prefs.getBoolean("crash_reports", false);
|
|
|
|
|
2018-08-03 18:07:12 +00:00
|
|
|
prev = Thread.getDefaultUncaughtExceptionHandler();
|
|
|
|
|
|
|
|
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
|
|
|
|
@Override
|
|
|
|
public void uncaughtException(Thread thread, Throwable ex) {
|
2019-08-12 14:18:41 +00:00
|
|
|
if (!crash_reports && Log.isOwnFault(ex)) {
|
2018-12-24 12:27:45 +00:00
|
|
|
Log.e(ex);
|
2018-12-18 16:06:54 +00:00
|
|
|
|
2018-12-28 09:56:40 +00:00
|
|
|
if (BuildConfig.BETA_RELEASE ||
|
2019-09-10 07:05:21 +00:00
|
|
|
!Helper.isPlayStoreInstall())
|
2019-08-12 14:18:41 +00:00
|
|
|
Log.writeCrashLog(ApplicationEx.this, ex);
|
2018-08-08 13:05:43 +00:00
|
|
|
|
2018-09-14 08:31:49 +00:00
|
|
|
if (prev != null)
|
|
|
|
prev.uncaughtException(thread, ex);
|
|
|
|
} else {
|
2018-12-24 12:27:45 +00:00
|
|
|
Log.w(ex);
|
2018-09-14 08:31:49 +00:00
|
|
|
System.exit(1);
|
2018-08-03 18:07:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2018-08-15 07:40:18 +00:00
|
|
|
|
2019-08-12 11:17:55 +00:00
|
|
|
Log.setupBugsnag(this);
|
2019-05-10 13:18:53 +00:00
|
|
|
|
|
|
|
upgrade(this);
|
|
|
|
|
|
|
|
createNotificationChannels();
|
|
|
|
|
2020-01-23 07:46:38 +00:00
|
|
|
setupViewInvalidation();
|
|
|
|
|
2019-05-10 13:18:53 +00:00
|
|
|
if (Helper.hasWebView(this))
|
|
|
|
CookieManager.getInstance().setAcceptCookie(false);
|
|
|
|
|
2019-07-26 15:57:40 +00:00
|
|
|
MessageHelper.setSystemProperties(this);
|
2019-07-24 06:52:38 +00:00
|
|
|
ContactInfo.init(this);
|
2019-06-18 19:20:03 +00:00
|
|
|
|
2019-08-03 13:36:51 +00:00
|
|
|
WorkerWatchdog.init(this);
|
|
|
|
WorkerCleanup.queue(this);
|
2020-01-22 15:18:21 +00:00
|
|
|
|
2020-01-23 07:46:38 +00:00
|
|
|
Log.i("App created");
|
2019-05-10 13:18:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onTrimMemory(int level) {
|
2019-08-12 11:17:55 +00:00
|
|
|
Log.logMemory(this, "Trim memory level=" + level);
|
2019-08-12 11:30:33 +00:00
|
|
|
Map<String, String> crumb = new HashMap<>();
|
|
|
|
crumb.put("level", Integer.toString(level));
|
|
|
|
crumb.put("free", Integer.toString(Log.getFreeMemMb()));
|
|
|
|
Log.breadcrumb("trim", crumb);
|
2019-05-10 13:18:53 +00:00
|
|
|
super.onTrimMemory(level);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onLowMemory() {
|
2019-08-12 11:17:55 +00:00
|
|
|
Log.logMemory(this, "Low memory");
|
2019-08-12 11:30:33 +00:00
|
|
|
Map<String, String> crumb = new HashMap<>();
|
|
|
|
crumb.put("free", Integer.toString(Log.getFreeMemMb()));
|
|
|
|
Log.breadcrumb("low", crumb);
|
2019-05-10 13:18:53 +00:00
|
|
|
super.onLowMemory();
|
|
|
|
}
|
|
|
|
|
2019-05-06 11:59:26 +00:00
|
|
|
static void upgrade(Context context) {
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
2019-07-26 08:23:34 +00:00
|
|
|
int version = prefs.getInt("version", BuildConfig.VERSION_CODE);
|
|
|
|
Log.i("Upgrading from " + version + " to " + BuildConfig.VERSION_CODE);
|
|
|
|
|
2019-07-22 10:31:30 +00:00
|
|
|
SharedPreferences.Editor editor = prefs.edit();
|
|
|
|
|
2019-05-21 12:28:38 +00:00
|
|
|
if (version < 468) {
|
2019-05-06 11:59:26 +00:00
|
|
|
editor.remove("notify_trash");
|
|
|
|
editor.remove("notify_archive");
|
|
|
|
editor.remove("notify_reply");
|
|
|
|
editor.remove("notify_flag");
|
|
|
|
editor.remove("notify_seen");
|
|
|
|
|
2019-07-22 10:31:30 +00:00
|
|
|
} else if (version < 601) {
|
|
|
|
editor.putBoolean("contact_images", prefs.getBoolean("autoimages", true));
|
|
|
|
editor.remove("autoimages");
|
2019-07-26 08:23:34 +00:00
|
|
|
|
|
|
|
} else if (version < 612) {
|
|
|
|
if (prefs.getBoolean("autonext", false))
|
|
|
|
editor.putString("onclose", "next");
|
|
|
|
editor.remove("autonext");
|
2019-09-09 07:31:55 +00:00
|
|
|
|
2019-09-07 15:53:06 +00:00
|
|
|
} else if (version < 693) {
|
|
|
|
editor.remove("message_swipe");
|
|
|
|
editor.remove("message_select");
|
2019-09-09 07:31:55 +00:00
|
|
|
|
|
|
|
} else if (version < 696) {
|
|
|
|
String theme = prefs.getString("theme", "light");
|
|
|
|
if ("grey".equals(theme))
|
|
|
|
editor.putString("theme", "grey_dark");
|
2019-09-09 07:46:54 +00:00
|
|
|
|
|
|
|
if (prefs.contains("ascending")) {
|
|
|
|
editor.putBoolean("ascending_list", prefs.getBoolean("ascending", false));
|
|
|
|
editor.remove("ascending");
|
|
|
|
}
|
2019-09-12 15:33:33 +00:00
|
|
|
|
|
|
|
} else if (version < 701) {
|
|
|
|
if (prefs.getBoolean("suggest_local", false)) {
|
|
|
|
editor.putBoolean("suggest_sent", true);
|
|
|
|
editor.remove("suggest_local");
|
|
|
|
}
|
2019-09-13 09:00:31 +00:00
|
|
|
|
|
|
|
} else if (version < 703) {
|
|
|
|
if (!prefs.getBoolean("style_toolbar", true)) {
|
|
|
|
editor.putBoolean("compose_media", false);
|
|
|
|
editor.remove("style_toolbar");
|
|
|
|
}
|
2019-09-17 09:31:28 +00:00
|
|
|
|
|
|
|
} else if (version < 709) {
|
|
|
|
if (prefs.getBoolean("swipe_reversed", false)) {
|
|
|
|
editor.putBoolean("reversed", true);
|
|
|
|
editor.remove("swipe_reversed");
|
|
|
|
}
|
2019-07-02 08:32:06 +00:00
|
|
|
|
2019-10-02 07:26:32 +00:00
|
|
|
} else if (version < 741)
|
|
|
|
editor.remove("send_dialog");
|
2019-09-26 18:44:32 +00:00
|
|
|
|
2019-10-06 19:01:01 +00:00
|
|
|
else if (version < 751) {
|
|
|
|
if (prefs.contains("notify_snooze_duration")) {
|
|
|
|
int minutes = prefs.getInt("notify_snooze_duration", 60);
|
|
|
|
int hours = (int) Math.ceil(minutes / 60.0);
|
|
|
|
editor.putInt("default_snooze", hours);
|
|
|
|
editor.remove("notify_snooze_duration");
|
|
|
|
}
|
2019-11-15 13:27:28 +00:00
|
|
|
|
|
|
|
} else if (version < 819) {
|
|
|
|
if (prefs.contains("no_history")) {
|
|
|
|
editor.putBoolean("secure", prefs.getBoolean("no_history", false));
|
|
|
|
editor.remove("no_history");
|
|
|
|
}
|
2019-11-15 15:08:03 +00:00
|
|
|
|
|
|
|
if (prefs.contains("zoom")) {
|
|
|
|
int zoom = prefs.getInt("zoom", 1);
|
|
|
|
editor.putInt("view_zoom", zoom);
|
|
|
|
editor.putInt("compose_zoom", zoom);
|
|
|
|
editor.remove("zoom");
|
|
|
|
}
|
2019-12-12 16:51:39 +00:00
|
|
|
|
|
|
|
} else if (version < 844) {
|
|
|
|
if (prefs.getBoolean("schedule", false))
|
|
|
|
editor.putBoolean("enabled", true);
|
2019-12-30 10:44:09 +00:00
|
|
|
|
|
|
|
} else if (version < 874) {
|
|
|
|
if (prefs.contains("experiments") &&
|
|
|
|
prefs.getBoolean("experiments", false))
|
|
|
|
editor.putBoolean("quick_filter", true);
|
|
|
|
editor.remove("experiments");
|
2020-01-07 14:49:34 +00:00
|
|
|
|
|
|
|
} else if (version < 889) {
|
|
|
|
if (prefs.contains("autoresize")) {
|
|
|
|
boolean autoresize = prefs.getBoolean("autoresize", true);
|
|
|
|
editor.putBoolean("resize_images", autoresize);
|
|
|
|
editor.putBoolean("resize_attachments", autoresize);
|
|
|
|
editor.remove("autoresize");
|
|
|
|
}
|
2019-10-06 19:01:01 +00:00
|
|
|
}
|
|
|
|
|
2019-09-26 18:44:32 +00:00
|
|
|
if (BuildConfig.DEBUG && false) {
|
|
|
|
editor.remove("app_support");
|
|
|
|
editor.remove("notify_archive");
|
|
|
|
editor.remove("message_swipe");
|
|
|
|
editor.remove("message_select");
|
|
|
|
editor.remove("folder_actions");
|
|
|
|
editor.remove("folder_sync");
|
|
|
|
}
|
|
|
|
|
2019-12-22 07:47:32 +00:00
|
|
|
if (version < BuildConfig.VERSION_CODE)
|
|
|
|
editor.putInt("previous_version", version);
|
2019-07-22 10:31:30 +00:00
|
|
|
editor.putInt("version", BuildConfig.VERSION_CODE);
|
|
|
|
|
|
|
|
editor.apply();
|
2019-05-06 11:59:26 +00:00
|
|
|
}
|
|
|
|
|
2018-09-14 08:31:49 +00:00
|
|
|
private void createNotificationChannels() {
|
2018-08-15 07:40:18 +00:00
|
|
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
2018-12-09 17:49:52 +00:00
|
|
|
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
2018-08-15 07:40:18 +00:00
|
|
|
|
2019-07-08 18:00:19 +00:00
|
|
|
// Sync
|
2018-08-15 07:40:18 +00:00
|
|
|
NotificationChannel service = new NotificationChannel(
|
2019-06-09 18:51:02 +00:00
|
|
|
"service", getString(R.string.channel_service),
|
2018-08-15 07:40:18 +00:00
|
|
|
NotificationManager.IMPORTANCE_MIN);
|
|
|
|
service.setSound(null, Notification.AUDIO_ATTRIBUTES_DEFAULT);
|
2018-10-06 20:58:32 +00:00
|
|
|
service.setShowBadge(false);
|
2018-11-06 10:18:46 +00:00
|
|
|
service.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
|
2018-08-15 07:40:18 +00:00
|
|
|
nm.createNotificationChannel(service);
|
|
|
|
|
2019-07-08 18:00:19 +00:00
|
|
|
// Send
|
2019-06-09 18:51:02 +00:00
|
|
|
NotificationChannel send = new NotificationChannel(
|
|
|
|
"send", getString(R.string.channel_send),
|
2019-06-10 06:22:09 +00:00
|
|
|
NotificationManager.IMPORTANCE_DEFAULT);
|
2019-06-09 18:51:02 +00:00
|
|
|
send.setSound(null, Notification.AUDIO_ATTRIBUTES_DEFAULT);
|
|
|
|
send.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
|
|
|
nm.createNotificationChannel(send);
|
|
|
|
|
2019-07-08 18:00:19 +00:00
|
|
|
// Notify
|
2018-08-15 07:40:18 +00:00
|
|
|
NotificationChannel notification = new NotificationChannel(
|
2019-06-09 18:51:02 +00:00
|
|
|
"notification", getString(R.string.channel_notification),
|
2018-11-05 07:48:02 +00:00
|
|
|
NotificationManager.IMPORTANCE_HIGH);
|
2018-11-06 10:18:46 +00:00
|
|
|
notification.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
2019-06-07 05:58:41 +00:00
|
|
|
notification.enableLights(true);
|
2018-08-15 07:40:18 +00:00
|
|
|
nm.createNotificationChannel(notification);
|
|
|
|
|
2019-07-08 18:00:19 +00:00
|
|
|
// Update
|
2019-09-10 07:05:21 +00:00
|
|
|
if (!Helper.isPlayStoreInstall()) {
|
2019-06-23 13:17:45 +00:00
|
|
|
NotificationChannel update = new NotificationChannel(
|
|
|
|
"update", getString(R.string.channel_update),
|
|
|
|
NotificationManager.IMPORTANCE_HIGH);
|
2019-07-08 18:00:19 +00:00
|
|
|
update.setSound(null, Notification.AUDIO_ATTRIBUTES_DEFAULT);
|
2019-06-23 13:17:45 +00:00
|
|
|
update.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
|
|
|
nm.createNotificationChannel(update);
|
|
|
|
}
|
|
|
|
|
2019-12-10 10:51:03 +00:00
|
|
|
// Warnings
|
2019-01-23 08:44:25 +00:00
|
|
|
NotificationChannel warning = new NotificationChannel(
|
2019-06-09 18:51:02 +00:00
|
|
|
"warning", getString(R.string.channel_warning),
|
2019-01-23 08:44:25 +00:00
|
|
|
NotificationManager.IMPORTANCE_HIGH);
|
|
|
|
warning.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
|
|
|
nm.createNotificationChannel(warning);
|
|
|
|
|
2019-12-10 10:51:03 +00:00
|
|
|
// Errors
|
2018-08-15 07:40:18 +00:00
|
|
|
NotificationChannel error = new NotificationChannel(
|
|
|
|
"error",
|
|
|
|
getString(R.string.channel_error),
|
|
|
|
NotificationManager.IMPORTANCE_HIGH);
|
2019-01-23 08:44:25 +00:00
|
|
|
error.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
2018-08-15 07:40:18 +00:00
|
|
|
nm.createNotificationChannel(error);
|
2019-03-17 18:06:51 +00:00
|
|
|
|
2019-12-10 10:51:03 +00:00
|
|
|
// Server alerts
|
|
|
|
NotificationChannel alerts = new NotificationChannel(
|
|
|
|
"alerts",
|
|
|
|
getString(R.string.channel_alert),
|
|
|
|
NotificationManager.IMPORTANCE_HIGH);
|
|
|
|
alerts.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
|
|
|
|
nm.createNotificationChannel(alerts);
|
|
|
|
|
2019-07-08 18:00:19 +00:00
|
|
|
// Contacts grouping
|
2019-03-17 18:06:51 +00:00
|
|
|
NotificationChannelGroup group = new NotificationChannelGroup(
|
|
|
|
"contacts",
|
|
|
|
getString(R.string.channel_group_contacts));
|
|
|
|
nm.createNotificationChannelGroup(group);
|
2018-08-15 07:40:18 +00:00
|
|
|
}
|
2018-08-03 18:07:12 +00:00
|
|
|
}
|
2018-09-14 08:31:49 +00:00
|
|
|
|
2020-01-23 07:46:38 +00:00
|
|
|
private void setupViewInvalidation() {
|
|
|
|
DB db = DB.getInstance(this);
|
2018-09-14 08:31:49 +00:00
|
|
|
|
2020-01-23 07:46:38 +00:00
|
|
|
db.account().liveAccountView().observeForever(new Observer<List<TupleAccountView>>() {
|
|
|
|
private List<TupleAccountView> last = null;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onChanged(List<TupleAccountView> accounts) {
|
|
|
|
if (accounts == null)
|
|
|
|
accounts = new ArrayList<>();
|
|
|
|
|
|
|
|
boolean changed = false;
|
|
|
|
if (last == null || last.size() != accounts.size())
|
|
|
|
changed = true;
|
|
|
|
else
|
|
|
|
for (int i = 0; i < accounts.size(); i++)
|
|
|
|
if (!accounts.get(i).equals(last.get(i))) {
|
|
|
|
changed = true;
|
|
|
|
last = accounts;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changed) {
|
|
|
|
Log.i("Invalidating account view");
|
|
|
|
last = accounts;
|
|
|
|
db.getInvalidationTracker().notifyObserversByTableNames("account_view");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
db.identity().liveIdentityView().observeForever(new Observer<List<TupleIdentityView>>() {
|
|
|
|
private List<TupleIdentityView> last = null;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onChanged(List<TupleIdentityView> identities) {
|
|
|
|
if (identities == null)
|
|
|
|
identities = new ArrayList<>();
|
|
|
|
|
|
|
|
boolean changed = false;
|
|
|
|
if (last == null || last.size() != identities.size())
|
|
|
|
changed = true;
|
|
|
|
else
|
|
|
|
for (int i = 0; i < identities.size(); i++)
|
|
|
|
if (!identities.get(i).equals(last.get(i))) {
|
|
|
|
changed = true;
|
|
|
|
last = identities;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changed) {
|
|
|
|
Log.i("Invalidating identity view");
|
|
|
|
last = identities;
|
|
|
|
db.getInvalidationTracker().notifyObserversByTableNames("identity_view");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
db.folder().liveFolderView().observeForever(new Observer<List<TupleFolderView>>() {
|
|
|
|
private List<TupleFolderView> last = null;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onChanged(List<TupleFolderView> folders) {
|
|
|
|
if (folders == null)
|
|
|
|
folders = new ArrayList<>();
|
|
|
|
|
|
|
|
boolean changed = false;
|
|
|
|
if (last == null || last.size() != folders.size())
|
|
|
|
changed = true;
|
|
|
|
else
|
|
|
|
for (int i = 0; i < folders.size(); i++)
|
|
|
|
if (!folders.get(i).equals(last.get(i))) {
|
|
|
|
changed = true;
|
|
|
|
last = folders;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changed) {
|
|
|
|
Log.i("Invalidating folder view");
|
|
|
|
last = folders;
|
|
|
|
db.getInvalidationTracker().notifyObserversByTableNames("folder_view");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2018-09-14 08:31:49 +00:00
|
|
|
}
|
2018-08-02 13:33:06 +00:00
|
|
|
}
|