diff options
author | Erica Chang <echang@cyngn.com> | 2016-03-18 12:16:39 -0700 |
---|---|---|
committer | Erica Chang <echang@cyngn.com> | 2016-04-07 12:05:51 -0700 |
commit | 6452c8ec9bdc273a5950903f905d8c8494d9f80d (patch) | |
tree | df5b8e4ca8b198940371601d5fc0901ca3165906 | |
parent | 33306c485a3d59cfdae4e26e8a762b0a025fb742 (diff) | |
download | android_packages_apps_Contacts-6452c8ec9bdc273a5950903f905d8c8494d9f80d.tar.gz android_packages_apps_Contacts-6452c8ec9bdc273a5950903f905d8c8494d9f80d.tar.bz2 android_packages_apps_Contacts-6452c8ec9bdc273a5950903f905d8c8494d9f80d.zip |
[2/2]Contacts: handle soft logged out state
-Contacts now displays all contacts.
-Contacts cards now display plugin callable entry, when clicked on
will launch plugin application's login Activity
CD-450
Change-Id: I0d4ee8c20dcc3e89e14674f2d9d83a0044078031
-rw-r--r-- | src/com/android/contacts/list/PluginContactBrowseListFragment.java | 5 | ||||
-rw-r--r-- | src/com/android/contacts/quickcontact/QuickContactActivity.java | 17 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/com/android/contacts/list/PluginContactBrowseListFragment.java b/src/com/android/contacts/list/PluginContactBrowseListFragment.java index 43e975406..091bae501 100644 --- a/src/com/android/contacts/list/PluginContactBrowseListFragment.java +++ b/src/com/android/contacts/list/PluginContactBrowseListFragment.java @@ -57,7 +57,7 @@ import com.android.contacts.common.list.ContactListItemView; import com.android.contacts.common.list.DefaultContactListAdapter; import com.android.contacts.common.list.ProfileAndContactsLoader; import com.android.contacts.incall.InCallPluginUtils; - +import com.android.phone.common.incall.CallMethodUtils; import java.util.List; public class PluginContactBrowseListFragment extends ContactEntryListFragment<ContactListAdapter> @@ -675,7 +675,8 @@ public class PluginContactBrowseListFragment extends ContactEntryListFragment<Co mAuthenticated) { mInitialized = true; mAuthenticated = mInCallPluginInfo.mCallMethodInfo.mIsAuthenticated; - if (mInCallPluginInfo.mCallMethodInfo.mIsAuthenticated) { + if (mAuthenticated || CallMethodUtils.isSoftLoggedOut(getContext(), + mInCallPluginInfo.mCallMethodInfo)) { // Show list view mLoginView.setVisibility(View.GONE); mListView.setVisibility(View.VISIBLE); diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java index 97ef50f27..96d0b8c05 100644 --- a/src/com/android/contacts/quickcontact/QuickContactActivity.java +++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java @@ -175,6 +175,7 @@ import com.android.contacts.widget.MultiShrinkScroller.MultiShrinkScrollerListen import com.android.contacts.widget.QuickContactImageView; import com.android.phone.common.incall.CallMethodHelper; import com.android.phone.common.incall.CallMethodInfo; +import com.android.phone.common.incall.CallMethodUtils; import com.cyanogen.ambient.discovery.util.NudgeKey; import com.cyanogen.ambient.incall.extension.OriginCodes; import com.cyanogen.ambient.plugin.PluginStatus; @@ -3552,17 +3553,17 @@ public class QuickContactActivity extends ContactsActivity implements Entry entry; RawContact rawContact = dataItemMap.get(dataItem); String contactAccountHandle = rawContact.getSourceId(); - if (cmi.mIsAuthenticated) { - // user signed in, consolidate entries - InCallPluginUtils.PresenceInfo presenceInfo = InCallPluginUtils.lookupPresenceInfo( - this, contact, rawContact); + if (cmi.mIsAuthenticated || CallMethodUtils.isSoftLoggedOut(this, cmi)) { + // user signed in or soft logged out, show consolidate entries + InCallPluginUtils.PresenceInfo presenceInfo = cmi.mIsAuthenticated ? + InCallPluginUtils.lookupPresenceInfo(this, contact, rawContact) : null; Intent callIntent = InCallPluginUtils.getVoiceMimeIntent(cmi.mMimeType, dataItem, cmi, contactAccountHandle); entry = new Entry(CARD_ENTRY_ID_INCALL_PLUGIN_CALL, cmi.mBrandIcon, contactAccountHandle, - presenceInfo.mStatusMsg, - presenceInfo.mPresenceIcon, + presenceInfo == null ? "" : presenceInfo.mStatusMsg, + presenceInfo == null ? null : presenceInfo.mPresenceIcon, null, callIntent, cmi.mImIcon, @@ -3573,9 +3574,9 @@ public class QuickContactActivity extends ContactsActivity implements cmi.mBrandIconId, cmi, entries, parentList); - if (DEBUG) Log.d(TAG, "Adding CALL ENTRY"); + if (DEBUG) Log.d(TAG, "Adding CALL ENTRY"); } else { - // user signed out, list the contact's account name, and action set to + // user hard signed out, list the contact's account name, and action set to // launch sign in final Resources res = getResources(); entry = new Entry(CARD_ENTRY_ID_INCALL_PLUGIN, |