OSDN Git Service

Add smart space to custom clock faces.
authorRobert Snoeberger <snoeberger@google.com>
Tue, 16 Apr 2019 20:55:21 +0000 (16:55 -0400)
committerRobert Snoeberger <snoeberger@google.com>
Wed, 17 Apr 2019 13:44:54 +0000 (09:44 -0400)
This changes adds a hook to the ClockPlugin to allow the
custom clock to control the position of the smart space.

Still todo:
 - move out of the way for the lock icon
 - don't slide smart space down on lock screen when no
   notifs are showing

Bug: 129348218
Test: Manually checked custom clock faces.
Change-Id: I2472f6b2bb54f94e2e673f01c78170c0e7f87627

17 files changed:
packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java
packages/SystemUI/res-keyguard/layout/analog_clock.xml
packages/SystemUI/res-keyguard/layout/bubble_clock.xml
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
packages/SystemUI/src/com/android/keyguard/clock/AnalogClockController.java
packages/SystemUI/src/com/android/keyguard/clock/BubbleClockController.java
packages/SystemUI/src/com/android/keyguard/clock/ClockLayout.java
packages/SystemUI/src/com/android/keyguard/clock/DefaultClockController.java
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
packages/SystemUI/tests/src/com/android/keyguard/clock/AnalogClockControllerTest.java
packages/SystemUI/tests/src/com/android/keyguard/clock/BubbleClockControllerTest.java
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java

index 58d50ea..6c6c927 100644 (file)
@@ -28,7 +28,7 @@ import java.util.TimeZone;
 public interface ClockPlugin extends Plugin {
 
     String ACTION = "com.android.systemui.action.PLUGIN_CLOCK";
-    int VERSION = 4;
+    int VERSION = 5;
 
     /**
      * Get the name of the clock face.
@@ -72,6 +72,14 @@ public interface ClockPlugin extends Plugin {
     }
 
     /**
+     * Returns the preferred Y position of the clock.
+     *
+     * @param totalHeight Height of the parent container.
+     * @return preferred Y position.
+     */
+    int getPreferredY(int totalHeight);
+
+    /**
      * Allows the plugin to clean up resources when no longer needed.
      *
      * Called when the view previously created by {@link ClockPlugin#getView()} has been detached
index cf6d35e..ee0df48 100644 (file)
     android:layout_width="match_parent"
     android:layout_height="match_parent"
   >
-  <TextClock
-      android:id="@+id/digital_clock"
-      android:paddingStart="20dp"
-      android:layout_marginTop="72dp"
-      android:layout_width="match_parent"
-      android:layout_height="wrap_content"
-      android:layout_gravity="top|left"
-      android:textSize="44dp"
-      android:letterSpacing="0.05"
-      android:textColor="?attr/wallpaperTextColor"
-      android:singleLine="true"
-      style="@style/widget_big"
-      android:format12Hour="@string/keyguard_widget_12_hours_format"
-      android:format24Hour="@string/keyguard_widget_24_hours_format"
-      android:elegantTextHeight="false"
-  />
   <com.android.keyguard.clock.ImageClock
       android:id="@+id/analog_clock"
       android:layout_width="wrap_content"
index f945b10..b44faa9 100644 (file)
     android:layout_width="match_parent"
     android:layout_height="match_parent"
   >
-  <TextClock
-      android:id="@+id/digital_clock"
-      android:paddingStart="20dp"
-      android:layout_marginTop="72dp"
-      android:layout_width="match_parent"
-      android:layout_height="wrap_content"
-      android:layout_gravity="top|left"
-      android:textSize="44dp"
-      android:letterSpacing="0.05"
-      android:textColor="?attr/wallpaperTextColor"
-      android:singleLine="true"
-      style="@style/widget_big"
-      android:format12Hour="@string/keyguard_widget_12_hours_format"
-      android:format24Hour="@string/keyguard_widget_24_hours_format"
-      android:elegantTextHeight="false"
-  />
   <com.android.keyguard.clock.ImageClock
       android:id="@+id/analog_clock"
       android:layout_width="wrap_content"
index 70366a8..fbb30d2 100644 (file)
@@ -298,6 +298,20 @@ public class KeyguardClockSwitch extends RelativeLayout {
     }
 
     /**
+     * Returns the preferred Y position of the clock.
+     *
+     * @param totalHeight Height of the parent container.
+     * @return preferred Y position.
+     */
+    int getPreferredY(int totalHeight) {
+        if (mClockPlugin != null) {
+            return mClockPlugin.getPreferredY(totalHeight);
+        } else {
+            return totalHeight / 2;
+        }
+    }
+
+    /**
      * Refresh the time of the clock, due to either time tick broadcast or doze time tick alarm.
      */
     public void refresh() {
index 0369e4c..b02d514 100644 (file)
@@ -241,6 +241,16 @@ public class KeyguardStatusView extends GridLayout implements
         return mClockView.getTextSize();
     }
 
+    /**
+     * Returns the preferred Y position of the clock.
+     *
+     * @param totalHeight The height available to position the clock.
+     * @return Y position of clock.
+     */
+    public int getClockPreferredY(int totalHeight) {
+        return mClockView.getPreferredY(totalHeight);
+    }
+
     private void updateLogoutView() {
         if (mLogoutView == null) {
             return;
index 1652121..7d1587c 100644 (file)
@@ -21,6 +21,7 @@ import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.Color;
 import android.graphics.Paint.Style;
+import android.util.TypedValue;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.TextClock;
@@ -61,7 +62,6 @@ public class AnalogClockController implements ClockPlugin {
      * Custom clock shown on AOD screen and behind stack scroller on lock.
      */
     private ClockLayout mBigClockView;
-    private TextClock mDigitalClock;
     private ImageClock mAnalogClock;
 
     /**
@@ -71,11 +71,6 @@ public class AnalogClockController implements ClockPlugin {
     private TextClock mLockClock;
 
     /**
-     * Controller for transition to dark state.
-     */
-    private CrossFadeDarkController mDarkController;
-
-    /**
      * Create a BubbleClockController instance.
      *
      * @param res Resources contains title and thumbnail.
@@ -92,24 +87,20 @@ public class AnalogClockController implements ClockPlugin {
     private void createViews() {
         mBigClockView = (ClockLayout) mLayoutInflater.inflate(R.layout.analog_clock, null);
         mAnalogClock = mBigClockView.findViewById(R.id.analog_clock);
-        mDigitalClock = mBigClockView.findViewById(R.id.digital_clock);
 
         mView = mLayoutInflater.inflate(R.layout.digital_clock, null);
         mLockClock = mView.findViewById(R.id.lock_screen_clock);
-        mLockClock.setVisibility(View.GONE);
-
-        mDarkController = new CrossFadeDarkController(mDigitalClock, mLockClock);
+        final int textSize = mResources.getDimensionPixelSize(R.dimen.widget_title_font_size);
+        mLockClock.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
     }
 
 
     @Override
     public void onDestroyView() {
         mBigClockView = null;
-        mDigitalClock = null;
         mAnalogClock = null;
         mView = null;
         mLockClock = null;
-        mDarkController = null;
     }
 
     @Override
@@ -161,12 +152,15 @@ public class AnalogClockController implements ClockPlugin {
     }
 
     @Override
+    public int getPreferredY(int totalHeight) {
+        return totalHeight / 4;
+    }
+
+    @Override
     public void setStyle(Style style) {}
 
     @Override
-    public void setTextColor(int color) {
-        mLockClock.setTextColor(color);
-    }
+    public void setTextColor(int color) { }
 
     @Override
     public void setColorPalette(boolean supportsDarkText, int[] colorPalette) {
@@ -174,7 +168,7 @@ public class AnalogClockController implements ClockPlugin {
             return;
         }
         final int length = colorPalette.length;
-        mDigitalClock.setTextColor(colorPalette[Math.max(0, length - 5)]);
+        mLockClock.setTextColor(colorPalette[Math.max(0, length - 2)]);
         mAnalogClock.setClockColors(colorPalette[Math.max(0, length - 5)],
                 colorPalette[Math.max(0, length - 2)]);
     }
@@ -183,14 +177,11 @@ public class AnalogClockController implements ClockPlugin {
     public void onTimeTick() {
         mAnalogClock.onTimeChanged();
         mBigClockView.onTimeChanged();
-        mDigitalClock.refresh();
         mLockClock.refresh();
     }
 
     @Override
-    public void setDarkAmount(float darkAmount) {
-        mDarkController.setDarkAmount(darkAmount);
-    }
+    public void setDarkAmount(float darkAmount) { }
 
     @Override
     public void onTimeZoneChanged(TimeZone timeZone) {
@@ -199,6 +190,6 @@ public class AnalogClockController implements ClockPlugin {
 
     @Override
     public boolean shouldShowStatusArea() {
-        return false;
+        return true;
     }
 }
index 6069a5e..cadfb79 100644 (file)
@@ -21,6 +21,7 @@ import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.Color;
 import android.graphics.Paint.Style;
+import android.util.TypedValue;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.TextClock;
@@ -61,7 +62,6 @@ public class BubbleClockController implements ClockPlugin {
      * Custom clock shown on AOD screen and behind stack scroller on lock.
      */
     private ClockLayout mView;
-    private TextClock mDigitalClock;
     private ImageClock mAnalogClock;
 
     /**
@@ -71,11 +71,6 @@ public class BubbleClockController implements ClockPlugin {
     private TextClock mLockClock;
 
     /**
-     * Controller for transition to dark state.
-     */
-    private CrossFadeDarkController mDarkController;
-
-    /**
      * Create a BubbleClockController instance.
      *
      * @param res Resources contains title and thumbnail.
@@ -91,24 +86,20 @@ public class BubbleClockController implements ClockPlugin {
 
     private void createViews() {
         mView = (ClockLayout) mLayoutInflater.inflate(R.layout.bubble_clock, null);
-        mDigitalClock = (TextClock) mView.findViewById(R.id.digital_clock);
         mAnalogClock = (ImageClock) mView.findViewById(R.id.analog_clock);
 
         mLockClockContainer = mLayoutInflater.inflate(R.layout.digital_clock, null);
         mLockClock = (TextClock) mLockClockContainer.findViewById(R.id.lock_screen_clock);
-        mLockClock.setVisibility(View.GONE);
-
-        mDarkController = new CrossFadeDarkController(mDigitalClock, mLockClock);
+        final int textSize = mResources.getDimensionPixelSize(R.dimen.widget_title_font_size);
+        mLockClock.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
     }
 
     @Override
     public void onDestroyView() {
         mView = null;
-        mDigitalClock = null;
         mAnalogClock = null;
         mLockClockContainer = null;
         mLockClock = null;
-        mDarkController = null;
     }
 
     @Override
@@ -160,12 +151,15 @@ public class BubbleClockController implements ClockPlugin {
     }
 
     @Override
+    public int getPreferredY(int totalHeight) {
+        return totalHeight / 4;
+    }
+
+    @Override
     public void setStyle(Style style) {}
 
     @Override
-    public void setTextColor(int color) {
-        mLockClock.setTextColor(color);
-    }
+    public void setTextColor(int color) { }
 
     @Override
     public void setColorPalette(boolean supportsDarkText, int[] colorPalette) {
@@ -173,21 +167,18 @@ public class BubbleClockController implements ClockPlugin {
             return;
         }
         final int length = colorPalette.length;
-        mDigitalClock.setTextColor(colorPalette[Math.max(0, length - 6)]);
+        mLockClock.setTextColor(colorPalette[Math.max(0, length - 3)]);
         mAnalogClock.setClockColors(colorPalette[Math.max(0, length - 6)],
                 colorPalette[Math.max(0, length - 3)]);
     }
 
     @Override
-    public void setDarkAmount(float darkAmount) {
-        mDarkController.setDarkAmount(darkAmount);
-    }
+    public void setDarkAmount(float darkAmount) { }
 
     @Override
     public void onTimeTick() {
         mAnalogClock.onTimeChanged();
         mView.onTimeChanged();
-        mDigitalClock.refresh();
         mLockClock.refresh();
     }
 
@@ -198,6 +189,6 @@ public class BubbleClockController implements ClockPlugin {
 
     @Override
     public boolean shouldShowStatusArea() {
-        return false;
+        return true;
     }
 }
index 55088a8..962b8f8 100644 (file)
@@ -22,7 +22,6 @@ import android.content.res.Resources;
 import android.util.AttributeSet;
 import android.view.View;
 import android.widget.FrameLayout;
-import android.widget.FrameLayout.LayoutParams;
 
 import com.android.keyguard.R;
 
@@ -36,11 +35,10 @@ public class ClockLayout extends FrameLayout {
     /**
      * Clock face views.
      */
-    private View mDigitalClock;
     private View mAnalogClock;
 
     /**
-     * Pixel shifting amplitidues used to prevent screen burn-in.
+     * Pixel shifting amplitudes used to prevent screen burn-in.
      */
     private int mBurnInPreventionOffsetX;
     private int mBurnInPreventionOffsetY;
@@ -60,7 +58,6 @@ public class ClockLayout extends FrameLayout {
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mDigitalClock = findViewById(R.id.digital_clock);
         mAnalogClock = findViewById(R.id.analog_clock);
 
         // Get pixel shifting X, Y amplitudes from resources.
@@ -87,13 +84,6 @@ public class ClockLayout extends FrameLayout {
         final float offsetY = getBurnInOffset(mBurnInPreventionOffsetY * 2, false)
                 - mBurnInPreventionOffsetY;
 
-        // Put digital clock in two left corner of the screen.
-        if (mDigitalClock != null) {
-            LayoutParams params = (LayoutParams) mDigitalClock.getLayoutParams();
-            mDigitalClock.setX(offsetX + params.leftMargin);
-            mDigitalClock.setY(offsetY + params.topMargin);
-        }
-
         // Put the analog clock in the middle of the screen.
         if (mAnalogClock != null) {
             mAnalogClock.setX(Math.max(0f, 0.5f * (getWidth() - mAnalogClock.getWidth()))
index 488cb27..ce1f09c 100644 (file)
@@ -145,6 +145,11 @@ public class DefaultClockController implements ClockPlugin {
     }
 
     @Override
+    public int getPreferredY(int totalHeight) {
+        return totalHeight / 2;
+    }
+
+    @Override
     public void setStyle(Style style) {}
 
     @Override
index 562e535..4b6ef4f 100644 (file)
@@ -4842,8 +4842,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
      * If the shelf should be visible when the device is in ambient mode (dozing.)
      */
     @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
-    public void setShowDarkShelf(boolean showDarkShelf) {
-        mShowDarkShelf = showDarkShelf;
+    public void showDarkShelf() {
+        mShowDarkShelf = true;
     }
 
     private void updateDarkShelfVisibility() {
index 195d02d..5d144a2 100644 (file)
@@ -220,7 +220,6 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
         if (mStatusBarStateController.isDozing()
                 && mStatusBarComponent.getPanel().hasCustomClock()) {
             state |= DISABLE_CLOCK | DISABLE_SYSTEM_INFO;
-            state &= ~DISABLE_NOTIFICATION_ICONS;
         }
 
         return state;
index c68fdd4..d59f248 100644 (file)
@@ -22,7 +22,6 @@ import static com.android.systemui.statusbar.notification.NotificationUtils.inte
 import android.content.res.Resources;
 import android.util.MathUtils;
 
-import com.android.internal.annotations.VisibleForTesting;
 import com.android.keyguard.KeyguardStatusView;
 import com.android.systemui.Interpolators;
 import com.android.systemui.R;
@@ -55,6 +54,11 @@ public class KeyguardClockPositionAlgorithm {
     private int mKeyguardStatusHeight;
 
     /**
+     * Preferred Y position of clock.
+     */
+    private int mClockPreferredY;
+
+    /**
      * Height of notification stack: Sum of height of each notification.
      */
     private int mNotificationStackHeight;
@@ -117,14 +121,15 @@ public class KeyguardClockPositionAlgorithm {
     }
 
     public void setup(int minTopMargin, int maxShadeBottom, int notificationStackHeight,
-            float panelExpansion, int parentHeight, int keyguardStatusHeight, float dark,
-            boolean secure, float emptyDragAmount) {
+            float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY,
+            float dark, boolean secure, float emptyDragAmount) {
         mMinTopMargin = minTopMargin + mContainerTopPadding;
         mMaxShadeBottom = maxShadeBottom;
         mNotificationStackHeight = notificationStackHeight;
         mPanelExpansion = panelExpansion;
         mHeight = parentHeight;
         mKeyguardStatusHeight = keyguardStatusHeight;
+        mClockPreferredY = clockPreferredY;
         mDarkAmount = dark;
         mCurrentlySecure = secure;
         mEmptyDragAmount = emptyDragAmount;
@@ -146,6 +151,10 @@ public class KeyguardClockPositionAlgorithm {
         return mHeight / 2 - mKeyguardStatusHeight - mClockNotificationsMargin;
     }
 
+    private int getPreferredClockY() {
+        return mClockPreferredY - mKeyguardStatusHeight - mClockNotificationsMargin;
+    }
+
     /**
      * Vertically align the clock and the shade in the available space considering only
      * a percentage of the clock height defined by {@code CLOCK_HEIGHT_WEIGHT}.
@@ -172,7 +181,7 @@ public class KeyguardClockPositionAlgorithm {
 
     private int getClockY() {
         // Dark: Align the bottom edge of the clock at about half of the screen:
-        float clockYDark = getMaxClockY() + burnInPreventionOffsetY();
+        float clockYDark = getPreferredClockY() + burnInPreventionOffsetY();
         clockYDark = MathUtils.max(0, clockYDark);
 
         float clockYRegular = getExpandedClockPosition();
index dd957b4..9ae2996 100644 (file)
@@ -208,9 +208,9 @@ public class NotificationPanelView extends PanelView implements
     private int mUnlockMoveDistance;
     private float mEmptyDragAmount;
 
-    private KeyguardClockPositionAlgorithm mClockPositionAlgorithm =
+    private final KeyguardClockPositionAlgorithm mClockPositionAlgorithm =
             new KeyguardClockPositionAlgorithm();
-    private KeyguardClockPositionAlgorithm.Result mClockPositionResult =
+    private final KeyguardClockPositionAlgorithm.Result mClockPositionResult =
             new KeyguardClockPositionAlgorithm.Result();
     private boolean mIsExpanding;
 
@@ -627,6 +627,7 @@ public class NotificationPanelView extends PanelView implements
         } else {
             int totalHeight = getHeight();
             int bottomPadding = Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding);
+            int clockPreferredY = mKeyguardStatusView.getClockPreferredY(totalHeight);
             mClockPositionAlgorithm.setup(
                     mStatusBarMinHeight,
                     totalHeight - bottomPadding,
@@ -634,6 +635,7 @@ public class NotificationPanelView extends PanelView implements
                     getExpandedFraction(),
                     totalHeight,
                     mKeyguardStatusView.getHeight(),
+                    clockPreferredY,
                     mInterpolatedDarkAmount,
                     mStatusBar.isKeyguardCurrentlySecure(),
                     mEmptyDragAmount);
@@ -2830,7 +2832,7 @@ public class NotificationPanelView extends PanelView implements
         mDozing = dozing;
         mNotificationStackScroller.setDark(mDozing, animate, wakeUpTouchLocation);
         if (mDozing) {
-            mNotificationStackScroller.setShowDarkShelf(!hasCustomClock());
+            mNotificationStackScroller.showDarkShelf();
         }
         mKeyguardBottomArea.setDozing(mDozing, animate);
 
index 4bb2395..3f48ea7 100644 (file)
@@ -54,20 +54,20 @@ public final class AnalogClockControllerTest extends SysuiTestCase {
     }
 
     @Test
-    public void setDarkAmount_fadeIn() {
+    public void setDarkAmount_AOD() {
         ViewGroup smallClockFrame = (ViewGroup) mClockController.getView();
         View smallClock = smallClockFrame.getChildAt(0);
         // WHEN dark amount is set to AOD
         mClockController.setDarkAmount(1f);
-        // THEN small clock should not be shown.
-        assertThat(smallClock.getVisibility()).isEqualTo(View.GONE);
+        // THEN small clock should be shown.
+        assertThat(smallClock.getVisibility()).isEqualTo(View.VISIBLE);
     }
 
     @Test
-    public void setTextColor_setDigitalClock() {
+    public void setColorPalette_setDigitalClock() {
         ViewGroup smallClock = (ViewGroup) mClockController.getView();
-        // WHEN text color is set
-        mClockController.setTextColor(42);
+        // WHEN color palette is set
+        mClockController.setColorPalette(true, new int[]{42});
         // THEN child of small clock should have text color set.
         TextView digitalClock = (TextView) smallClock.getChildAt(0);
         assertThat(digitalClock.getCurrentTextColor()).isEqualTo(42);
index f03c234..90083b4 100644 (file)
@@ -53,20 +53,20 @@ public final class BubbleClockControllerTest extends SysuiTestCase {
     }
 
     @Test
-    public void setDarkAmount_fadeIn() {
+    public void setDarkAmount_AOD() {
         ViewGroup smallClockFrame = (ViewGroup) mClockController.getView();
         View smallClock = smallClockFrame.getChildAt(0);
         // WHEN dark amount is set to AOD
         mClockController.setDarkAmount(1f);
         // THEN small clock should not be shown.
-        assertThat(smallClock.getVisibility()).isEqualTo(View.GONE);
+        assertThat(smallClock.getVisibility()).isEqualTo(View.VISIBLE);
     }
 
     @Test
-    public void setTextColor_setDigitalClock() {
+    public void setColorPalette_setDigitalClock() {
         ViewGroup smallClock = (ViewGroup) mClockController.getView();
         // WHEN text color is set
-        mClockController.setTextColor(42);
+        mClockController.setColorPalette(true, new int[]{42});
         // THEN child of small clock should have text color set.
         TextView digitalClock = (TextView) smallClock.getChildAt(0);
         assertThat(digitalClock.getCurrentTextColor()).isEqualTo(42);
index fcf4c71..3f4d96c 100644 (file)
@@ -35,6 +35,7 @@ import org.junit.runner.RunWith;
 public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
 
     private static final int SCREEN_HEIGHT = 2000;
+    private static final int PREFERRED_CLOCK_Y = SCREEN_HEIGHT / 2;
     private static final int EMPTY_MARGIN = 0;
     private static final int EMPTY_HEIGHT = 0;
     private static final boolean SECURE_LOCKED = false;
@@ -305,8 +306,8 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
 
     private void positionClock() {
         mClockPositionAlgorithm.setup(EMPTY_MARGIN, SCREEN_HEIGHT, mNotificationStackHeight,
-                mPanelExpansion, SCREEN_HEIGHT, mKeyguardStatusHeight, mDark, SECURE_LOCKED,
-                ZERO_DRAG);
+                mPanelExpansion, SCREEN_HEIGHT, mKeyguardStatusHeight, PREFERRED_CLOCK_Y, mDark,
+                SECURE_LOCKED, ZERO_DRAG);
         mClockPositionAlgorithm.run(mClockPosition);
     }
 }
index 6d6af47..cbf626c 100644 (file)
@@ -117,7 +117,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
         mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */);
         InOrder inOrder = inOrder(mNotificationStackScrollLayout, mStatusBarStateController);
         inOrder.verify(mNotificationStackScrollLayout).setDark(eq(true), eq(true), eq(null));
-        inOrder.verify(mNotificationStackScrollLayout).setShowDarkShelf(eq(true));
+        inOrder.verify(mNotificationStackScrollLayout).showDarkShelf();
         inOrder.verify(mStatusBarStateController).setDozeAmount(eq(1f), eq(true));
     }
 
@@ -125,14 +125,14 @@ public class NotificationPanelViewTest extends SysuiTestCase {
     public void testSetDozing_showsDarkShelfWithDefaultClock() {
         when(mKeyguardStatusView.hasCustomClock()).thenReturn(false);
         mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */);
-        verify(mNotificationStackScrollLayout).setShowDarkShelf(eq(true));
+        verify(mNotificationStackScrollLayout).showDarkShelf();
     }
 
     @Test
-    public void testSetDozing_hidesDarkShelfWhenCustomClock() {
+    public void testSetDozing_showsDarkShelfWhenCustomClock() {
         when(mKeyguardStatusView.hasCustomClock()).thenReturn(true);
         mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */);
-        verify(mNotificationStackScrollLayout).setShowDarkShelf(eq(false));
+        verify(mNotificationStackScrollLayout).showDarkShelf();
     }
 
     @Test