diff --git a/app/src/main/java/com/etesync/syncadapter/ui/AccountSettingsActivity.java b/app/src/main/java/com/etesync/syncadapter/ui/AccountSettingsActivity.java index 12460c3b..eb80cf12 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/AccountSettingsActivity.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/AccountSettingsActivity.java @@ -121,6 +121,7 @@ public class AccountSettingsActivity extends AppCompatActivity { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { settings.setSyncInterval(ContactsContract.AUTHORITY, Long.parseLong((String)newValue)); + getLoaderManager().restartLoader(0, getArguments(), AccountSettingsFragment.this); return false; } }); @@ -141,6 +142,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; } }); @@ -198,7 +200,6 @@ public class AccountSettingsActivity extends AppCompatActivity { @Override protected void onStartLoading() { forceLoad(); - listenerHandle = ContentResolver.addStatusChangeListener(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS, this); } @@ -207,6 +208,11 @@ public class AccountSettingsActivity extends AppCompatActivity { ContentResolver.removeStatusChangeListener(listenerHandle); } + @Override + public void abandon() { + onStopLoading(); + } + @Override public AccountSettings loadInBackground() { AccountSettings settings; @@ -220,6 +226,7 @@ public class AccountSettingsActivity extends AppCompatActivity { @Override public void onStatusChanged(int which) { + App.log.fine("Reloading account settings"); forceLoad(); } diff --git a/app/src/main/java/com/etesync/syncadapter/ui/DebugInfoActivity.java b/app/src/main/java/com/etesync/syncadapter/ui/DebugInfoActivity.java index 9cd1b414..25178b54 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/DebugInfoActivity.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/DebugInfoActivity.java @@ -176,7 +176,7 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage phase = extras.getString(KEY_PHASE, null); } - StringBuilder report = new StringBuilder(); + StringBuilder report = new StringBuilder("--- BEGIN DEBUG INFO ---\n"); // begin with most specific information @@ -209,7 +209,7 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage installedFrom = "APK (directly)"; boolean workaroundInstalled = false; try { - workaroundInstalled = pm.getPackageInfo("com.etesync.syncadapter.jbworkaround", 0) != null; + workaroundInstalled = pm.getPackageInfo(BuildConfig.APPLICATION_ID + ".jbworkaround", 0) != null; } catch(PackageManager.NameNotFoundException ignored) {} report.append("\nSOFTWARE INFORMATION\n" + "EteSync version: ").append(BuildConfig.VERSION_NAME).append(" (").append(BuildConfig.VERSION_CODE).append(") ").append(new Date(BuildConfig.buildTime)).append("\n") @@ -266,6 +266,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(); }