diff options
author | Erica Chang <echang@cyngn.com> | 2016-03-08 18:09:45 -0800 |
---|---|---|
committer | Erica Chang <echang@cyngn.com> | 2016-04-07 12:05:50 -0700 |
commit | 64e5ffe387e08ab1ace20d93354c08e86f7cb625 (patch) | |
tree | 6a52f687830860de051b5d477ec2ec50e23225c9 /src/com/android | |
parent | 4bfb1738ea3c7ba4bbd4d63a292be208539f310b (diff) | |
download | packages_apps_Contacts-64e5ffe387e08ab1ace20d93354c08e86f7cb625.tar.gz packages_apps_Contacts-64e5ffe387e08ab1ace20d93354c08e86f7cb625.tar.bz2 packages_apps_Contacts-64e5ffe387e08ab1ace20d93354c08e86f7cb625.zip |
Contacts: add plugin status change receiver
Contacts now receives updates and updates UI accordingly based on
plugin status.
CD-452, CD-464
Change-Id: Ib5c3d7cd683a09d07d3f466248129d31c321123d
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/contacts/activities/PeopleActivity.java | 10 | ||||
-rw-r--r-- | src/com/android/contacts/incall/CallMethodStatusReceiver.java | 17 |
2 files changed, 22 insertions, 5 deletions
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java index 665d3cf8f..06e4b1356 100644 --- a/src/com/android/contacts/activities/PeopleActivity.java +++ b/src/com/android/contacts/activities/PeopleActivity.java @@ -1864,13 +1864,13 @@ public class PeopleActivity extends ContactsActivity implements return null; } - private void removePluginInfo(ComponentName cn) { + private InCallPluginInfo removePluginInfo(ComponentName cn) { for (int i = 0; i < mPluginTabInfo.size(); i++) { if (mPluginTabInfo.get(i).mCallMethodInfo.mComponent.equals(cn)) { - mPluginTabInfo.remove(i); - break; + return mPluginTabInfo.remove(i); } } + return null; } private void removeTabTitle(ComponentName cn) { @@ -1905,9 +1905,9 @@ public class PeopleActivity extends ContactsActivity implements } else { // Remove the tab associated with a plugin that's no longer available updateTabs = true; + mCallMethodMap.remove(cn); removeTabTitle(cn); - removePluginInfo(cn); - InCallPluginInfo removePlugin = getPluginInfo(cn); + InCallPluginInfo removePlugin = removePluginInfo(cn); if (removePlugin != null) { transaction = fragmentManager.beginTransaction(); transaction.remove(removePlugin.mFragment); diff --git a/src/com/android/contacts/incall/CallMethodStatusReceiver.java b/src/com/android/contacts/incall/CallMethodStatusReceiver.java new file mode 100644 index 000000000..0cc7fd559 --- /dev/null +++ b/src/com/android/contacts/incall/CallMethodStatusReceiver.java @@ -0,0 +1,17 @@ +package com.android.contacts.incall; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +public class CallMethodStatusReceiver extends BroadcastReceiver { + private static final String TAG = CallMethodStatusReceiver.class.getSimpleName(); + private static final boolean DEBUG = false; + + @Override + public void onReceive(Context context, Intent intent) { + if (DEBUG) Log.d(TAG, "plugin status changed"); + InCallPluginHelper.refresh(); + } +} |