Small changes to make VolumePanel more testable.
- Put a zen call requiring status_bar_service behind
the controller.
- Make the dialog window params overridable by subclasses.
Bug: 19260237
Change-Id: I2b75cde8a2f7efcd8ac001f181c151597bb7a978
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
index 0ad92b3..31264ee 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
@@ -350,6 +350,17 @@
};
}
+ protected LayoutParams getDialogLayoutParams(Window window, Resources res) {
+ final LayoutParams lp = window.getAttributes();
+ lp.token = null;
+ lp.y = res.getDimensionPixelOffset(com.android.systemui.R.dimen.volume_panel_top);
+ lp.type = LayoutParams.TYPE_STATUS_BAR_PANEL;
+ lp.format = PixelFormat.TRANSLUCENT;
+ lp.windowAnimations = com.android.systemui.R.style.VolumePanelAnimation;
+ lp.setTitle(TAG);
+ return lp;
+ }
+
public VolumePanel(Context context, ZenModeController zenController) {
mTag = String.format("%s.%08x", TAG, hashCode());
mContext = context;
@@ -408,14 +419,7 @@
mDialog.create();
- final LayoutParams lp = window.getAttributes();
- lp.token = null;
- lp.y = res.getDimensionPixelOffset(com.android.systemui.R.dimen.volume_panel_top);
- lp.type = LayoutParams.TYPE_STATUS_BAR_PANEL;
- lp.format = PixelFormat.TRANSLUCENT;
- lp.windowAnimations = com.android.systemui.R.style.VolumePanelAnimation;
- lp.setTitle(TAG);
- window.setAttributes(lp);
+ window.setAttributes(getDialogLayoutParams(window, res));
updateWidth();