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

Commit 97ea279c authored by Jernej Virag's avatar Jernej Virag
Browse files

Add setting to allow configuration of long press home gesture

This allows configuration of long press home gesture on 2-/3-button navigation configurations. It allows the user to enable and disable the invocation of assistant app using said gesture.

Bug: 191888710
Test: Unit tests and on a physical device.
Change-Id: I18cb290058ac5c2a748d40802b942404f548b868
parent 666d0984
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -3932,6 +3932,25 @@
                       android:value="true" />
        </activity>

        <activity
            android:name="Settings$ButtonNavigationSettingsActivity"
            android:label="Button Navigation Settings"
            android:exported="true"
            android:enabled="true">
            <intent-filter android:priority="32">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.android.settings.SHORTCUT" />
            </intent-filter>
            <intent-filter android:priority="1">
                <action android:name="com.android.settings.BUTTON_NAVIGATION_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                       android:value="com.android.settings.gestures.ButtonNavigationSettingsFragment" />
            <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
                       android:value="true" />
        </activity>

        <activity android:name="Settings$MediaControlsSettingsActivity"
                  android:exported="true"
                  android:label="@strings/media_controls_title">
+11 −0
Original line number Diff line number Diff line
@@ -11789,6 +11789,11 @@
    <!-- Summary text for swiping from bottom corners to invoke the digital assistant app. [CHAR LIMIT=NONE] -->
    <string name="assistant_corner_gesture_summary">Swipe up from a bottom corner to invoke digital assistant app.</string>
    <!-- Title text for holding a long press on Home button to invoke the digital assistant app. [CHAR LIMIT=60] -->
    <string name="assistant_long_press_home_gesture_title">Hold Home to invoke assistant</string>
    <!-- Summary text for holding a long press on Home button to invoke the digital assistant app. [CHAR LIMIT=NONE] -->
    <string name="assistant_long_press_home_gesture_summary">Press and hold the Home button to invoke digital assistant app.</string>
    <!-- Content description for the Information icon [CHAR LIMIT=30] -->
    <string name="information_label">Information</string>
@@ -11811,9 +11816,15 @@
    <!-- Title for the screen to show all the gesture navigation settings [CHAR LIMIT=80] -->
    <string name="gesture_settings_activity_title">Gesture Navigation Sensitivity</string>
    <!-- Title for the screen to show all the 2- and 3-button navigation settings. [CHAR LIMIT=80] -->
    <string name="button_navigation_settings_activity_title">Button navigation</string>
    <!-- Keywords for the gesture navigation settings. [CHAR LIMIT=NONE] -->
    <string name="keywords_gesture_navigation_settings">gesture navigation, back sensitivity, back gesture</string>
    <!-- Keywords for the 2-/3-button navigation settings. [CHAR LIMIT=NONE] -->
    <string name="keywords_button_navigation_settings">navigation, home button</string>
    <!-- Preference and settings suggestion title text for ambient display double tap (phone) [CHAR LIMIT=60]-->
    <string name="ambient_display_title" product="default">Double-tap to check phone</string>
    <!-- Preference and settings suggestion title text for ambient display double tap (tablet) [CHAR LIMIT=60]-->
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<!--

  Copyright (C) 2021 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.
-->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:key="button_navigation_settings_page"
    android:title="@string/button_navigation_settings_activity_title"
    settings:keywords="@string/keywords_button_navigation_settings">

    <PreferenceCategory
        android:key="assistant_button_navigation_category"
        android:persistent="false"
        android:title="@string/assistant_gesture_category_title">

        <SwitchPreference
            android:key="assistant_long_press_home_gesture"
            android:title="@string/assistant_long_press_home_gesture_title"
            android:summary="@string/assistant_long_press_home_gesture_summary"
            settings:controller="com.android.settings.gestures.ButtonNavigationSettingsAssistController"
        />

    </PreferenceCategory>

</PreferenceScreen>
+2 −0
Original line number Diff line number Diff line
@@ -243,6 +243,8 @@ public class Settings extends SettingsActivity {
    public static class AutomaticStorageManagerSettingsActivity extends SettingsActivity { /* empty */ }
    public static class GamesStorageActivity extends SettingsActivity { /* empty */ }
    public static class GestureNavigationSettingsActivity extends SettingsActivity { /* empty */ }
    /** Activity to manage 2-/3-button navigation configuration. */
    public static class ButtonNavigationSettingsActivity extends SettingsActivity { /* empty */ }
    public static class InteractAcrossProfilesSettingsActivity extends SettingsActivity {
        /* empty */
    }
+2 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ import com.android.settings.fuelgauge.PowerUsageSummary;
import com.android.settings.fuelgauge.batterysaver.BatterySaverScheduleSettings;
import com.android.settings.fuelgauge.batterysaver.BatterySaverSettings;
import com.android.settings.gestures.AssistGestureSettings;
import com.android.settings.gestures.ButtonNavigationSettingsFragment;
import com.android.settings.gestures.DoubleTapPowerSettings;
import com.android.settings.gestures.DoubleTapScreenSettings;
import com.android.settings.gestures.DoubleTwistGestureSettings;
@@ -312,6 +313,7 @@ public class SettingsGateway {
            DarkModeSettingsFragment.class.getName(),
            BugReportHandlerPicker.class.getName(),
            GestureNavigationSettingsFragment.class.getName(),
            ButtonNavigationSettingsFragment.class.getName(),
            InteractAcrossProfilesSettings.class.getName(),
            InteractAcrossProfilesDetails.class.getName(),
            MediaControlsSettings.class.getName(),
Loading