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

Commit 4299a537 authored by Justin Weir's avatar Justin Weir
Browse files

Move performHapticFeedback to ShadeController

Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Test: Updated and ran affected test
Bug: 303267342
Change-Id: I170ae0e2a85fd6d0df8b7d58bd6ac934af10fc4c
parent d46e60e7
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3257,7 +3257,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mKeyguardStatusViewController.setStatusAccessibilityImportance(mode);
    }

    @Override
    public void performHapticFeedback(int constant) {
        mVibratorHelper.performHapticFeedback(mView, constant);
    }
+7 −0
Original line number Diff line number Diff line
@@ -232,6 +232,13 @@ public interface ShadeController extends CoreStartable {
    /** Called when a launch animation ends. */
    void onLaunchAnimationEnd(boolean launchIsFullScreen);

    /**
     * Performs haptic feedback from a view with a haptic feedback constant.
     *
     * @param constant One of android.view.HapticFeedbackConstants
     */
    void performHapticFeedback(int constant);

    /** Sets the listener for when the visibility of the shade changes. */
    default void setVisibilityListener(ShadeVisibilityListener listener) {}

+1 −0
Original line number Diff line number Diff line
@@ -63,4 +63,5 @@ open class ShadeControllerEmptyImpl @Inject constructor() : ShadeController {
    override fun onStatusBarTouch(event: MotionEvent?) {}
    override fun onLaunchAnimationCancelled(isLaunchForActivity: Boolean) {}
    override fun onLaunchAnimationEnd(launchIsFullScreen: Boolean) {}
    override fun performHapticFeedback(constant: Int) {}
}
+5 −0
Original line number Diff line number Diff line
@@ -270,6 +270,11 @@ public final class ShadeControllerImpl extends BaseShadeControllerImpl {
        }
    }

    @Override
    public void performHapticFeedback(int constant) {
        getNpvc().performHapticFeedback(constant);
    }

    @Override
    public void instantCollapseShade() {
        getNpvc().instantCollapse();
+6 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.systemui.shade.ShadeController.ShadeVisibilityListener
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.NotificationShadeWindowController
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
import dagger.Lazy
@@ -62,6 +63,7 @@ constructor(
    private val deviceEntryInteractor: DeviceEntryInteractor,
    private val notificationStackScrollLayout: NotificationStackScrollLayout,
    @ShadeTouchLog private val touchLog: LogBuffer,
    private val vibratorHelper: VibratorHelper,
    commandQueue: CommandQueue,
    statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
    notificationShadeWindowController: NotificationShadeWindowController,
@@ -249,4 +251,8 @@ constructor(
        // The only call to this doesn't happen with migrateClocksToBlueprint() enabled
        throw UnsupportedOperationException()
    }

    override fun performHapticFeedback(constant: Int) {
        vibratorHelper.performHapticFeedback(notificationStackScrollLayout, constant)
    }
}
Loading