Loading res/values/config.xml +0 −3 Original line number Diff line number Diff line Loading @@ -235,9 +235,6 @@ Can be overridden for specific product builds if the target device does not support it --> <bool name="config_media_vibration_supported">true</bool> <!-- Whether to show Keyboard vibration settings in the vibration and haptics screen. --> <bool name="config_keyboard_vibration_supported">false</bool> <!-- Whether or not the homepage should be powered by legacy suggestion (versus contextual cards) Default to true as not all devices support contextual cards. Loading src/com/android/settings/accessibility/KeyboardVibrationTogglePreferenceController.java +2 −3 Original line number Diff line number Diff line Loading @@ -111,9 +111,8 @@ public class KeyboardVibrationTogglePreferenceController extends TogglePreferenc @Override public int getAvailabilityStatus() { if (Flags.keyboardCategoryEnabled() && mContext.getResources().getBoolean(R.bool.config_keyboard_vibration_supported) && mContext.getResources().getFloat( com.android.internal.R.dimen.config_keyboardHapticFeedbackFixedAmplitude) > 0) { && mContext.getResources().getBoolean( com.android.internal.R.bool.config_keyboardVibrationSettingsSupported)) { return AVAILABLE; } return UNSUPPORTED_ON_DEVICE; Loading tests/robotests/src/com/android/settings/accessibility/KeyboardVibrationTogglePreferenceControllerTest.java +9 −6 Original line number Diff line number Diff line Loading @@ -88,10 +88,9 @@ public class KeyboardVibrationTogglePreferenceControllerTest { @Test 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); when(mResources.getBoolean( com.android.internal.R.bool.config_keyboardVibrationSettingsSupported)) .thenReturn(true); assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE); } Loading @@ -99,7 +98,9 @@ public class KeyboardVibrationTogglePreferenceControllerTest { @Test public void getAvailabilityStatus_featureNotSupported_unavailable() { mSetFlagsRule.enableFlags(Flags.FLAG_KEYBOARD_CATEGORY_ENABLED); when(mResources.getBoolean(R.bool.config_keyboard_vibration_supported)).thenReturn(false); when(mResources.getBoolean( com.android.internal.R.bool.config_keyboardVibrationSettingsSupported)) .thenReturn(false); assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); } Loading @@ -107,7 +108,9 @@ public class KeyboardVibrationTogglePreferenceControllerTest { @Test public void getAvailabilityStatus_keyboardCategoryDisabled_unavailable() { mSetFlagsRule.disableFlags(Flags.FLAG_KEYBOARD_CATEGORY_ENABLED); when(mResources.getBoolean(R.bool.config_keyboard_vibration_supported)).thenReturn(true); when(mResources.getBoolean( com.android.internal.R.bool.config_keyboardVibrationSettingsSupported)) .thenReturn(true); assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); } Loading Loading
res/values/config.xml +0 −3 Original line number Diff line number Diff line Loading @@ -235,9 +235,6 @@ Can be overridden for specific product builds if the target device does not support it --> <bool name="config_media_vibration_supported">true</bool> <!-- Whether to show Keyboard vibration settings in the vibration and haptics screen. --> <bool name="config_keyboard_vibration_supported">false</bool> <!-- Whether or not the homepage should be powered by legacy suggestion (versus contextual cards) Default to true as not all devices support contextual cards. Loading
src/com/android/settings/accessibility/KeyboardVibrationTogglePreferenceController.java +2 −3 Original line number Diff line number Diff line Loading @@ -111,9 +111,8 @@ public class KeyboardVibrationTogglePreferenceController extends TogglePreferenc @Override public int getAvailabilityStatus() { if (Flags.keyboardCategoryEnabled() && mContext.getResources().getBoolean(R.bool.config_keyboard_vibration_supported) && mContext.getResources().getFloat( com.android.internal.R.dimen.config_keyboardHapticFeedbackFixedAmplitude) > 0) { && mContext.getResources().getBoolean( com.android.internal.R.bool.config_keyboardVibrationSettingsSupported)) { return AVAILABLE; } return UNSUPPORTED_ON_DEVICE; Loading
tests/robotests/src/com/android/settings/accessibility/KeyboardVibrationTogglePreferenceControllerTest.java +9 −6 Original line number Diff line number Diff line Loading @@ -88,10 +88,9 @@ public class KeyboardVibrationTogglePreferenceControllerTest { @Test 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); when(mResources.getBoolean( com.android.internal.R.bool.config_keyboardVibrationSettingsSupported)) .thenReturn(true); assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE); } Loading @@ -99,7 +98,9 @@ public class KeyboardVibrationTogglePreferenceControllerTest { @Test public void getAvailabilityStatus_featureNotSupported_unavailable() { mSetFlagsRule.enableFlags(Flags.FLAG_KEYBOARD_CATEGORY_ENABLED); when(mResources.getBoolean(R.bool.config_keyboard_vibration_supported)).thenReturn(false); when(mResources.getBoolean( com.android.internal.R.bool.config_keyboardVibrationSettingsSupported)) .thenReturn(false); assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); } Loading @@ -107,7 +108,9 @@ public class KeyboardVibrationTogglePreferenceControllerTest { @Test public void getAvailabilityStatus_keyboardCategoryDisabled_unavailable() { mSetFlagsRule.disableFlags(Flags.FLAG_KEYBOARD_CATEGORY_ENABLED); when(mResources.getBoolean(R.bool.config_keyboard_vibration_supported)).thenReturn(true); when(mResources.getBoolean( com.android.internal.R.bool.config_keyboardVibrationSettingsSupported)) .thenReturn(true); assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); } Loading