Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +0 −15 Original line number Diff line number Diff line Loading @@ -82,9 +82,6 @@ public class NotificationShelf extends ActivatableNotificationView implements private boolean mNoAnimationsInThisFrame; private boolean mAnimationsEnabled = true; private boolean mShowNotificationShelf; private boolean mVibrationOnAnimation; private boolean mUserTouchingScreen; private boolean mTouchActive; private float mFirstElementRoundness; public NotificationShelf(Context context, AttributeSet attrs) { Loading @@ -102,9 +99,6 @@ public class NotificationShelf extends ActivatableNotificationView implements setClipChildren(false); setClipToPadding(false); mShelfIcons.setShowAllIcons(false); mVibrationOnAnimation = mContext.getResources().getBoolean( R.bool.config_vibrateOnIconAnimation); updateVibrationOnAnimation(); mViewInvertHelper = new ViewInvertHelper(mShelfIcons, NotificationPanelView.DOZE_ANIMATION_DURATION); mShelfState = new ShelfState(); Loading @@ -112,15 +106,6 @@ public class NotificationShelf extends ActivatableNotificationView implements initDimens(); } private void updateVibrationOnAnimation() { mShelfIcons.setVibrateOnAnimation(mVibrationOnAnimation && mTouchActive); } public void setTouchActive(boolean touchActive) { mTouchActive = touchActive; updateVibrationOnAnimation(); } public void bind(AmbientState ambientState, NotificationStackScrollLayout hostLayout) { mAmbientState = ambientState; mHostLayout = hostLayout; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java +0 −5 Original line number Diff line number Diff line Loading @@ -61,11 +61,6 @@ public class NotificationUtils { return sLocationOffset[1] - sLocationBase[1]; } public static boolean isHapticFeedbackDisabled(Context context) { return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) == 0; } /** * @param dimenId the dimen to look up * @return the font scaled dimen as if it were in sp but doesn't shrink sizes below dp Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +0 −34 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.phone; import static com.android.systemui.statusbar.notification.NotificationUtils.isHapticFeedbackDisabled; import android.content.Context; import android.content.res.Configuration; import android.graphics.Canvas; Loading Loading @@ -120,8 +118,6 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { private float mVisualOverflowAdaption; private boolean mDisallowNextAnimation; private boolean mAnimationsEnabled = true; private boolean mVibrateOnAnimation; private Vibrator mVibrator; private ArrayMap<String, ArrayList<StatusBarIcon>> mReplacingIcons; private int mDarkOffsetX; Loading @@ -129,7 +125,6 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { super(context, attrs); initDimens(); setWillNotDraw(!DEBUG); mVibrator = mContext.getSystemService(Vibrator.class); } private void initDimens() { Loading Loading @@ -497,10 +492,6 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { return width - (getWidth() - getActualPaddingStart() - getActualPaddingEnd()) > 0; } public void setVibrateOnAnimation(boolean vibrateOnAnimation) { mVibrateOnAnimation = vibrateOnAnimation; } public int getIconSize() { return mIconSize; } Loading Loading @@ -608,39 +599,14 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { } else { super.applyToView(view); } boolean wasInShelf = icon.isInShelf(); boolean inShelf = iconAppearAmount == 1.0f; icon.setIsInShelf(inShelf); if (shouldVibrateChange(wasInShelf != inShelf)) { AsyncTask.execute( () -> mVibrator.vibrate(VibrationEffect.get( VibrationEffect.EFFECT_TICK))); } } justAdded = false; justReplaced = false; needsCannedAnimation = false; } private boolean shouldVibrateChange(boolean inShelfChanged) { if (!mVibrateOnAnimation) { return false; } if (justAdded) { return false; } if (!mAnimationsEnabled) { return false; } if (!inShelfChanged) { return false; } if (isHapticFeedbackDisabled(mContext)) { return false; } return true; } public boolean hasCustomTransformHeight() { return isLastExpandIcon && customTransformHeight != NO_VALUE; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +21 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.phone; import static com.android.systemui.statusbar.notification.NotificationUtils.isHapticFeedbackDisabled; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; Loading @@ -25,10 +23,14 @@ import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; import android.os.AsyncTask; import android.os.Handler; import android.os.SystemClock; import android.os.UserHandle; import android.os.VibrationEffect; import android.os.Vibrator; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; import android.view.InputDevice; Loading Loading @@ -63,6 +65,7 @@ public abstract class PanelView extends FrameLayout { private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private boolean mPanelUpdateWhenAnimatorEnds; private boolean mVibrateOnOpening; private boolean mVibrationEnabled; private final void logf(String fmt, Object... args) { Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args)); Loading Loading @@ -105,6 +108,12 @@ public abstract class PanelView extends FrameLayout { private FlingAnimationUtils mFlingAnimationUtilsDismissing; private FalsingManager mFalsingManager; private final Vibrator mVibrator; final private ContentObserver mVibrationObserver = new ContentObserver(Handler.getMain()) { @Override public void onChange(boolean selfChange) { updateHapticFeedBackEnabled(); } }; /** * Whether an instant expand request is currently pending and we are just waiting for layout. Loading Loading @@ -209,6 +218,15 @@ public abstract class PanelView extends FrameLayout { mVibrator = mContext.getSystemService(Vibrator.class); mVibrateOnOpening = mContext.getResources().getBoolean( R.bool.config_vibrateOnIconAnimation); mContext.getContentResolver().registerContentObserver( Settings.System.getUriFor(Settings.System.HAPTIC_FEEDBACK_ENABLED), true, mVibrationObserver); mVibrationObserver.onChange(false /* selfChange */); } public void updateHapticFeedBackEnabled() { mVibrationEnabled = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) != 0; } protected void loadDimens() { Loading Loading @@ -400,7 +418,7 @@ public abstract class PanelView extends FrameLayout { runPeekAnimation(INITIAL_OPENING_PEEK_DURATION, getOpeningHeight(), false /* collapseWhenFinished */); notifyBarPanelExpansionChanged(); if (mVibrateOnOpening && !isHapticFeedbackDisabled(mContext)) { if (mVibrateOnOpening && mVibrationEnabled) { AsyncTask.execute(() -> mVibrator.vibrate(VibrationEffect.get(VibrationEffect.EFFECT_TICK, false))); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +0 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,6 @@ public class StatusBarWindowView extends FrameLayout { public void setTouchActive(boolean touchActive) { mTouchActive = touchActive; mStackScrollLayout.setTouchActive(touchActive); } @Override Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +0 −15 Original line number Diff line number Diff line Loading @@ -82,9 +82,6 @@ public class NotificationShelf extends ActivatableNotificationView implements private boolean mNoAnimationsInThisFrame; private boolean mAnimationsEnabled = true; private boolean mShowNotificationShelf; private boolean mVibrationOnAnimation; private boolean mUserTouchingScreen; private boolean mTouchActive; private float mFirstElementRoundness; public NotificationShelf(Context context, AttributeSet attrs) { Loading @@ -102,9 +99,6 @@ public class NotificationShelf extends ActivatableNotificationView implements setClipChildren(false); setClipToPadding(false); mShelfIcons.setShowAllIcons(false); mVibrationOnAnimation = mContext.getResources().getBoolean( R.bool.config_vibrateOnIconAnimation); updateVibrationOnAnimation(); mViewInvertHelper = new ViewInvertHelper(mShelfIcons, NotificationPanelView.DOZE_ANIMATION_DURATION); mShelfState = new ShelfState(); Loading @@ -112,15 +106,6 @@ public class NotificationShelf extends ActivatableNotificationView implements initDimens(); } private void updateVibrationOnAnimation() { mShelfIcons.setVibrateOnAnimation(mVibrationOnAnimation && mTouchActive); } public void setTouchActive(boolean touchActive) { mTouchActive = touchActive; updateVibrationOnAnimation(); } public void bind(AmbientState ambientState, NotificationStackScrollLayout hostLayout) { mAmbientState = ambientState; mHostLayout = hostLayout; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java +0 −5 Original line number Diff line number Diff line Loading @@ -61,11 +61,6 @@ public class NotificationUtils { return sLocationOffset[1] - sLocationBase[1]; } public static boolean isHapticFeedbackDisabled(Context context) { return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) == 0; } /** * @param dimenId the dimen to look up * @return the font scaled dimen as if it were in sp but doesn't shrink sizes below dp Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +0 −34 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.phone; import static com.android.systemui.statusbar.notification.NotificationUtils.isHapticFeedbackDisabled; import android.content.Context; import android.content.res.Configuration; import android.graphics.Canvas; Loading Loading @@ -120,8 +118,6 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { private float mVisualOverflowAdaption; private boolean mDisallowNextAnimation; private boolean mAnimationsEnabled = true; private boolean mVibrateOnAnimation; private Vibrator mVibrator; private ArrayMap<String, ArrayList<StatusBarIcon>> mReplacingIcons; private int mDarkOffsetX; Loading @@ -129,7 +125,6 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { super(context, attrs); initDimens(); setWillNotDraw(!DEBUG); mVibrator = mContext.getSystemService(Vibrator.class); } private void initDimens() { Loading Loading @@ -497,10 +492,6 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { return width - (getWidth() - getActualPaddingStart() - getActualPaddingEnd()) > 0; } public void setVibrateOnAnimation(boolean vibrateOnAnimation) { mVibrateOnAnimation = vibrateOnAnimation; } public int getIconSize() { return mIconSize; } Loading Loading @@ -608,39 +599,14 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { } else { super.applyToView(view); } boolean wasInShelf = icon.isInShelf(); boolean inShelf = iconAppearAmount == 1.0f; icon.setIsInShelf(inShelf); if (shouldVibrateChange(wasInShelf != inShelf)) { AsyncTask.execute( () -> mVibrator.vibrate(VibrationEffect.get( VibrationEffect.EFFECT_TICK))); } } justAdded = false; justReplaced = false; needsCannedAnimation = false; } private boolean shouldVibrateChange(boolean inShelfChanged) { if (!mVibrateOnAnimation) { return false; } if (justAdded) { return false; } if (!mAnimationsEnabled) { return false; } if (!inShelfChanged) { return false; } if (isHapticFeedbackDisabled(mContext)) { return false; } return true; } public boolean hasCustomTransformHeight() { return isLastExpandIcon && customTransformHeight != NO_VALUE; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +21 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.phone; import static com.android.systemui.statusbar.notification.NotificationUtils.isHapticFeedbackDisabled; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; Loading @@ -25,10 +23,14 @@ import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; import android.os.AsyncTask; import android.os.Handler; import android.os.SystemClock; import android.os.UserHandle; import android.os.VibrationEffect; import android.os.Vibrator; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; import android.view.InputDevice; Loading Loading @@ -63,6 +65,7 @@ public abstract class PanelView extends FrameLayout { private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private boolean mPanelUpdateWhenAnimatorEnds; private boolean mVibrateOnOpening; private boolean mVibrationEnabled; private final void logf(String fmt, Object... args) { Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args)); Loading Loading @@ -105,6 +108,12 @@ public abstract class PanelView extends FrameLayout { private FlingAnimationUtils mFlingAnimationUtilsDismissing; private FalsingManager mFalsingManager; private final Vibrator mVibrator; final private ContentObserver mVibrationObserver = new ContentObserver(Handler.getMain()) { @Override public void onChange(boolean selfChange) { updateHapticFeedBackEnabled(); } }; /** * Whether an instant expand request is currently pending and we are just waiting for layout. Loading Loading @@ -209,6 +218,15 @@ public abstract class PanelView extends FrameLayout { mVibrator = mContext.getSystemService(Vibrator.class); mVibrateOnOpening = mContext.getResources().getBoolean( R.bool.config_vibrateOnIconAnimation); mContext.getContentResolver().registerContentObserver( Settings.System.getUriFor(Settings.System.HAPTIC_FEEDBACK_ENABLED), true, mVibrationObserver); mVibrationObserver.onChange(false /* selfChange */); } public void updateHapticFeedBackEnabled() { mVibrationEnabled = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) != 0; } protected void loadDimens() { Loading Loading @@ -400,7 +418,7 @@ public abstract class PanelView extends FrameLayout { runPeekAnimation(INITIAL_OPENING_PEEK_DURATION, getOpeningHeight(), false /* collapseWhenFinished */); notifyBarPanelExpansionChanged(); if (mVibrateOnOpening && !isHapticFeedbackDisabled(mContext)) { if (mVibrateOnOpening && mVibrationEnabled) { AsyncTask.execute(() -> mVibrator.vibrate(VibrationEffect.get(VibrationEffect.EFFECT_TICK, false))); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +0 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,6 @@ public class StatusBarWindowView extends FrameLayout { public void setTouchActive(boolean touchActive) { mTouchActive = touchActive; mStackScrollLayout.setTouchActive(touchActive); } @Override Loading