Commit e767dcbf authored by Ricki Hirner's avatar Ricki Hirner 🐑

Account settings: restart loader after sync interval update

* debug info: add signature
parent 0d193bfb
Pipeline #7313135 passed with stage
in 15 minutes and 12 seconds
......@@ -133,6 +133,7 @@ public class AccountSettingsActivity extends AppCompatActivity {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
settings.setSyncInterval(App.getAddressBooksAuthority(), Long.parseLong((String)newValue));
getLoaderManager().restartLoader(0, getArguments(), AccountSettingsFragment.this);
return false;
}
});
......@@ -153,6 +154,7 @@ public class AccountSettingsActivity extends AppCompatActivity {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
settings.setSyncInterval(CalendarContract.AUTHORITY, Long.parseLong((String)newValue));
getLoaderManager().restartLoader(0, getArguments(), AccountSettingsFragment.this);
return false;
}
});
......@@ -173,6 +175,7 @@ public class AccountSettingsActivity extends AppCompatActivity {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
settings.setSyncInterval(TaskProvider.ProviderName.OpenTasks.authority, Long.parseLong((String)newValue));
getLoaderManager().restartLoader(0, getArguments(), AccountSettingsFragment.this);
return false;
}
});
......@@ -290,7 +293,6 @@ public class AccountSettingsActivity extends AppCompatActivity {
@Override
protected void onStartLoading() {
forceLoad();
listenerHandle = ContentResolver.addStatusChangeListener(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS, this);
}
......@@ -299,6 +301,11 @@ public class AccountSettingsActivity extends AppCompatActivity {
ContentResolver.removeStatusChangeListener(listenerHandle);
}
@Override
public void abandon() {
onStopLoading();
}
@Override
public AccountSettings loadInBackground() {
AccountSettings settings;
......@@ -312,6 +319,7 @@ public class AccountSettingsActivity extends AppCompatActivity {
@Override
public void onStatusChanged(int which) {
App.log.fine("Reloading account settings");
forceLoad();
}
......
......@@ -180,7 +180,7 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage
remoteResource = extras.getString(KEY_REMOTE_RESOURCE);
}
StringBuilder report = new StringBuilder();
StringBuilder report = new StringBuilder("--- BEGIN DEBUG INFO ---\n");
// begin with most specific information
......@@ -225,7 +225,7 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage
installedFrom = "APK (directly)";
boolean workaroundInstalled = false;
try {
workaroundInstalled = pm.getPackageInfo("at.bitfire.davdroid.jbworkaround", 0) != null;
workaroundInstalled = pm.getPackageInfo(BuildConfig.APPLICATION_ID + ".jbworkaround", 0) != null;
} catch(PackageManager.NameNotFoundException ignored) {}
report.append("\nSOFTWARE INFORMATION\n" +
"DAVdroid version: ").append(BuildConfig.VERSION_NAME).append(" (").append(BuildConfig.VERSION_CODE).append(") ").append(new Date(BuildConfig.buildTime)).append("\n")
......@@ -300,6 +300,7 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage
App.log.log(Level.SEVERE, "Couldn't get system details", ex);
}
report.append("--- END DEBUG INFO ---\n");
return report.toString();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment