[Physical Keybaord] Add keyboard touchpad/Mouse page - part2
screenshot: https://screenshot.googleplex.com/A4yihXmkTTo2nM3.png Add seperate controllers in page and guard with flag. Original controller will be disabled if flag is off. This is part of feature for keyboard setting update. document: go/new-a11y-touchpad-mouse-page Bug: 377602364 Test: atest SettingsRoboTests Flag: com.android.settings.keyboard.keyboard_and_touchpad_a11y_new_page_enabled Change-Id: I20bf7c65a7f9adc734c7382f23a92d1eb41822f1
This commit is contained in:
committed by
Shaowei Shen
parent
929b8eb51d
commit
06fe204a69
@@ -26,6 +26,7 @@ import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.keyboard.Flags;
|
||||
import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStart;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStop;
|
||||
@@ -85,13 +86,15 @@ public class TouchpadAndMouseSettingsController extends BasePreferenceController
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
boolean isNewPageFlagDisabled = !Flags.keyboardAndTouchpadA11yNewPageEnabled();
|
||||
boolean isFeatureOn = FeatureFlagUtils
|
||||
.isEnabled(mContext, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_TRACKPAD);
|
||||
boolean isTouchpad = InputPeripheralsSettingsUtils.isTouchpad();
|
||||
boolean isPointerCustomizationEnabled =
|
||||
android.view.flags.Flags.enableVectorCursorA11ySettings();
|
||||
boolean isMouse = InputPeripheralsSettingsUtils.isMouse();
|
||||
return (isFeatureOn && isTouchpad) || (isPointerCustomizationEnabled && isMouse) ? AVAILABLE
|
||||
return ((isFeatureOn && isTouchpad) || (isPointerCustomizationEnabled && isMouse))
|
||||
&& isNewPageFlagDisabled ? AVAILABLE
|
||||
: CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user