Adds two overlay settings fields for Swipe Up gesture
Adds two overlay settings for Swipe Up gesture, one for the default value (enabled/disabled), and another one to show/hide the Swipe Up settings page in Settings app. Bug: 78908915 Bug: 78641268 Test: Robotests and Manual test Change-Id: If7bea967f3af9ebe96ab87e8a4d6d05c5daa4ed5
This commit is contained in:
@@ -39,6 +39,10 @@ public class SwipeUpPreferenceController extends GesturePreferenceController {
|
||||
}
|
||||
|
||||
static boolean isGestureAvailable(Context context) {
|
||||
if (!context.getResources().getBoolean(R.bool.config_swipe_up_gesture_setting_available)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final ComponentName recentsComponentName = ComponentName.unflattenFromString(
|
||||
context.getString(com.android.internal.R.string.config_recentsComponentName));
|
||||
final Intent quickStepIntent = new Intent(ACTION_QUICKSTEP)
|
||||
@@ -74,8 +78,10 @@ public class SwipeUpPreferenceController extends GesturePreferenceController {
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
final int defaultValue = mContext.getResources()
|
||||
.getBoolean(com.android.internal.R.bool.config_swipe_up_gesture_default) ? ON : OFF;
|
||||
final int swipeUpEnabled = Settings.Secure.getInt(mContext.getContentResolver(),
|
||||
Settings.Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED, OFF);
|
||||
Settings.Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED, defaultValue);
|
||||
return swipeUpEnabled != OFF;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user