summaryrefslogtreecommitdiffstats
path: root/src-ambient/com/android/phone/common/ambient/AmbientDataSubscription.java
diff options
context:
space:
mode:
Diffstat (limited to 'src-ambient/com/android/phone/common/ambient/AmbientDataSubscription.java')
-rw-r--r--src-ambient/com/android/phone/common/ambient/AmbientDataSubscription.java34
1 files changed, 30 insertions, 4 deletions
diff --git a/src-ambient/com/android/phone/common/ambient/AmbientDataSubscription.java b/src-ambient/com/android/phone/common/ambient/AmbientDataSubscription.java
index 4227239..2fee4cd 100644
--- a/src-ambient/com/android/phone/common/ambient/AmbientDataSubscription.java
+++ b/src-ambient/com/android/phone/common/ambient/AmbientDataSubscription.java
@@ -75,15 +75,25 @@ public abstract class AmbientDataSubscription<M> {
mDataHasBeenBroadcastPreviously = true;
} else {
for (ComponentName cn : installedPlugins) {
- ArrayList<TypedPendingResult> apiCallbacks = new ArrayList<>();
getPluginInfo().put(cn, getNewModObject(cn));
- requestedModInfo(apiCallbacks, cn);
- executeAll(apiCallbacks, cn);
+ getPluginStatus(cn);
}
}
}
};
+ public void getDisabledModInfo(ComponentName cn) {
+ ArrayList<TypedPendingResult> apiCallbacks = new ArrayList<>();
+ disabledModInfo(apiCallbacks, cn);
+ executeAll(apiCallbacks, cn);
+ }
+
+ public void getEnabledModInfo(ComponentName cn) {
+ ArrayList<TypedPendingResult> apiCallbacks = new ArrayList<>();
+ enabledModInfo(apiCallbacks, cn);
+ executeAll(apiCallbacks, cn);
+ }
+
public AmbientDataSubscription(Context context) {
mContext = context;
mClient = AmbientConnection.CLIENT.get(context);
@@ -115,14 +125,30 @@ public abstract class AmbientDataSubscription<M> {
/**
* Gets the required queries for all our plugins
*
+ * @param componentName ComponentName of the plugin we will be querying
+ */
+ protected abstract void getPluginStatus(ComponentName componentName);
+
+ /**
+ * Gets the enabled queries for all our plugins
+ *
* @param queries ArrayList for us to add TypedPendingResults to
* @param componentName ComponentName of the plugin we will be querying
*/
- protected abstract void requestedModInfo(ArrayList<TypedPendingResult> queries,
+ protected abstract void enabledModInfo(ArrayList<TypedPendingResult> queries,
ComponentName componentName);
/**
+ * Gets the disabled queries for all our plugins
+ *
+ * @param queries ArrayList for us to add TypedPendingResults to
+ * @param componentName ComponentName of the plugin we will be querying
+ */
+ protected abstract void disabledModInfo(ArrayList<TypedPendingResult> queries,
+ ComponentName componentName);
+
+ /**
* Action that takes place when a refresh is requested.
*/
protected abstract void onRefreshRequested();