Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85e74592 authored by Winson Chung's avatar Winson Chung
Browse files

Remove the swipe up setting from system

Bug: 127366543
Test: adb shell dumpsys setting

Change-Id: I3a1a716a73d91048886b67444b574abdfc61323e
parent 1f9256fa
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -8044,17 +8044,6 @@ public final class Settings {
        private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR =
                BOOLEAN_VALIDATOR;
        /**
         * Whether the swipe up gesture to switch apps should be enabled.
         *
         * @hide
         */
        public static final String SWIPE_UP_TO_SWITCH_APPS_ENABLED =
                "swipe_up_to_switch_apps_enabled";
        private static final Validator SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR =
                BOOLEAN_VALIDATOR;
        /**
         * Whether or not the smart camera lift trigger that launches the camera when the user moves
         * the phone into a position for taking photos should be enabled.
@@ -8739,7 +8728,6 @@ public final class Settings {
            DISPLAY_WHITE_BALANCE_ENABLED,
            SYNC_PARENT_SOUNDS,
            CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
            SWIPE_UP_TO_SWITCH_APPS_ENABLED,
            CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
            SYSTEM_NAVIGATION_KEYS_ENABLED,
            QS_TILES,
@@ -8902,8 +8890,6 @@ public final class Settings {
            VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR);
            VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
                    CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR);
            VALIDATORS.put(SWIPE_UP_TO_SWITCH_APPS_ENABLED,
                    SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR);
            VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
                    CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR);
            VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED,
+0 −6
Original line number Diff line number Diff line
@@ -2410,12 +2410,6 @@ class SettingsProtoDumpUtil {
                Settings.Secure.WAKE_GESTURE_ENABLED,
                SecureSettingsProto.WAKE_GESTURE_ENABLED);

        final long launcherToken = p.start(SecureSettingsProto.LAUNCHER);
        dumpSetting(s, p,
                Settings.Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED,
                SecureSettingsProto.Launcher.SWIPE_UP_TO_SWITCH_APPS_ENABLED);
        p.end(launcherToken);

        final long zenToken = p.start(SecureSettingsProto.ZEN);
        dumpSetting(s, p,
                Settings.Secure.ZEN_DURATION,
+1 −1
Original line number Diff line number Diff line
@@ -4330,7 +4330,7 @@ public class SettingsProvider extends ContentProvider {
                    // Migrate the swipe up setting only if it is set
                    final SettingsState secureSettings = getSecureSettingsLocked(userId);
                    final Setting swipeUpSetting = secureSettings.getSettingLocked(
                            Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED);
                            "swipe_up_to_switch_apps_enabled");
                    if (swipeUpSetting != null && !swipeUpSetting.isNull()) {
                        navBarMode = swipeUpSetting.getValue().equals("1")
                                ? NAV_BAR_MODE_2BUTTON
+0 −25
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package com.android.systemui.shared.system;

import android.provider.Settings;

public class SettingsCompat {

    public static final String SWIPE_UP_SETTING_NAME
            = Settings.Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED;
}
+10 −25
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.content.pm.PackageManager.MATCH_SYSTEM_ONLY;
import static android.view.MotionEvent.ACTION_CANCEL;
import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_UP;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON;

import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP;
import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON;
@@ -36,6 +37,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.Region;
import android.os.Binder;
@@ -46,7 +48,6 @@ import android.os.Looper;
import android.os.PatternMatcher;
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import android.view.InputChannel;
import android.view.MotionEvent;
@@ -589,11 +590,11 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis

    private int getDefaultInteractionFlags() {
        // If there is no settings available use device default or get it from settings
        final boolean defaultState = getSwipeUpDefaultValue();
        final boolean swipeUpEnabled = getSwipeUpSettingAvailable()
                ? getSwipeUpEnabledFromSettings(defaultState)
                : defaultState;
        return swipeUpEnabled ? 0 : DEFAULT_DISABLE_SWIPE_UP_STATE;
        int navBarMode = Resources.getSystem().getInteger(
                com.android.internal.R.integer.config_navBarInteractionMode);
        return navBarMode == NAV_BAR_MODE_3BUTTON
                ? DEFAULT_DISABLE_SWIPE_UP_STATE
                : 0;
    }

    private void notifyBackButtonAlphaChanged(float alpha, boolean animate) {
@@ -638,21 +639,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                ActivityManagerWrapper.getInstance().getCurrentUserId()) != null;
    }

    private boolean getSwipeUpDefaultValue() {
        return mContext.getResources()
                .getBoolean(com.android.internal.R.bool.config_swipe_up_gesture_default);
    }

    private boolean getSwipeUpSettingAvailable() {
        return mContext.getResources()
                .getBoolean(com.android.internal.R.bool.config_swipe_up_gesture_setting_available);
    }

    private boolean getSwipeUpEnabledFromSettings(boolean defaultValue) {
        return Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED, defaultValue ? 1 : 0) == 1;
    }

    @Override
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println(TAG_OPS + " state:");
@@ -666,10 +652,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        pw.print("  quickStepIntent="); pw.println(mQuickStepIntent);
        pw.print("  quickStepIntentResolved="); pw.println(isEnabled());

        final boolean swipeUpDefaultValue = getSwipeUpDefaultValue();
        final boolean swipeUpEnabled = getSwipeUpEnabledFromSettings(swipeUpDefaultValue);
        pw.print("  swipeUpSetting="); pw.println(swipeUpEnabled);
        pw.print("  swipeUpSettingDefault="); pw.println(swipeUpDefaultValue);
        int navBarMode = Resources.getSystem().getInteger(
                com.android.internal.R.integer.config_navBarInteractionMode);
        pw.print("  navBarMode="); pw.println(navBarMode);
    }

    public interface OverviewProxyListener {