Loading packages/SystemUI/res/values/config.xml +0 −7 Original line number Diff line number Diff line Loading @@ -79,13 +79,6 @@ <!-- Show camera affordance on Keyguard --> <bool name="config_keyguardShowCameraAffordance">false</bool> <!-- Whether we should use SRC drawing mode when drawing the scrim behind. If this flag is set, we change the canvas opacity so libhwui doesn't call glClear on our surface, and then we draw the scrim with SRC to overwrite the whole buffer, which saves us a layer of overdraw. However, SRC performs poorly on some devices, where it is more efficient to glClear + SRC_OVER, in which case this flag should be disabled. --> <bool name="config_status_bar_scrim_behind_use_src">true</bool> <!-- The length of the vibration when the notification pops open. --> <integer name="one_finger_pop_duration_ms">10</integer> Loading packages/SystemUI/src/com/android/systemui/statusbar/ScrimView.java +2 −79 Original line number Diff line number Diff line Loading @@ -53,11 +53,8 @@ public class ScrimView extends View implements ConfigurationController.Configura private static final String TAG = "ScrimView"; private final ColorExtractor.GradientColors mColors; private int mDensity; private boolean mDrawAsSrc; private float mViewAlpha = 1.0f; private ValueAnimator mAlphaAnimator; private Rect mExcludedRect = new Rect(); private boolean mHasExcludedArea; private Drawable mDrawable; private PorterDuffColorFilter mColorFilter; private int mTintColor; Loading Loading @@ -137,59 +134,8 @@ public class ScrimView extends View implements ConfigurationController.Configura @Override protected void onDraw(Canvas canvas) { if (mDrawAsSrc || mDrawable.getAlpha() > 0) { if (!mHasExcludedArea) { if (mDrawable.getAlpha() > 0) { mDrawable.draw(canvas); } else { if (mExcludedRect.top > 0) { canvas.save(); canvas.clipRect(0, 0, getWidth(), mExcludedRect.top); mDrawable.draw(canvas); canvas.restore(); } if (mExcludedRect.left > 0) { canvas.save(); canvas.clipRect(0, mExcludedRect.top, mExcludedRect.left, mExcludedRect.bottom); mDrawable.draw(canvas); canvas.restore(); } if (mExcludedRect.right < getWidth()) { canvas.save(); canvas.clipRect(mExcludedRect.right, mExcludedRect.top, getWidth(), mExcludedRect.bottom); mDrawable.draw(canvas); canvas.restore(); } if (mExcludedRect.bottom < getHeight()) { canvas.save(); canvas.clipRect(0, mExcludedRect.bottom, getWidth(), getHeight()); mDrawable.draw(canvas); canvas.restore(); } // We also need to draw the rounded corners of the background canvas.save(); canvas.clipRect(mExcludedRect.left, mExcludedRect.top, mExcludedRect.left + mCornerRadius, mExcludedRect.top + mCornerRadius); mDrawable.draw(canvas); canvas.restore(); canvas.save(); canvas.clipRect(mExcludedRect.right - mCornerRadius, mExcludedRect.top, mExcludedRect.right, mExcludedRect.top + mCornerRadius); mDrawable.draw(canvas); canvas.restore(); canvas.save(); canvas.clipRect(mExcludedRect.left, mExcludedRect.bottom - mCornerRadius, mExcludedRect.left + mCornerRadius, mExcludedRect.bottom); mDrawable.draw(canvas); canvas.restore(); canvas.save(); canvas.clipRect(mExcludedRect.right - mCornerRadius, mExcludedRect.bottom - mCornerRadius, mExcludedRect.right, mExcludedRect.bottom); mDrawable.draw(canvas); canvas.restore(); } } } Loading @@ -198,7 +144,6 @@ public class ScrimView extends View implements ConfigurationController.Configura mDrawable.setCallback(this); mDrawable.setBounds(getLeft(), getTop(), getRight(), getBottom()); mDrawable.setAlpha((int) (255 * mViewAlpha)); setDrawAsSrc(mDrawAsSrc); updateScreenSize(); invalidate(); } Loading @@ -211,12 +156,6 @@ public class ScrimView extends View implements ConfigurationController.Configura } } public void setDrawAsSrc(boolean asSrc) { mDrawAsSrc = asSrc; PorterDuff.Mode mode = asSrc ? PorterDuff.Mode.SRC : PorterDuff.Mode.SRC_OVER; mDrawable.setXfermode(new PorterDuffXfermode(mode)); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); Loading Loading @@ -328,22 +267,6 @@ public class ScrimView extends View implements ConfigurationController.Configura return mViewAlpha; } public void setExcludedArea(Rect area) { if (area == null) { mHasExcludedArea = false; invalidate(); return; } int left = Math.max(area.left, 0); int top = Math.max(area.top, 0); int right = Math.min(area.right, getWidth()); int bottom = Math.min(area.bottom, getHeight()); mExcludedRect.set(left, top, right, bottom); mHasExcludedArea = left < right && top < bottom; invalidate(); } public void setChangeRunnable(Runnable changeRunnable) { mChangeRunnable = changeRunnable; } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +2 −65 Original line number Diff line number Diff line Loading @@ -394,9 +394,6 @@ public class NotificationStackScrollLayout extends ViewGroup }; private PorterDuffXfermode mSrcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC); private boolean mPulsing; private boolean mDrawBackgroundAsSrc; private boolean mFadingOut; private boolean mParentNotFullyVisible; private boolean mGroupExpandedForMeasure; private boolean mScrollable; private View mForcedScroll; Loading Loading @@ -789,21 +786,6 @@ public class NotificationStackScrollLayout extends ViewGroup R.dimen.heads_up_status_bar_padding); } public void setDrawBackgroundAsSrc(boolean asSrc) { mDrawBackgroundAsSrc = asSrc; updateSrcDrawing(); } private void updateSrcDrawing() { if (!mShouldDrawNotificationBackground) { return; } mBackgroundPaint.setXfermode(mDrawBackgroundAsSrc && !mFadingOut && !mParentNotFullyVisible ? mSrcMode : null); invalidate(); } private void notifyHeightChangeListener(ExpandableView view) { notifyHeightChangeListener(view, false /* needsAnimation */); } Loading Loading @@ -1128,7 +1110,6 @@ public class NotificationStackScrollLayout extends ViewGroup && !mHeadsUpAnimatingAway; if (mIsClipped != clipped) { mIsClipped = clipped; updateFadingState(); } if (animatingClipping) { Loading Loading @@ -2447,7 +2428,7 @@ public class NotificationStackScrollLayout extends ViewGroup startBackgroundAnimation(); } else { mCurrentBounds.set(mBackgroundBounds); applyCurrentBackgroundBounds(); invalidate(); } } else { abortBackgroundAnimators(); Loading Loading @@ -2575,25 +2556,11 @@ public class NotificationStackScrollLayout extends ViewGroup private void setBackgroundTop(int top) { mCurrentBounds.top = top; applyCurrentBackgroundBounds(); invalidate(); } public void setBackgroundBottom(int bottom) { mCurrentBounds.bottom = bottom; applyCurrentBackgroundBounds(); } private void applyCurrentBackgroundBounds() { // If the background of the notification is not being drawn, then there is no need to // exclude an area in the scrim. Rather, the scrim's color should serve as the background. if (!mShouldDrawNotificationBackground) { return; } final boolean awake = mInterpolatedDarkAmount != 0 || mAmbientState.isDark(); mScrimController.setExcludedBackgroundArea( mFadingOut || mParentNotFullyVisible || awake || mIsClipped ? null : mCurrentBounds); invalidate(); } Loading Loading @@ -4176,7 +4143,6 @@ public class NotificationStackScrollLayout extends ViewGroup updateBackground(); } requestChildrenUpdate(); applyCurrentBackgroundBounds(); updateWillNotDraw(); notifyHeightChangeListener(mShelf); } Loading Loading @@ -4650,35 +4616,6 @@ public class NotificationStackScrollLayout extends ViewGroup } } public void setFadingOut(boolean fadingOut) { if (fadingOut != mFadingOut) { mFadingOut = fadingOut; updateFadingState(); } } public void setParentNotFullyVisible(boolean parentNotFullyVisible) { if (mScrimController == null) { // we're not set up yet. return; } if (parentNotFullyVisible != mParentNotFullyVisible) { mParentNotFullyVisible = parentNotFullyVisible; updateFadingState(); } } private void updateFadingState() { applyCurrentBackgroundBounds(); updateSrcDrawing(); } @Override public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) { super.setAlpha(alpha); setFadingOut(alpha != 1.0f); } public void setQsExpanded(boolean qsExpanded) { mQsExpanded = qsExpanded; updateAlgorithmLayoutMinHeight(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +0 −34 Original line number Diff line number Diff line Loading @@ -2668,32 +2668,6 @@ public class NotificationPanelView extends PanelView implements setLaunchingAffordance(false); } @Override public void setAlpha(float alpha) { super.setAlpha(alpha); updateFullyVisibleState(false /* forceNotFullyVisible */); } /** * Must be called before starting a ViewPropertyAnimator alpha animation because those * do NOT call setAlpha and therefore don't properly update the fullyVisibleState. */ public void notifyStartFading() { updateFullyVisibleState(true /* forceNotFullyVisible */); } @Override public void setVisibility(int visibility) { super.setVisibility(visibility); updateFullyVisibleState(false /* forceNotFullyVisible */); } private void updateFullyVisibleState(boolean forceNotFullyVisible) { mNotificationStackScroller.setParentNotFullyVisible(forceNotFullyVisible || getAlpha() != 1.0f || getVisibility() != VISIBLE); } /** * Set whether we are currently launching an affordance. This is currently only set when * launched via a camera gesture. Loading Loading @@ -2992,10 +2966,6 @@ public class NotificationPanelView extends PanelView implements mNotificationStackScroller.setActivatedChild(o); } public void setParentNotFullyVisible(boolean parent) { mNotificationStackScroller.setParentNotFullyVisible(parent); } public void runAfterAnimationFinished(Runnable r) { mNotificationStackScroller.runAfterAnimationFinished(r); } Loading @@ -3020,8 +2990,4 @@ public class NotificationPanelView extends PanelView implements mNotificationStackScroller.setScrimController(scrimController); updateShowEmptyShadeView(); } public void setDrawBackgroundAsSrc(boolean asSrc) { mNotificationStackScroller.setDrawBackgroundAsSrc(asSrc); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +0 −8 Original line number Diff line number Diff line Loading @@ -685,10 +685,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo return scrim.getTag(TAG_KEY_ANIM) != null; } public void setDrawBehindAsSrc(boolean asSrc) { mScrimBehind.setDrawAsSrc(asSrc); } @VisibleForTesting void setOnAnimationFinished(Runnable onAnimationFinished) { mOnAnimationFinished = onAnimationFinished; Loading Loading @@ -800,10 +796,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo return Handler.getMain(); } public void setExcludedBackgroundArea(Rect area) { mScrimBehind.setExcludedArea(area); } public int getBackgroundColor() { int color = mLockColors.getMainColor(); return Color.argb((int) (mScrimBehind.getViewAlpha() * Color.alpha(color)), Loading Loading
packages/SystemUI/res/values/config.xml +0 −7 Original line number Diff line number Diff line Loading @@ -79,13 +79,6 @@ <!-- Show camera affordance on Keyguard --> <bool name="config_keyguardShowCameraAffordance">false</bool> <!-- Whether we should use SRC drawing mode when drawing the scrim behind. If this flag is set, we change the canvas opacity so libhwui doesn't call glClear on our surface, and then we draw the scrim with SRC to overwrite the whole buffer, which saves us a layer of overdraw. However, SRC performs poorly on some devices, where it is more efficient to glClear + SRC_OVER, in which case this flag should be disabled. --> <bool name="config_status_bar_scrim_behind_use_src">true</bool> <!-- The length of the vibration when the notification pops open. --> <integer name="one_finger_pop_duration_ms">10</integer> Loading
packages/SystemUI/src/com/android/systemui/statusbar/ScrimView.java +2 −79 Original line number Diff line number Diff line Loading @@ -53,11 +53,8 @@ public class ScrimView extends View implements ConfigurationController.Configura private static final String TAG = "ScrimView"; private final ColorExtractor.GradientColors mColors; private int mDensity; private boolean mDrawAsSrc; private float mViewAlpha = 1.0f; private ValueAnimator mAlphaAnimator; private Rect mExcludedRect = new Rect(); private boolean mHasExcludedArea; private Drawable mDrawable; private PorterDuffColorFilter mColorFilter; private int mTintColor; Loading Loading @@ -137,59 +134,8 @@ public class ScrimView extends View implements ConfigurationController.Configura @Override protected void onDraw(Canvas canvas) { if (mDrawAsSrc || mDrawable.getAlpha() > 0) { if (!mHasExcludedArea) { if (mDrawable.getAlpha() > 0) { mDrawable.draw(canvas); } else { if (mExcludedRect.top > 0) { canvas.save(); canvas.clipRect(0, 0, getWidth(), mExcludedRect.top); mDrawable.draw(canvas); canvas.restore(); } if (mExcludedRect.left > 0) { canvas.save(); canvas.clipRect(0, mExcludedRect.top, mExcludedRect.left, mExcludedRect.bottom); mDrawable.draw(canvas); canvas.restore(); } if (mExcludedRect.right < getWidth()) { canvas.save(); canvas.clipRect(mExcludedRect.right, mExcludedRect.top, getWidth(), mExcludedRect.bottom); mDrawable.draw(canvas); canvas.restore(); } if (mExcludedRect.bottom < getHeight()) { canvas.save(); canvas.clipRect(0, mExcludedRect.bottom, getWidth(), getHeight()); mDrawable.draw(canvas); canvas.restore(); } // We also need to draw the rounded corners of the background canvas.save(); canvas.clipRect(mExcludedRect.left, mExcludedRect.top, mExcludedRect.left + mCornerRadius, mExcludedRect.top + mCornerRadius); mDrawable.draw(canvas); canvas.restore(); canvas.save(); canvas.clipRect(mExcludedRect.right - mCornerRadius, mExcludedRect.top, mExcludedRect.right, mExcludedRect.top + mCornerRadius); mDrawable.draw(canvas); canvas.restore(); canvas.save(); canvas.clipRect(mExcludedRect.left, mExcludedRect.bottom - mCornerRadius, mExcludedRect.left + mCornerRadius, mExcludedRect.bottom); mDrawable.draw(canvas); canvas.restore(); canvas.save(); canvas.clipRect(mExcludedRect.right - mCornerRadius, mExcludedRect.bottom - mCornerRadius, mExcludedRect.right, mExcludedRect.bottom); mDrawable.draw(canvas); canvas.restore(); } } } Loading @@ -198,7 +144,6 @@ public class ScrimView extends View implements ConfigurationController.Configura mDrawable.setCallback(this); mDrawable.setBounds(getLeft(), getTop(), getRight(), getBottom()); mDrawable.setAlpha((int) (255 * mViewAlpha)); setDrawAsSrc(mDrawAsSrc); updateScreenSize(); invalidate(); } Loading @@ -211,12 +156,6 @@ public class ScrimView extends View implements ConfigurationController.Configura } } public void setDrawAsSrc(boolean asSrc) { mDrawAsSrc = asSrc; PorterDuff.Mode mode = asSrc ? PorterDuff.Mode.SRC : PorterDuff.Mode.SRC_OVER; mDrawable.setXfermode(new PorterDuffXfermode(mode)); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); Loading Loading @@ -328,22 +267,6 @@ public class ScrimView extends View implements ConfigurationController.Configura return mViewAlpha; } public void setExcludedArea(Rect area) { if (area == null) { mHasExcludedArea = false; invalidate(); return; } int left = Math.max(area.left, 0); int top = Math.max(area.top, 0); int right = Math.min(area.right, getWidth()); int bottom = Math.min(area.bottom, getHeight()); mExcludedRect.set(left, top, right, bottom); mHasExcludedArea = left < right && top < bottom; invalidate(); } public void setChangeRunnable(Runnable changeRunnable) { mChangeRunnable = changeRunnable; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +2 −65 Original line number Diff line number Diff line Loading @@ -394,9 +394,6 @@ public class NotificationStackScrollLayout extends ViewGroup }; private PorterDuffXfermode mSrcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC); private boolean mPulsing; private boolean mDrawBackgroundAsSrc; private boolean mFadingOut; private boolean mParentNotFullyVisible; private boolean mGroupExpandedForMeasure; private boolean mScrollable; private View mForcedScroll; Loading Loading @@ -789,21 +786,6 @@ public class NotificationStackScrollLayout extends ViewGroup R.dimen.heads_up_status_bar_padding); } public void setDrawBackgroundAsSrc(boolean asSrc) { mDrawBackgroundAsSrc = asSrc; updateSrcDrawing(); } private void updateSrcDrawing() { if (!mShouldDrawNotificationBackground) { return; } mBackgroundPaint.setXfermode(mDrawBackgroundAsSrc && !mFadingOut && !mParentNotFullyVisible ? mSrcMode : null); invalidate(); } private void notifyHeightChangeListener(ExpandableView view) { notifyHeightChangeListener(view, false /* needsAnimation */); } Loading Loading @@ -1128,7 +1110,6 @@ public class NotificationStackScrollLayout extends ViewGroup && !mHeadsUpAnimatingAway; if (mIsClipped != clipped) { mIsClipped = clipped; updateFadingState(); } if (animatingClipping) { Loading Loading @@ -2447,7 +2428,7 @@ public class NotificationStackScrollLayout extends ViewGroup startBackgroundAnimation(); } else { mCurrentBounds.set(mBackgroundBounds); applyCurrentBackgroundBounds(); invalidate(); } } else { abortBackgroundAnimators(); Loading Loading @@ -2575,25 +2556,11 @@ public class NotificationStackScrollLayout extends ViewGroup private void setBackgroundTop(int top) { mCurrentBounds.top = top; applyCurrentBackgroundBounds(); invalidate(); } public void setBackgroundBottom(int bottom) { mCurrentBounds.bottom = bottom; applyCurrentBackgroundBounds(); } private void applyCurrentBackgroundBounds() { // If the background of the notification is not being drawn, then there is no need to // exclude an area in the scrim. Rather, the scrim's color should serve as the background. if (!mShouldDrawNotificationBackground) { return; } final boolean awake = mInterpolatedDarkAmount != 0 || mAmbientState.isDark(); mScrimController.setExcludedBackgroundArea( mFadingOut || mParentNotFullyVisible || awake || mIsClipped ? null : mCurrentBounds); invalidate(); } Loading Loading @@ -4176,7 +4143,6 @@ public class NotificationStackScrollLayout extends ViewGroup updateBackground(); } requestChildrenUpdate(); applyCurrentBackgroundBounds(); updateWillNotDraw(); notifyHeightChangeListener(mShelf); } Loading Loading @@ -4650,35 +4616,6 @@ public class NotificationStackScrollLayout extends ViewGroup } } public void setFadingOut(boolean fadingOut) { if (fadingOut != mFadingOut) { mFadingOut = fadingOut; updateFadingState(); } } public void setParentNotFullyVisible(boolean parentNotFullyVisible) { if (mScrimController == null) { // we're not set up yet. return; } if (parentNotFullyVisible != mParentNotFullyVisible) { mParentNotFullyVisible = parentNotFullyVisible; updateFadingState(); } } private void updateFadingState() { applyCurrentBackgroundBounds(); updateSrcDrawing(); } @Override public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) { super.setAlpha(alpha); setFadingOut(alpha != 1.0f); } public void setQsExpanded(boolean qsExpanded) { mQsExpanded = qsExpanded; updateAlgorithmLayoutMinHeight(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +0 −34 Original line number Diff line number Diff line Loading @@ -2668,32 +2668,6 @@ public class NotificationPanelView extends PanelView implements setLaunchingAffordance(false); } @Override public void setAlpha(float alpha) { super.setAlpha(alpha); updateFullyVisibleState(false /* forceNotFullyVisible */); } /** * Must be called before starting a ViewPropertyAnimator alpha animation because those * do NOT call setAlpha and therefore don't properly update the fullyVisibleState. */ public void notifyStartFading() { updateFullyVisibleState(true /* forceNotFullyVisible */); } @Override public void setVisibility(int visibility) { super.setVisibility(visibility); updateFullyVisibleState(false /* forceNotFullyVisible */); } private void updateFullyVisibleState(boolean forceNotFullyVisible) { mNotificationStackScroller.setParentNotFullyVisible(forceNotFullyVisible || getAlpha() != 1.0f || getVisibility() != VISIBLE); } /** * Set whether we are currently launching an affordance. This is currently only set when * launched via a camera gesture. Loading Loading @@ -2992,10 +2966,6 @@ public class NotificationPanelView extends PanelView implements mNotificationStackScroller.setActivatedChild(o); } public void setParentNotFullyVisible(boolean parent) { mNotificationStackScroller.setParentNotFullyVisible(parent); } public void runAfterAnimationFinished(Runnable r) { mNotificationStackScroller.runAfterAnimationFinished(r); } Loading @@ -3020,8 +2990,4 @@ public class NotificationPanelView extends PanelView implements mNotificationStackScroller.setScrimController(scrimController); updateShowEmptyShadeView(); } public void setDrawBackgroundAsSrc(boolean asSrc) { mNotificationStackScroller.setDrawBackgroundAsSrc(asSrc); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +0 −8 Original line number Diff line number Diff line Loading @@ -685,10 +685,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo return scrim.getTag(TAG_KEY_ANIM) != null; } public void setDrawBehindAsSrc(boolean asSrc) { mScrimBehind.setDrawAsSrc(asSrc); } @VisibleForTesting void setOnAnimationFinished(Runnable onAnimationFinished) { mOnAnimationFinished = onAnimationFinished; Loading Loading @@ -800,10 +796,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo return Handler.getMain(); } public void setExcludedBackgroundArea(Rect area) { mScrimBehind.setExcludedArea(area); } public int getBackgroundColor() { int color = mLockColors.getMainColor(); return Color.argb((int) (mScrimBehind.getViewAlpha() * Color.alpha(color)), Loading