mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-20 10:55:29 +00:00
Sync widget unified folders
This commit is contained in:
parent
a2c3f642e0
commit
db6d630431
1 changed files with 5 additions and 4 deletions
|
@ -160,7 +160,7 @@ public class ServiceUI extends IntentService {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "sync":
|
case "sync":
|
||||||
onSync(id, -1L);
|
onSync(id, -1L, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "widget":
|
case "widget":
|
||||||
|
@ -462,7 +462,7 @@ public class ServiceUI extends IntentService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onSync(long aid, long fid) {
|
private void onSync(long aid, long fid, boolean unified) {
|
||||||
DB db = DB.getInstance(this);
|
DB db = DB.getInstance(this);
|
||||||
try {
|
try {
|
||||||
db.beginTransaction();
|
db.beginTransaction();
|
||||||
|
@ -477,6 +477,7 @@ public class ServiceUI extends IntentService {
|
||||||
if (folders.size() > 0)
|
if (folders.size() > 0)
|
||||||
Collections.sort(folders, folders.get(0).getComparator(this));
|
Collections.sort(folders, folders.get(0).getComparator(this));
|
||||||
for (EntityFolder folder : folders)
|
for (EntityFolder folder : folders)
|
||||||
|
if (!unified || folder.unified)
|
||||||
EntityOperation.sync(this, folder.id, true);
|
EntityOperation.sync(this, folder.id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,7 +490,7 @@ public class ServiceUI extends IntentService {
|
||||||
private void onWidget(Intent intent, int appWidgetId) {
|
private void onWidget(Intent intent, int appWidgetId) {
|
||||||
long aid = intent.getLongExtra("account", -1L);
|
long aid = intent.getLongExtra("account", -1L);
|
||||||
long fid = intent.getLongExtra("folder", -1L);
|
long fid = intent.getLongExtra("folder", -1L);
|
||||||
onSync(aid, fid);
|
onSync(aid, fid, fid < 0);
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
String key = "widget." + appWidgetId + ".sync";
|
String key = "widget." + appWidgetId + ".sync";
|
||||||
|
|
Loading…
Add table
Reference in a new issue