Improve UI pref when sync/cancel account syncs.

The core of the change is in ManageAccountSettings#showSyncState(). New
code caches as much information as it can. And break out of loops as
early as possible.

Bug: 28575620
Test: make RunSettingsRoboTests
Change-Id: I076ce148e3d8db55f6cadfd9491f037f7a55a986
This commit is contained in:
Fan Zhang
2016-12-08 11:28:31 -08:00
parent 6c6c0e1151
commit 2829958456
5 changed files with 300 additions and 55 deletions

View File

@@ -32,6 +32,7 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.support.v7.preference.PreferenceScreen;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.util.Log;
import com.android.settings.SettingsPreferenceFragment;
@@ -46,6 +47,7 @@ abstract class AccountPreferenceBase extends SettingsPreferenceFragment
implements AuthenticatorHelper.OnAccountsUpdateListener {
protected static final String TAG = "AccountSettings";
protected static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
public static final String AUTHORITIES_FILTER_KEY = "authorities";
public static final String ACCOUNT_TYPES_FILTER_KEY = "account_types";