Merge "Adds two overlay settings fields for Swipe Up gesture"

This commit is contained in:
Mehdi Alizadeh
2018-05-16 19:52:02 +00:00
committed by Android (Google) Code Review
3 changed files with 52 additions and 10 deletions

View File

@@ -40,6 +40,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)
@@ -75,8 +79,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;
}
}