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

Commit 889d33f3 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/26459632'] into 24Q2-release.

Change-Id: I439d6888ed42174a6dfdf69a9f6d4f6ca8542fe3
parents 7147196c 08308b2e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -110,7 +110,9 @@ public class KeyboardVibrationTogglePreferenceController extends TogglePreferenc
    @Override
    public int getAvailabilityStatus() {
        if (Flags.keyboardCategoryEnabled()
                && mContext.getResources().getBoolean(R.bool.config_keyboard_vibration_supported)) {
                && mContext.getResources().getBoolean(R.bool.config_keyboard_vibration_supported)
                && mContext.getResources().getFloat(
                com.android.internal.R.dimen.config_keyboardHapticFeedbackFixedAmplitude) > 0) {
            return AVAILABLE;
        }
        return UNSUPPORTED_ON_DEVICE;
+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ public class KeyboardVibrationTogglePreferenceControllerTest {
    public void getAvailabilityStatus_featureSupported_available() {
        mSetFlagsRule.enableFlags(Flags.FLAG_KEYBOARD_CATEGORY_ENABLED);
        when(mResources.getBoolean(R.bool.config_keyboard_vibration_supported)).thenReturn(true);
        when(mResources.getFloat(
                com.android.internal.R.dimen.config_keyboardHapticFeedbackFixedAmplitude))
                .thenReturn(0.8f);

        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
    }