diff options
author | Erica Chang <echang@cyngn.com> | 2016-05-20 15:21:01 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-05-23 10:21:04 -0700 |
commit | 91aeaede23c9bb332e9442977dd7159dfab7a112 (patch) | |
tree | 0ee47857e1e397b3f6dd0fef72724715e383b11d | |
parent | b897fa4c31803268c8f745ac250a5673e0e64960 (diff) | |
download | packages_apps_Contacts-91aeaede23c9bb332e9442977dd7159dfab7a112.tar.gz packages_apps_Contacts-91aeaede23c9bb332e9442977dd7159dfab7a112.tar.bz2 packages_apps_Contacts-91aeaede23c9bb332e9442977dd7159dfab7a112.zip |
Contacts : added a flag to track soft vs hard signed out state
The InCall tab cannot distinguish between soft (need to display the contact
list) vs hard signed out state (need to display the sign in button). Added
a flag to track this.
Issue-id: CD-665
Change-Id: Ib0a225f40c7a196fb61a8d5efea19eab127387dd
-rw-r--r-- | src/com/android/contacts/list/PluginContactBrowseListFragment.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/contacts/list/PluginContactBrowseListFragment.java b/src/com/android/contacts/list/PluginContactBrowseListFragment.java index cbb37deff..4943b14ab 100644 --- a/src/com/android/contacts/list/PluginContactBrowseListFragment.java +++ b/src/com/android/contacts/list/PluginContactBrowseListFragment.java @@ -100,6 +100,8 @@ public class PluginContactBrowseListFragment extends ContactEntryListFragment<Co private ContactListFilter mFilter; private boolean mInitialized = false; private boolean mAuthenticated = false; + // flag to track soft signed out (show contacts list) vs hard signed out (show sign in UI) + private boolean mSoftLoggedOut = false; private String mAccountType = ""; private String mAccountHandle = ""; private String mPersistentSelectionPrefix = PERSISTENT_SELECTION_PREFIX; @@ -682,13 +684,18 @@ public class PluginContactBrowseListFragment extends ContactEntryListFragment<Co if (mInCallPluginInfo != null) { if (DEBUG) Log.d(TAG, "updatePluginView: " + mInCallPluginInfo.mCallMethodInfo.mName); if (mListView != null && mLoginView != null) { - // if the UI auth state is initialized the first time or the auth state has changed + // if the UI auth state is initialized the first time or the auth state has changed, + // also need to update the UI if the status changes from soft logged out (shows + // contacts list) to hard logged state (show the sign-in UI) + boolean isSoftLoggedOut = mInCallPluginInfo.mCallMethodInfo.mIsAuthenticated ? + false : CallMethodUtils.isSoftLoggedOut(getContext(), + mInCallPluginInfo.mCallMethodInfo); if (!mInitialized || mInCallPluginInfo.mCallMethodInfo.mIsAuthenticated != - mAuthenticated) { + mAuthenticated || isSoftLoggedOut != mSoftLoggedOut) { mInitialized = true; mAuthenticated = mInCallPluginInfo.mCallMethodInfo.mIsAuthenticated; - if (mAuthenticated || CallMethodUtils.isSoftLoggedOut(getContext(), - mInCallPluginInfo.mCallMethodInfo)) { + mSoftLoggedOut = isSoftLoggedOut; + if (mAuthenticated || mSoftLoggedOut) { // Show list view mLoginView.setVisibility(View.GONE); mListView.setVisibility(View.VISIBLE); |