[Touchpad Setting] Hide Touchpad page when there's no connected one

The option for entering page already has complete check condition.
Update the same check logic to isSeachable in setting page to hide
page when there's no touchpad connected.
Also apply check on trackpadTouchGesture.

Test: verify on device
Bug: 346497646
Flag: EXEMPT bugfix
Change-Id: I1730c7bd1fd2615dc1725ec0cc32293254e5b54a
This commit is contained in:
shaoweishen
2024-07-04 07:01:42 +00:00
committed by Shaowei Shen
parent 8d5d69d62f
commit 60eae5e01c
3 changed files with 6 additions and 3 deletions

View File

@@ -56,7 +56,8 @@ public class TrackpadSettings extends DashboardFragment {
@Override
protected boolean isPageSearchEnabled(Context context) {
return FeatureFlagUtils
.isEnabled(context, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD);
.isEnabled(context, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD)
&& NewKeyboardSettingsUtils.isTouchpad();
}
};
}

View File

@@ -58,7 +58,8 @@ public class TrackpadTouchGestureSettings extends DashboardFragment {
return FeatureFlagUtils
.isEnabled(
context,
FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE);
FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE)
&& NewKeyboardSettingsUtils.isTouchpad();
}
};
}

View File

@@ -31,6 +31,7 @@ public class TrackpadTouchGestureSettingsController extends BasePreferenceContro
public int getAvailabilityStatus() {
boolean isFeatureOn = FeatureFlagUtils
.isEnabled(mContext, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD_GESTURE);
return isFeatureOn ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
boolean isTouchpad = NewKeyboardSettingsUtils.isTouchpad();
return (isFeatureOn && isTouchpad) ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
}
}