summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErica Chang <echang@cyngn.com>2016-05-04 01:22:15 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-09 20:27:06 (GMT)
commit9047ee984e447c28e181487e98094257fda5c25c (patch)
tree0d4fed036d89ed31f21b6ba7c8e141b0e3186073
parent7b1fe0109483f22f8c5e1852efe7230e0a4ced71 (diff)
downloadandroid_packages_apps_PhoneCommon-9047ee984e447c28e181487e98094257fda5c25c.zip
android_packages_apps_PhoneCommon-9047ee984e447c28e181487e98094257fda5c25c.tar.gz
android_packages_apps_PhoneCommon-9047ee984e447c28e181487e98094257fda5c25c.tar.bz2
DynamicRefresh should only refresh ENABLED plugins
-added accountHandle query to ContactsDataSubscription CD-616 Change-Id: I2042453826990579e15b5305cf1282cbb0f9a445
-rw-r--r--src-ambient/com/android/phone/common/incall/ContactsDataSubscription.java13
-rw-r--r--src-ambient/com/android/phone/common/incall/DialerDataSubscription.java14
2 files changed, 22 insertions, 5 deletions
diff --git a/src-ambient/com/android/phone/common/incall/ContactsDataSubscription.java b/src-ambient/com/android/phone/common/incall/ContactsDataSubscription.java
index e93a72c..d0c17e8 100644
--- a/src-ambient/com/android/phone/common/incall/ContactsDataSubscription.java
+++ b/src-ambient/com/android/phone/common/incall/ContactsDataSubscription.java
@@ -32,6 +32,7 @@ import com.cyanogen.ambient.common.api.ResultCallback;
import com.cyanogen.ambient.discovery.util.NudgeKey;
import com.cyanogen.ambient.incall.extension.InCallContactInfo;
import com.cyanogen.ambient.incall.results.PendingIntentResult;
+import com.cyanogen.ambient.plugin.PluginStatus;
import java.util.ArrayList;
import java.util.HashMap;
@@ -70,8 +71,15 @@ public class ContactsDataSubscription extends DialerDataSubscription {
@Override
public void onDynamicRefreshRequested(ArrayList<TypedPendingResult> queries,
ComponentName componentName) {
- queries.add(InCallQueries.getCallMethodAuthenticated(mClient, componentName));
- queries.add(InCallQueries.getCallMethodAccountHandle(mClient, componentName));
+ HashMap<ComponentName, CallMethodInfo> plugins = this.getPluginInfo();
+ if (plugins.containsKey(componentName)) {
+ CallMethodInfo cmi = plugins.get(componentName);
+ // only need to refresh plugins that exist and are ENABLED
+ if (cmi != null && cmi.mStatus == PluginStatus.ENABLED) {
+ queries.add(InCallQueries.getCallMethodAuthenticated(mClient, componentName));
+ queries.add(InCallQueries.getCallMethodAccountHandle(mClient, componentName));
+ }
+ }
}
@Override
@@ -93,6 +101,7 @@ public class ContactsDataSubscription extends DialerDataSubscription {
queries.add(InCallQueries.getCallMethodMimeType(mClient, componentName));
queries.add(InCallQueries.getCallMethodVideoCallableMimeType(mClient, componentName));
queries.add(InCallQueries.getCallMethodAuthenticated(mClient, componentName));
+ queries.add(InCallQueries.getCallMethodAccountHandle(mClient, componentName));
queries.add(InCallQueries.getLoginIntent(mClient, componentName));
queries.add(InCallQueries.getDefaultDirectorySearchIntent(mClient, componentName));
queries.add(InCallQueries.getCallMethodImMimeType(mClient, componentName));
diff --git a/src-ambient/com/android/phone/common/incall/DialerDataSubscription.java b/src-ambient/com/android/phone/common/incall/DialerDataSubscription.java
index d4b6071..5fd4a23 100644
--- a/src-ambient/com/android/phone/common/incall/DialerDataSubscription.java
+++ b/src-ambient/com/android/phone/common/incall/DialerDataSubscription.java
@@ -40,8 +40,10 @@ import com.cyanogen.ambient.incall.results.MimeTypeResult;
import com.cyanogen.ambient.incall.results.PendingIntentResult;
import com.cyanogen.ambient.incall.results.PluginStatusResult;
import com.android.phone.common.ambient.AmbientDataSubscription;
+import com.cyanogen.ambient.plugin.PluginStatus;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import static com.cyanogen.ambient.incall.util.InCallHelper.NO_COLOR;
@@ -129,9 +131,15 @@ public class DialerDataSubscription extends AmbientDataSubscription<CallMethodIn
@Override
protected void onDynamicRefreshRequested(ArrayList<TypedPendingResult> queries,
ComponentName componentName) {
-
- queries.add(InCallQueries.getCallMethodAuthenticated(mClient, componentName));
- queries.add(InCallQueries.getCreditInfo(mClient, componentName));
+ HashMap<ComponentName, CallMethodInfo> plugins = this.getPluginInfo();
+ if (plugins.containsKey(componentName)) {
+ CallMethodInfo cmi = plugins.get(componentName);
+ // only need to refresh plugins that exist and are ENABLED
+ if (cmi != null && cmi.mStatus == PluginStatus.ENABLED) {
+ queries.add(InCallQueries.getCallMethodAuthenticated(mClient, componentName));
+ queries.add(InCallQueries.getCreditInfo(mClient, componentName));
+ }
+ }
}
@Override