summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/res/values/config.xml14
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/ComplicationHost.java (renamed from packages/SystemUI/src/com/android/systemui/dreams/OverlayHost.java)20
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/ComplicationHostView.java (renamed from packages/SystemUI/src/com/android/systemui/dreams/OverlayHostView.java)13
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/ComplicationProvider.java (renamed from packages/SystemUI/src/com/android/systemui/dreams/OverlayProvider.java)16
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java28
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java69
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetProvider.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/appwidgets/ComplicationPrimer.java (renamed from packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayPrimer.java)45
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/appwidgets/ComplicationProvider.java (renamed from packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayProvider.java)25
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/appwidgets/dagger/AppWidgetComponent.java (renamed from packages/SystemUI/src/com/android/systemui/dreams/dagger/AppWidgetOverlayComponent.java)16
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/dreams/ComplicationProviderTest.java (renamed from packages/SystemUI/tests/src/com/android/systemui/dreams/AppWidgetOverlayProviderTest.java)20
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java20
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java24
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/dreams/appwidgets/ComplicationPrimerTest.java (renamed from packages/SystemUI/tests/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayPrimerTest.java)83
16 files changed, 213 insertions, 200 deletions
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 3695286a77da..9f017b29c665 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -714,19 +714,19 @@
<bool name="config_enablePrivacyDot">true</bool>
<!-- The positions widgets can be in defined as View.Gravity constants -->
- <integer-array name="config_dreamOverlayPositions">
+ <integer-array name="config_dreamComplicationPositions">
</integer-array>
- <!-- Widget components to show as dream overlays -->
- <string-array name="config_dreamOverlayComponents" translatable="false">
+ <!-- Widget components to show as dream complications -->
+ <string-array name="config_dreamAppWidgetComplications" translatable="false">
</string-array>
- <!-- Width percentage of dream overlay components -->
- <item name="config_dreamOverlayComponentWidthPercent" translatable="false" format="float"
+ <!-- Width percentage of dream complications -->
+ <item name="config_dreamComplicationWidthPercent" translatable="false" format="float"
type="dimen">0.33</item>
- <!-- Height percentage of dream overlay components -->
- <item name="config_dreamOverlayComponentHeightPercent" translatable="false" format="float"
+ <!-- Height percentage of dream complications -->
+ <item name="config_dreamComplicationHeightPercent" translatable="false" format="float"
type="dimen">0.25</item>
<!-- Flag to enable dream overlay service and its registration -->
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
index 34261487cadc..9dddbb1d67c6 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
@@ -25,7 +25,7 @@ import com.android.systemui.accessibility.WindowMagnification;
import com.android.systemui.biometrics.AuthController;
import com.android.systemui.communal.CommunalManagerUpdater;
import com.android.systemui.dreams.DreamOverlayRegistrant;
-import com.android.systemui.dreams.appwidgets.AppWidgetOverlayPrimer;
+import com.android.systemui.dreams.appwidgets.ComplicationPrimer;
import com.android.systemui.globalactions.GlobalActionsComponent;
import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.keyguard.dagger.KeyguardModule;
@@ -202,9 +202,9 @@ public abstract class SystemUIBinder {
/** Inject into AppWidgetOverlayPrimer. */
@Binds
@IntoMap
- @ClassKey(AppWidgetOverlayPrimer.class)
+ @ClassKey(ComplicationPrimer.class)
public abstract CoreStartable bindAppWidgetOverlayPrimer(
- AppWidgetOverlayPrimer appWidgetOverlayPrimer);
+ ComplicationPrimer complicationPrimer);
/** Inject into CommunalManagerUpdater. */
@Binds
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/OverlayHost.java b/packages/SystemUI/src/com/android/systemui/dreams/ComplicationHost.java
index 08f0f3507e3e..7c3152fe89dc 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/OverlayHost.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/ComplicationHost.java
@@ -19,29 +19,29 @@ package com.android.systemui.dreams;
import android.view.View;
/**
- * A collection of interfaces related to hosting an overlay.
+ * A collection of interfaces related to hosting a complication.
*/
-public abstract class OverlayHost {
+public abstract class ComplicationHost {
/**
- * An interface for the callback from the overlay provider to indicate when the overlay is
- * ready.
+ * An interface for the callback from the complication provider to indicate when the
+ * complication is ready.
*/
public interface CreationCallback {
/**
- * Called to inform the overlay view is ready to be placed within the visual space.
- * @param view The view representing the overlay.
+ * Called to inform the complication view is ready to be placed within the visual space.
+ * @param view The view representing the complication.
* @param layoutParams The parameters to create the view with.
*/
- void onCreated(View view, OverlayHostView.LayoutParams layoutParams);
+ void onCreated(View view, ComplicationHostView.LayoutParams layoutParams);
}
/**
- * An interface for the callback from the overlay provider to signal interactions in the
- * overlay.
+ * An interface for the callback from the complication provider to signal interactions in the
+ * complication.
*/
public interface InteractionCallback {
/**
- * Called to signal the calling overlay would like to exit the dream.
+ * Called to signal the calling complication would like to exit the dream.
*/
void onExit();
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/OverlayHostView.java b/packages/SystemUI/src/com/android/systemui/dreams/ComplicationHostView.java
index 7870426c78f1..a67dd5c0a723 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/OverlayHostView.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/ComplicationHostView.java
@@ -22,22 +22,23 @@ import android.util.AttributeSet;
import androidx.constraintlayout.widget.ConstraintLayout;
/**
- * {@link OverlayHostView} is the container view for housing overlays ontop of a dream.
+ * {@link ComplicationHostView} is the container view for housing complications above of a dream.
*/
-public class OverlayHostView extends ConstraintLayout {
- public OverlayHostView(Context context) {
+public class ComplicationHostView extends ConstraintLayout {
+ public ComplicationHostView(Context context) {
super(context, null);
}
- public OverlayHostView(Context context, AttributeSet attrs) {
+ public ComplicationHostView(Context context, AttributeSet attrs) {
super(context, attrs, 0);
}
- public OverlayHostView(Context context, AttributeSet attrs, int defStyleAttr) {
+ public ComplicationHostView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr, 0);
}
- public OverlayHostView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+ public ComplicationHostView(Context context, AttributeSet attrs, int defStyleAttr,
+ int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/OverlayProvider.java b/packages/SystemUI/src/com/android/systemui/dreams/ComplicationProvider.java
index f20802527d73..099e37960ad6 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/OverlayProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/ComplicationProvider.java
@@ -19,18 +19,18 @@ package com.android.systemui.dreams;
import android.content.Context;
/**
- * {@link OverlayProvider} is an interface for defining entities that can supply overlays to show
- * over a dream. Presentation components such as the {@link DreamOverlayService} supply
+ * {@link ComplicationProvider} is an interface for defining entities that can supply complications
+ * to show over a dream. Presentation components such as the {@link DreamOverlayService} supply
* implementations with the necessary context for constructing such overlays.
*/
-public interface OverlayProvider {
+public interface ComplicationProvider {
/**
- * Called when the {@link OverlayHost} requests the associated overlay be produced.
+ * Called when the {@link ComplicationHost} requests the associated complication be produced.
*
* @param context The {@link Context} used to construct the view.
- * @param creationCallback The callback to inform when the overlay has been created.
- * @param interactionCallback The callback to inform when the overlay has been interacted with.
+ * @param creationCallback The callback to inform the complication has been created.
+ * @param interactionCallback The callback to inform the complication has been interacted with.
*/
- void onCreateOverlay(Context context, OverlayHost.CreationCallback creationCallback,
- OverlayHost.InteractionCallback interactionCallback);
+ void onCreateComplication(Context context, ComplicationHost.CreationCallback creationCallback,
+ ComplicationHost.InteractionCallback interactionCallback);
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
index 393f039d91ea..7c2bb4bcf4f3 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
@@ -40,7 +40,7 @@ import java.util.concurrent.Executor;
import javax.inject.Inject;
/**
- * The {@link DreamOverlayService} is responsible for placing overlays on top of a dream. The
+ * The {@link DreamOverlayService} is responsible for placing an overlay on top of a dream. The
* dream reaches directly out to the service with a Window reference (via LayoutParams), which the
* service uses to insert its own child Window into the dream's parent Window.
*/
@@ -52,7 +52,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
private final Context mContext;
// The Executor ensures actions and ui updates happen on the same thread.
private final Executor mExecutor;
- // The state controller informs the service of updates to the overlays present.
+ // The state controller informs the service of updates to the complications present.
private final DreamOverlayStateController mStateController;
// The component used to resolve dream overlay dependencies.
private final DreamOverlayComponent mDreamOverlayComponent;
@@ -64,8 +64,8 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
private final DreamOverlayStateController.Callback mOverlayStateCallback =
new DreamOverlayStateController.Callback() {
@Override
- public void onOverlayChanged() {
- mExecutor.execute(() -> reloadOverlaysLocked());
+ public void onComplicationsChanged() {
+ mExecutor.execute(() -> reloadComplicationsLocked());
}
};
@@ -87,7 +87,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
}
};
- // A hook into the internal inset calculation where we declare the overlays as the only
+ // A hook into the internal inset calculation where we declare the complications as the only
// touchable regions.
private final ViewTreeObserver.OnComputeInternalInsetsListener
mOnComputeInternalInsetsListener =
@@ -129,20 +129,20 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
mExecutor.execute(() -> addOverlayWindowLocked(layoutParams));
}
- private void reloadOverlaysLocked() {
+ private void reloadComplicationsLocked() {
if (mDreamOverlayContentView == null) {
return;
}
mDreamOverlayContentView.removeAllViews();
- for (OverlayProvider overlayProvider : mStateController.getOverlays()) {
- addOverlay(overlayProvider);
+ for (ComplicationProvider complicationProvider : mStateController.getComplications()) {
+ addComplication(complicationProvider);
}
}
/**
- * Inserts {@link Window} to host dream overlays into the dream's parent window. Must be called
- * from the main executing thread. The window attributes closely mirror those that are set by
- * the {@link android.service.dreams.DreamService} on the dream Window.
+ * Inserts {@link Window} to host the dream overlay into the dream's parent window. Must be
+ * called from the main executing thread. The window attributes closely mirror those that are
+ * set by the {@link android.service.dreams.DreamService} on the dream Window.
* @param layoutParams The {@link android.view.WindowManager.LayoutParams} which allow inserting
* into the dream window.
*/
@@ -173,12 +173,12 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
final WindowManager windowManager = mContext.getSystemService(WindowManager.class);
windowManager.addView(window.getDecorView(), window.getAttributes());
- mExecutor.execute(this::reloadOverlaysLocked);
+ mExecutor.execute(this::reloadComplicationsLocked);
}
@VisibleForTesting
- protected void addOverlay(OverlayProvider provider) {
- provider.onCreateOverlay(mContext,
+ protected void addComplication(ComplicationProvider provider) {
+ provider.onCreateComplication(mContext,
(view, layoutParams) -> {
// Always move UI related work to the main thread.
mExecutor.execute(() -> {
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java
index d248a9e174f5..bc9bdfca8701 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayStateController.java
@@ -30,32 +30,33 @@ import java.util.Objects;
import javax.inject.Inject;
/**
- * {@link DreamOverlayStateController} is the source of truth for Dream overlay configurations.
- * Clients can register as listeners for changes to the overlay composition and can query for the
- * overlays on-demand.
+ * {@link DreamOverlayStateController} is the source of truth for Dream overlay configurations and
+ * state. Clients can register as listeners for changes to the overlay composition and can query for
+ * the complications on-demand.
*/
@SysUISingleton
public class DreamOverlayStateController implements
CallbackController<DreamOverlayStateController.Callback> {
- // A counter for guaranteeing unique overlay tokens within the scope of this state controller.
- private int mNextOverlayTokenId = 0;
+ // A counter for guaranteeing unique complications tokens within the scope of this state
+ // controller.
+ private int mNextComplicationTokenId = 0;
/**
- * {@link OverlayToken} provides a unique key for identifying {@link OverlayProvider}
+ * {@link ComplicationToken} provides a unique key for identifying {@link ComplicationProvider}
* instances registered with {@link DreamOverlayStateController}.
*/
- public static class OverlayToken {
+ public static class ComplicationToken {
private final int mId;
- private OverlayToken(int id) {
+ private ComplicationToken(int id) {
mId = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof OverlayToken)) return false;
- OverlayToken that = (OverlayToken) o;
+ if (!(o instanceof ComplicationToken)) return false;
+ ComplicationToken that = (ComplicationToken) o;
return mId == that.mId;
}
@@ -70,14 +71,14 @@ public class DreamOverlayStateController implements
*/
public interface Callback {
/**
- * Called when the visibility of the communal view changes.
+ * Called when the composition of complications changes.
*/
- default void onOverlayChanged() {
+ default void onComplicationsChanged() {
}
}
private final ArrayList<Callback> mCallbacks = new ArrayList<>();
- private final HashMap<OverlayToken, OverlayProvider> mOverlays = new HashMap<>();
+ private final HashMap<ComplicationToken, ComplicationProvider> mComplications = new HashMap<>();
@VisibleForTesting
@Inject
@@ -85,36 +86,36 @@ public class DreamOverlayStateController implements
}
/**
- * Adds an overlay to be presented on top of dreams.
- * @param provider The {@link OverlayProvider} providing the dream.
- * @return The {@link OverlayToken} tied to the supplied {@link OverlayProvider}.
+ * Adds a complication to be presented on top of dreams.
+ * @param provider The {@link ComplicationProvider} providing the dream.
+ * @return The {@link ComplicationToken} tied to the supplied {@link ComplicationProvider}.
*/
- public OverlayToken addOverlay(OverlayProvider provider) {
- final OverlayToken token = new OverlayToken(mNextOverlayTokenId++);
- mOverlays.put(token, provider);
+ public ComplicationToken addComplication(ComplicationProvider provider) {
+ final ComplicationToken token = new ComplicationToken(mNextComplicationTokenId++);
+ mComplications.put(token, provider);
notifyCallbacks();
return token;
}
/**
- * Removes an overlay from being shown on dreams.
- * @param token The {@link OverlayToken} associated with the {@link OverlayProvider} to be
- * removed.
- * @return The removed {@link OverlayProvider}, {@code null} if not found.
+ * Removes a complication from being shown on dreams.
+ * @param token The {@link ComplicationToken} associated with the {@link ComplicationProvider}
+ * to be removed.
+ * @return The removed {@link ComplicationProvider}, {@code null} if not found.
*/
- public OverlayProvider removeOverlay(OverlayToken token) {
- final OverlayProvider removedOverlay = mOverlays.remove(token);
+ public ComplicationProvider removeComplication(ComplicationToken token) {
+ final ComplicationProvider removedComplication = mComplications.remove(token);
- if (removedOverlay != null) {
+ if (removedComplication != null) {
notifyCallbacks();
}
- return removedOverlay;
+ return removedComplication;
}
private void notifyCallbacks() {
for (Callback callback : mCallbacks) {
- callback.onOverlayChanged();
+ callback.onComplicationsChanged();
}
}
@@ -127,11 +128,11 @@ public class DreamOverlayStateController implements
mCallbacks.add(callback);
- if (mOverlays.isEmpty()) {
+ if (mComplications.isEmpty()) {
return;
}
- callback.onOverlayChanged();
+ callback.onComplicationsChanged();
}
@Override
@@ -141,10 +142,10 @@ public class DreamOverlayStateController implements
}
/**
- * Returns all registered {@link OverlayProvider} instances.
- * @return A collection of {@link OverlayProvider}.
+ * Returns all registered {@link ComplicationProvider} instances.
+ * @return A collection of {@link ComplicationProvider}.
*/
- public Collection<OverlayProvider> getOverlays() {
- return mOverlays.values();
+ public Collection<ComplicationProvider> getComplications() {
+ return mComplications.values();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetProvider.java b/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetProvider.java
index d1da1e691ed6..687f7a296b1a 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetProvider.java
@@ -34,8 +34,8 @@ import javax.inject.Inject;
/**
* {@link AppWidgetProvider} is a singleton for accessing app widgets within SystemUI. This
- * consolidates resources such as the App Widget Host across potentially multiple
- * {@link AppWidgetOverlayProvider} instances and other usages.
+ * consolidates resources such as the {@link AppWidgetHost} across potentially multiple
+ * {@link ComplicationProvider} instances and other usages.
*/
@SysUISingleton
public class AppWidgetProvider {
@@ -87,8 +87,8 @@ public class AppWidgetProvider {
final float density = mResources.getDisplayMetrics().density;
final int height = Math.round((bottom - top) / density);
final int width = Math.round((right - left) / density);
- appWidgetView.updateAppWidgetSize(null, width, height, width,
- height);
+ appWidgetView.updateAppWidgetSize(null, width, height,
+ width, height);
});
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayPrimer.java b/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/ComplicationPrimer.java
index 563f70776209..7d30fafda8a6 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayPrimer.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/ComplicationPrimer.java
@@ -26,25 +26,25 @@ import androidx.constraintlayout.widget.ConstraintSet;
import com.android.systemui.CoreStartable;
import com.android.systemui.R;
import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.dreams.ComplicationHostView;
import com.android.systemui.dreams.DreamOverlayStateController;
-import com.android.systemui.dreams.OverlayHostView;
-import com.android.systemui.dreams.dagger.AppWidgetOverlayComponent;
+import com.android.systemui.dreams.appwidgets.dagger.AppWidgetComponent;
import javax.inject.Inject;
/**
- * {@link AppWidgetOverlayPrimer} reads the configured App Widget Overlay from resources on start
+ * {@link ComplicationPrimer} reads the configured AppWidget Complications from resources on start
* and populates them into the {@link DreamOverlayStateController}.
*/
-public class AppWidgetOverlayPrimer extends CoreStartable {
+public class ComplicationPrimer extends CoreStartable {
private final Resources mResources;
private final DreamOverlayStateController mDreamOverlayStateController;
- private final AppWidgetOverlayComponent.Factory mComponentFactory;
+ private final AppWidgetComponent.Factory mComponentFactory;
@Inject
- public AppWidgetOverlayPrimer(Context context, @Main Resources resources,
+ public ComplicationPrimer(Context context, @Main Resources resources,
DreamOverlayStateController overlayStateController,
- AppWidgetOverlayComponent.Factory appWidgetOverlayFactory) {
+ AppWidgetComponent.Factory appWidgetOverlayFactory) {
super(context);
mResources = resources;
mDreamOverlayStateController = overlayStateController;
@@ -62,17 +62,18 @@ public class AppWidgetOverlayPrimer extends CoreStartable {
}
/**
- * Generates the {@link OverlayHostView.LayoutParams} for a given gravity. Default dimension
- * constraints are also included in the params.
+ * Generates the {@link ComplicationHostView.LayoutParams} for a given gravity. Default
+ * dimension constraints are also included in the params.
* @param gravity The gravity for the layout as defined by {@link Gravity}.
* @param resources The resourcs from which default dimensions will be extracted from.
- * @return {@link OverlayHostView.LayoutParams} representing the provided gravity and default
- * parameters.
+ * @return {@link ComplicationHostView.LayoutParams} representing the provided gravity and
+ * default parameters.
*/
- private static OverlayHostView.LayoutParams getLayoutParams(int gravity, Resources resources) {
- final OverlayHostView.LayoutParams params = new OverlayHostView.LayoutParams(
- OverlayHostView.LayoutParams.MATCH_CONSTRAINT,
- OverlayHostView.LayoutParams.MATCH_CONSTRAINT);
+ private static ComplicationHostView.LayoutParams getLayoutParams(int gravity,
+ Resources resources) {
+ final ComplicationHostView.LayoutParams params = new ComplicationHostView.LayoutParams(
+ ComplicationHostView.LayoutParams.MATCH_CONSTRAINT,
+ ComplicationHostView.LayoutParams.MATCH_CONSTRAINT);
if ((gravity & Gravity.BOTTOM) == Gravity.BOTTOM) {
params.bottomToBottom = ConstraintSet.PARENT_ID;
@@ -92,28 +93,28 @@ public class AppWidgetOverlayPrimer extends CoreStartable {
// For now, apply the same sizing constraints on every widget.
params.matchConstraintPercentHeight =
- resources.getFloat(R.dimen.config_dreamOverlayComponentHeightPercent);
+ resources.getFloat(R.dimen.config_dreamComplicationHeightPercent);
params.matchConstraintPercentWidth =
- resources.getFloat(R.dimen.config_dreamOverlayComponentWidthPercent);
+ resources.getFloat(R.dimen.config_dreamComplicationWidthPercent);
return params;
}
-
/**
* Helper method for loading widgets based on configuration.
*/
private void loadDefaultWidgets() {
- final int[] positions = mResources.getIntArray(R.array.config_dreamOverlayPositions);
+ final int[] positions = mResources.getIntArray(R.array.config_dreamComplicationPositions);
final String[] components =
- mResources.getStringArray(R.array.config_dreamOverlayComponents);
+ mResources.getStringArray(R.array.config_dreamAppWidgetComplications);
for (int i = 0; i < Math.min(positions.length, components.length); i++) {
- final AppWidgetOverlayComponent component = mComponentFactory.build(
+ final AppWidgetComponent component = mComponentFactory.build(
ComponentName.unflattenFromString(components[i]),
getLayoutParams(positions[i], mResources));
- mDreamOverlayStateController.addOverlay(component.getAppWidgetOverlayProvider());
+ mDreamOverlayStateController.addComplication(
+ component.getAppWidgetComplicationProvider());
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayProvider.java b/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/ComplicationProvider.java
index a635d3f740cf..9188ee54d855 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/ComplicationProvider.java
@@ -22,30 +22,30 @@ import android.content.Context;
import android.util.Log;
import android.widget.RemoteViews;
-import com.android.systemui.dreams.OverlayHost;
-import com.android.systemui.dreams.OverlayHostView;
-import com.android.systemui.dreams.OverlayProvider;
+import com.android.systemui.dreams.ComplicationHost;
+import com.android.systemui.dreams.ComplicationHostView;
import com.android.systemui.plugins.ActivityStarter;
import javax.inject.Inject;
/**
- * {@link AppWidgetOverlayProvider} is an implementation of {@link OverlayProvider} for providing
- * app widget-based overlays.
+ * {@link ComplicationProvider} is an implementation of
+ * {@link com.android.systemui.dreams.ComplicationProvider} for providing app widget-based
+ * complications.
*/
-public class AppWidgetOverlayProvider implements OverlayProvider {
- private static final String TAG = "AppWdgtOverlayProvider";
+public class ComplicationProvider implements com.android.systemui.dreams.ComplicationProvider {
+ private static final String TAG = "AppWidgetCompProvider";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
private final ActivityStarter mActivityStarter;
private final AppWidgetProvider mAppWidgetProvider;
private final ComponentName mComponentName;
- private final OverlayHostView.LayoutParams mLayoutParams;
+ private final ComplicationHostView.LayoutParams mLayoutParams;
@Inject
- public AppWidgetOverlayProvider(ActivityStarter activityStarter,
+ public ComplicationProvider(ActivityStarter activityStarter,
ComponentName componentName, AppWidgetProvider widgetProvider,
- OverlayHostView.LayoutParams layoutParams) {
+ ComplicationHostView.LayoutParams layoutParams) {
mActivityStarter = activityStarter;
mComponentName = componentName;
mAppWidgetProvider = widgetProvider;
@@ -53,8 +53,9 @@ public class AppWidgetOverlayProvider implements OverlayProvider {
}
@Override
- public void onCreateOverlay(Context context, OverlayHost.CreationCallback creationCallback,
- OverlayHost.InteractionCallback interactionCallback) {
+ public void onCreateComplication(Context context,
+ ComplicationHost.CreationCallback creationCallback,
+ ComplicationHost.InteractionCallback interactionCallback) {
final AppWidgetHostView widget = mAppWidgetProvider.getWidget(mComponentName);
if (widget == null) {
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/dagger/AppWidgetOverlayComponent.java b/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/dagger/AppWidgetComponent.java
index 3103057be209..7beed176eeca 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/dagger/AppWidgetOverlayComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/appwidgets/dagger/AppWidgetComponent.java
@@ -14,26 +14,26 @@
* limitations under the License.
*/
-package com.android.systemui.dreams.dagger;
+package com.android.systemui.dreams.appwidgets.dagger;
import android.content.ComponentName;
-import com.android.systemui.dreams.OverlayHostView;
-import com.android.systemui.dreams.appwidgets.AppWidgetOverlayProvider;
+import com.android.systemui.dreams.ComplicationHostView;
+import com.android.systemui.dreams.appwidgets.ComplicationProvider;
import dagger.BindsInstance;
import dagger.Subcomponent;
/** */
@Subcomponent
-public interface AppWidgetOverlayComponent {
+public interface AppWidgetComponent {
/** */
@Subcomponent.Factory
interface Factory {
- AppWidgetOverlayComponent build(@BindsInstance ComponentName component,
- @BindsInstance OverlayHostView.LayoutParams layoutParams);
+ AppWidgetComponent build(@BindsInstance ComponentName component,
+ @BindsInstance ComplicationHostView.LayoutParams layoutParams);
}
- /** Builds a {@link AppWidgetOverlayProvider}. */
- AppWidgetOverlayProvider getAppWidgetOverlayProvider();
+ /** Builds a {@link ComplicationProvider}. */
+ ComplicationProvider getAppWidgetComplicationProvider();
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java
index ff5beb54bd89..0d4688ec880c 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java
@@ -16,11 +16,15 @@
package com.android.systemui.dreams.dagger;
+import com.android.systemui.dreams.appwidgets.dagger.AppWidgetComponent;
+
import dagger.Module;
/**
* Dagger Module providing Communal-related functionality.
*/
-@Module(subcomponents = {AppWidgetOverlayComponent.class, DreamOverlayComponent.class})
+@Module(subcomponents = {
+ AppWidgetComponent.class,
+ DreamOverlayComponent.class})
public interface DreamModule {
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/AppWidgetOverlayProviderTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/ComplicationProviderTest.java
index 0fc306b99b65..736556871376 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dreams/AppWidgetOverlayProviderTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/ComplicationProviderTest.java
@@ -33,8 +33,8 @@ import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.SysuiTestableContext;
-import com.android.systemui.dreams.appwidgets.AppWidgetOverlayProvider;
import com.android.systemui.dreams.appwidgets.AppWidgetProvider;
+import com.android.systemui.dreams.appwidgets.ComplicationProvider;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.utils.leaks.LeakCheckedTest;
@@ -48,7 +48,7 @@ import org.mockito.MockitoAnnotations;
@SmallTest
@RunWith(AndroidTestingRunner.class)
-public class AppWidgetOverlayProviderTest extends SysuiTestCase {
+public class ComplicationProviderTest extends SysuiTestCase {
@Mock
ActivityStarter mActivityStarter;
@@ -62,10 +62,10 @@ public class AppWidgetOverlayProviderTest extends SysuiTestCase {
AppWidgetHostView mAppWidgetHostView;
@Mock
- OverlayHost.CreationCallback mCreationCallback;
+ ComplicationHost.CreationCallback mCreationCallback;
@Mock
- OverlayHost.InteractionCallback mInteractionCallback;
+ ComplicationHost.InteractionCallback mInteractionCallback;
@Mock
PendingIntent mPendingIntent;
@@ -73,7 +73,7 @@ public class AppWidgetOverlayProviderTest extends SysuiTestCase {
@Mock
RemoteViews.RemoteResponse mRemoteResponse;
- AppWidgetOverlayProvider mOverlayProvider;
+ ComplicationProvider mComplicationProvider;
RemoteViews.InteractionHandler mInteractionHandler;
@@ -84,8 +84,9 @@ public class AppWidgetOverlayProviderTest extends SysuiTestCase {
public SysuiTestableContext mContext = new SysuiTestableContext(
InstrumentationRegistry.getContext(), mLeakCheck);
- OverlayHostView.LayoutParams mLayoutParams = new OverlayHostView.LayoutParams(
- OverlayHostView.LayoutParams.MATCH_PARENT, OverlayHostView.LayoutParams.MATCH_PARENT);
+ ComplicationHostView.LayoutParams mLayoutParams = new ComplicationHostView.LayoutParams(
+ ComplicationHostView.LayoutParams.MATCH_PARENT,
+ ComplicationHostView.LayoutParams.MATCH_PARENT);
@Before
public void setup() {
@@ -93,7 +94,7 @@ public class AppWidgetOverlayProviderTest extends SysuiTestCase {
when(mPendingIntent.isActivity()).thenReturn(true);
when(mAppWidgetProvider.getWidget(mComponentName)).thenReturn(mAppWidgetHostView);
- mOverlayProvider = new AppWidgetOverlayProvider(
+ mComplicationProvider = new ComplicationProvider(
mActivityStarter,
mComponentName,
mAppWidgetProvider,
@@ -103,7 +104,8 @@ public class AppWidgetOverlayProviderTest extends SysuiTestCase {
final ArgumentCaptor<RemoteViews.InteractionHandler> creationCallbackCapture =
ArgumentCaptor.forClass(RemoteViews.InteractionHandler.class);
- mOverlayProvider.onCreateOverlay(mContext, mCreationCallback, mInteractionCallback);
+ mComplicationProvider.onCreateComplication(mContext, mCreationCallback,
+ mInteractionCallback);
verify(mAppWidgetHostView, times(1))
.setInteractionHandler(creationCallbackCapture.capture());
mInteractionHandler = creationCallbackCapture.getValue();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java
index 904ee91c2642..5fa710f284b4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java
@@ -74,7 +74,7 @@ public class DreamOverlayServiceTest extends SysuiTestCase {
WindowManagerImpl mWindowManager;
@Mock
- OverlayProvider mProvider;
+ ComplicationProvider mProvider;
@Mock
DreamOverlayStateController mDreamOverlayStateController;
@@ -124,16 +124,16 @@ public class DreamOverlayServiceTest extends SysuiTestCase {
verify(mWindowManager).addView(any(), any());
// Add overlay.
- service.addOverlay(mProvider);
+ service.addComplication(mProvider);
mMainExecutor.runAllReady();
- final ArgumentCaptor<OverlayHost.CreationCallback> creationCallbackCapture =
- ArgumentCaptor.forClass(OverlayHost.CreationCallback.class);
- final ArgumentCaptor<OverlayHost.InteractionCallback> interactionCallbackCapture =
- ArgumentCaptor.forClass(OverlayHost.InteractionCallback.class);
+ final ArgumentCaptor<ComplicationHost.CreationCallback> creationCallbackCapture =
+ ArgumentCaptor.forClass(ComplicationHost.CreationCallback.class);
+ final ArgumentCaptor<ComplicationHost.InteractionCallback> interactionCallbackCapture =
+ ArgumentCaptor.forClass(ComplicationHost.InteractionCallback.class);
// Ensure overlay provider is asked to create view.
- verify(mProvider).onCreateOverlay(any(), creationCallbackCapture.capture(),
+ verify(mProvider).onCreateComplication(any(), creationCallbackCapture.capture(),
interactionCallbackCapture.capture());
mMainExecutor.runAllReady();
@@ -169,12 +169,12 @@ public class DreamOverlayServiceTest extends SysuiTestCase {
ArgumentCaptor.forClass(DreamOverlayStateController.Callback.class);
verify(mDreamOverlayStateController).addCallback(callbackCapture.capture());
- when(mDreamOverlayStateController.getOverlays()).thenReturn(Arrays.asList(mProvider));
- callbackCapture.getValue().onOverlayChanged();
+ when(mDreamOverlayStateController.getComplications()).thenReturn(Arrays.asList(mProvider));
+ callbackCapture.getValue().onComplicationsChanged();
mMainExecutor.runAllReady();
// Verify provider is asked to create overlay.
- verify(mProvider).onCreateOverlay(any(), any(), any());
+ verify(mProvider).onCreateComplication(any(), any(), any());
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java
index 4e97be37603e..1f4333e861aa 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java
@@ -43,7 +43,7 @@ public class DreamOverlayStateControllerTest extends SysuiTestCase {
DreamOverlayStateController.Callback mCallback;
@Mock
- OverlayProvider mProvider;
+ ComplicationProvider mProvider;
@Before
public void setup() {
@@ -55,32 +55,32 @@ public class DreamOverlayStateControllerTest extends SysuiTestCase {
final DreamOverlayStateController stateController = new DreamOverlayStateController();
stateController.addCallback(mCallback);
- // Add overlay and verify callback is notified.
- final DreamOverlayStateController.OverlayToken token =
- stateController.addOverlay(mProvider);
+ // Add complication and verify callback is notified.
+ final DreamOverlayStateController.ComplicationToken token =
+ stateController.addComplication(mProvider);
- verify(mCallback, times(1)).onOverlayChanged();
+ verify(mCallback, times(1)).onComplicationsChanged();
- final Collection<OverlayProvider> providers = stateController.getOverlays();
+ final Collection<ComplicationProvider> providers = stateController.getComplications();
assertEquals(providers.size(), 1);
assertTrue(providers.contains(mProvider));
clearInvocations(mCallback);
- // Remove overlay and verify callback is notified.
- stateController.removeOverlay(token);
- verify(mCallback, times(1)).onOverlayChanged();
+ // Remove complication and verify callback is notified.
+ stateController.removeComplication(token);
+ verify(mCallback, times(1)).onComplicationsChanged();
assertTrue(providers.isEmpty());
}
@Test
public void testNotifyOnCallbackAdd() {
final DreamOverlayStateController stateController = new DreamOverlayStateController();
- final DreamOverlayStateController.OverlayToken token =
- stateController.addOverlay(mProvider);
+ final DreamOverlayStateController.ComplicationToken token =
+ stateController.addComplication(mProvider);
// Verify callback occurs on add when an overlay is already present.
stateController.addCallback(mCallback);
- verify(mCallback, times(1)).onOverlayChanged();
+ verify(mCallback, times(1)).onComplicationsChanged();
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayPrimerTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/appwidgets/ComplicationPrimerTest.java
index 2e5b1653584b..adf110bb2494 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dreams/appwidgets/AppWidgetOverlayPrimerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/appwidgets/ComplicationPrimerTest.java
@@ -37,7 +37,7 @@ import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.SysuiTestableContext;
import com.android.systemui.dreams.DreamOverlayStateController;
-import com.android.systemui.dreams.dagger.AppWidgetOverlayComponent;
+import com.android.systemui.dreams.appwidgets.dagger.AppWidgetComponent;
import com.android.systemui.utils.leaks.LeakCheckedTest;
import org.junit.Before;
@@ -50,7 +50,7 @@ import org.mockito.MockitoAnnotations;
@SmallTest
@RunWith(AndroidTestingRunner.class)
-public class AppWidgetOverlayPrimerTest extends SysuiTestCase {
+public class ComplicationPrimerTest extends SysuiTestCase {
@Rule
public final LeakCheckedTest.SysuiLeakCheck mLeakCheck = new LeakCheckedTest.SysuiLeakCheck();
@@ -62,56 +62,57 @@ public class AppWidgetOverlayPrimerTest extends SysuiTestCase {
Resources mResources;
@Mock
- AppWidgetOverlayComponent mAppWidgetOverlayComponent1;
+ AppWidgetComponent mAppWidgetComplicationComponent1;
@Mock
- AppWidgetOverlayComponent mAppWidgetOverlayComponent2;
+ AppWidgetComponent mAppWidgetComplicationComponent2;
@Mock
- AppWidgetOverlayProvider mAppWidgetOverlayProvider1;
+ ComplicationProvider mComplicationProvider1;
@Mock
- AppWidgetOverlayProvider mAppWidgetOverlayProvider2;
+ ComplicationProvider mComplicationProvider2;
- final ComponentName mAppOverlayComponent1 =
+ final ComponentName mAppComplicationComponent1 =
ComponentName.unflattenFromString("com.foo.bar/.Baz");
- final ComponentName mAppOverlayComponent2 =
+ final ComponentName mAppComplicationComponent2 =
ComponentName.unflattenFromString("com.foo.bar/.Baz2");
- final int mAppOverlayGravity1 = Gravity.BOTTOM | Gravity.START;
- final int mAppOverlayGravity2 = Gravity.BOTTOM | Gravity.END;
+ final int mAppComplicationGravity1 = Gravity.BOTTOM | Gravity.START;
+ final int mAppComplicationGravity2 = Gravity.BOTTOM | Gravity.END;
- final String[] mComponents = new String[]{mAppOverlayComponent1.flattenToString(),
- mAppOverlayComponent2.flattenToString() };
- final int[] mPositions = new int[]{ mAppOverlayGravity1, mAppOverlayGravity2 };
+ final String[] mComponents = new String[]{mAppComplicationComponent1.flattenToString(),
+ mAppComplicationComponent2.flattenToString() };
+ final int[] mPositions = new int[]{mAppComplicationGravity1, mAppComplicationGravity2};
@Mock
DreamOverlayStateController mDreamOverlayStateController;
@Mock
- AppWidgetOverlayComponent.Factory mAppWidgetOverlayProviderFactory;
+ AppWidgetComponent.Factory mAppWidgetComplicationProviderFactory;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
- when(mAppWidgetOverlayProviderFactory.build(eq(mAppOverlayComponent1), any()))
- .thenReturn(mAppWidgetOverlayComponent1);
- when(mAppWidgetOverlayComponent1.getAppWidgetOverlayProvider())
- .thenReturn(mAppWidgetOverlayProvider1);
- when(mAppWidgetOverlayProviderFactory.build(eq(mAppOverlayComponent2), any()))
- .thenReturn(mAppWidgetOverlayComponent2);
- when(mAppWidgetOverlayComponent2.getAppWidgetOverlayProvider())
- .thenReturn(mAppWidgetOverlayProvider2);
- when(mResources.getIntArray(R.array.config_dreamOverlayPositions)).thenReturn(mPositions);
- when(mResources.getStringArray(R.array.config_dreamOverlayComponents))
+ when(mAppWidgetComplicationProviderFactory.build(eq(mAppComplicationComponent1), any()))
+ .thenReturn(mAppWidgetComplicationComponent1);
+ when(mAppWidgetComplicationComponent1.getAppWidgetComplicationProvider())
+ .thenReturn(mComplicationProvider1);
+ when(mAppWidgetComplicationProviderFactory.build(eq(mAppComplicationComponent2), any()))
+ .thenReturn(mAppWidgetComplicationComponent2);
+ when(mAppWidgetComplicationComponent2.getAppWidgetComplicationProvider())
+ .thenReturn(mComplicationProvider2);
+ when(mResources.getIntArray(R.array.config_dreamComplicationPositions))
+ .thenReturn(mPositions);
+ when(mResources.getStringArray(R.array.config_dreamAppWidgetComplications))
.thenReturn(mComponents);
}
@Test
public void testLoading() {
- final AppWidgetOverlayPrimer primer = new AppWidgetOverlayPrimer(mContext,
+ final ComplicationPrimer primer = new ComplicationPrimer(mContext,
mResources,
mDreamOverlayStateController,
- mAppWidgetOverlayProviderFactory);
+ mAppWidgetComplicationProviderFactory);
// Inform primer to begin.
primer.onBootCompleted();
@@ -120,7 +121,8 @@ public class AppWidgetOverlayPrimerTest extends SysuiTestCase {
{
final ArgumentCaptor<ConstraintLayout.LayoutParams> layoutParamsArgumentCaptor =
ArgumentCaptor.forClass(ConstraintLayout.LayoutParams.class);
- verify(mAppWidgetOverlayProviderFactory, times(1)).build(eq(mAppOverlayComponent1),
+ verify(mAppWidgetComplicationProviderFactory, times(1))
+ .build(eq(mAppComplicationComponent1),
layoutParamsArgumentCaptor.capture());
assertEquals(layoutParamsArgumentCaptor.getValue().startToStart,
@@ -129,14 +131,15 @@ public class AppWidgetOverlayPrimerTest extends SysuiTestCase {
ConstraintLayout.LayoutParams.PARENT_ID);
verify(mDreamOverlayStateController, times(1))
- .addOverlay(eq(mAppWidgetOverlayProvider1));
+ .addComplication(eq(mComplicationProvider1));
}
// Verify the second component is added to the state controller with the proper position.
{
final ArgumentCaptor<ConstraintLayout.LayoutParams> layoutParamsArgumentCaptor =
ArgumentCaptor.forClass(ConstraintLayout.LayoutParams.class);
- verify(mAppWidgetOverlayProviderFactory, times(1)).build(eq(mAppOverlayComponent2),
+ verify(mAppWidgetComplicationProviderFactory, times(1))
+ .build(eq(mAppComplicationComponent2),
layoutParamsArgumentCaptor.capture());
assertEquals(layoutParamsArgumentCaptor.getValue().endToEnd,
@@ -144,19 +147,19 @@ public class AppWidgetOverlayPrimerTest extends SysuiTestCase {
assertEquals(layoutParamsArgumentCaptor.getValue().bottomToBottom,
ConstraintLayout.LayoutParams.PARENT_ID);
verify(mDreamOverlayStateController, times(1))
- .addOverlay(eq(mAppWidgetOverlayProvider1));
+ .addComplication(eq(mComplicationProvider1));
}
}
@Test
public void testNoComponents() {
- when(mResources.getStringArray(R.array.config_dreamOverlayComponents))
+ when(mResources.getStringArray(R.array.config_dreamAppWidgetComplications))
.thenReturn(new String[]{});
- final AppWidgetOverlayPrimer primer = new AppWidgetOverlayPrimer(mContext,
+ final ComplicationPrimer primer = new ComplicationPrimer(mContext,
mResources,
mDreamOverlayStateController,
- mAppWidgetOverlayProviderFactory);
+ mAppWidgetComplicationProviderFactory);
// Inform primer to begin.
primer.onBootCompleted();
@@ -164,25 +167,25 @@ public class AppWidgetOverlayPrimerTest extends SysuiTestCase {
// Make sure there is no request to add a widget if no components are specified by the
// product.
- verify(mAppWidgetOverlayProviderFactory, never()).build(any(), any());
- verify(mDreamOverlayStateController, never()).addOverlay(any());
+ verify(mAppWidgetComplicationProviderFactory, never()).build(any(), any());
+ verify(mDreamOverlayStateController, never()).addComplication(any());
}
@Test
public void testNoPositions() {
- when(mResources.getIntArray(R.array.config_dreamOverlayPositions))
+ when(mResources.getIntArray(R.array.config_dreamComplicationPositions))
.thenReturn(new int[]{});
- final AppWidgetOverlayPrimer primer = new AppWidgetOverlayPrimer(mContext,
+ final ComplicationPrimer primer = new ComplicationPrimer(mContext,
mResources,
mDreamOverlayStateController,
- mAppWidgetOverlayProviderFactory);
+ mAppWidgetComplicationProviderFactory);
primer.onBootCompleted();
// Make sure there is no request to add a widget if no positions are specified by the
// product.
- verify(mAppWidgetOverlayProviderFactory, never()).build(any(), any());
- verify(mDreamOverlayStateController, never()).addOverlay(any());
+ verify(mAppWidgetComplicationProviderFactory, never()).build(any(), any());
+ verify(mDreamOverlayStateController, never()).addComplication(any());
}
}