Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa5134e9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove haptics on navbar and only have button haptics on touch up" into pi-dev

parents fe85e458 0e1e0f61
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Message;
import android.os.SystemProperties;
import android.os.VibrationEffect;
import android.support.annotation.ColorInt;
import android.util.AttributeSet;
import android.util.Log;
@@ -69,7 +68,6 @@ import com.android.systemui.recents.RecentsOnboarding;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.NavigationBarCompat;
import com.android.systemui.stackdivider.Divider;
import com.android.systemui.statusbar.VibratorHelper;
import com.android.systemui.statusbar.policy.DeadZone;
import com.android.systemui.statusbar.policy.KeyButtonDrawable;
import com.android.systemui.statusbar.policy.TintedKeyButtonDrawable;
@@ -150,7 +148,6 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
    private Divider mDivider;
    private RecentsOnboarding mRecentsOnboarding;
    private NotificationPanelView mPanelView;
    private final VibratorHelper mVibratorHelper;

    private int mRotateBtnStyle = R.style.RotateButtonCCWStart90;

@@ -246,7 +243,6 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav

        mOverviewProxyService = Dependency.get(OverviewProxyService.class);
        mRecentsOnboarding = new RecentsOnboarding(context, mOverviewProxyService);
        mVibratorHelper = Dependency.get(VibratorHelper.class);

        mConfiguration = new Configuration();
        mConfiguration.updateFrom(context.getResources().getConfiguration());
@@ -314,9 +310,6 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
                } else if (mRecentsButtonBounds.contains(x, y)) {
                    mDownHitTarget = HIT_TARGET_OVERVIEW;
                }

                // Vibrate tick whenever down occurs on navigation bar
                mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK);
                break;
        }
        return mGestureHelper.onInterceptTouchEvent(event);
+2 −7
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.metrics.LogMaker;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.SystemClock;
import android.os.VibrationEffect;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.HapticFeedbackConstants;
@@ -50,7 +49,6 @@ import com.android.systemui.OverviewProxyService;
import com.android.systemui.R;
import com.android.systemui.plugins.statusbar.phone.NavBarButtonProvider.ButtonInterface;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.statusbar.VibratorHelper;

import static android.view.KeyEvent.KEYCODE_HOME;
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK;
@@ -75,7 +73,6 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
    private OnClickListener mOnClickListener;
    private final KeyButtonRipple mRipple;
    private final OverviewProxyService mOverviewProxyService;
    private final VibratorHelper mVibratorHelper;
    private final MetricsLogger mMetricsLogger = Dependency.get(MetricsLogger.class);

    private final Runnable mCheckLongPress = new Runnable() {
@@ -121,7 +118,6 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
        mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);

        mRipple = new KeyButtonRipple(context, this);
        mVibratorHelper = Dependency.get(VibratorHelper.class);
        mOverviewProxyService = Dependency.get(OverviewProxyService.class);
        setBackground(mRipple);
    }
@@ -262,9 +258,8 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
                final boolean doHapticFeedback = (SystemClock.uptimeMillis() - mDownTime) > 150;
                if (showSwipeUI) {
                    if (doIt) {
                        if (doHapticFeedback) {
                            mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK);
                        }
                        // Apply haptic feedback on touch up since there is none on touch down
                        performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
                        playSoundEffect(SoundEffectConstants.CLICK);
                    }
                } else if (doHapticFeedback && !mLongClicked) {