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:
Mehdi Alizadeh
2018-05-04 11:42:46 -07:00
parent cda8a44cee
commit c93a97d9d5
3 changed files with 52 additions and 10 deletions

View File

@@ -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;
}
}