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

Unverified Commit e4d46b4d authored by Alexander Koskovich's avatar Alexander Koskovich Committed by Michael Bestas
Browse files

Trebuchet: Allow changing app suggestion settings

Change-Id: Ib077324ba6676a1b8e143b26c14bf0b6eb258d28
parent f442753e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -48,4 +48,8 @@
    <string name="trust_apps_help">Help</string>
    <string name="trust_apps_info_hidden">Hidden apps and their widgets are hidden from the drawer</string>
    <string name="trust_apps_info_protected">Protected apps require authentication to be opened from the launcher</string>

    <!-- App suggestions -->
    <string name="pref_suggestions_title">Suggestions</string>
    <string name="pref_suggestions_summary">For app drawer &amp; home screen suggestions</string>
</resources>
+9 −0
Original line number Diff line number Diff line
@@ -68,6 +68,15 @@
        android:key="pref_trust_apps"
        android:title="@string/trust_apps_manager_name" />

    <androidx.preference.PreferenceScreen
        android:key="pref_suggestions"
        android:title="@string/pref_suggestions_title"
        android:summary="@string/pref_suggestions_summary"
        android:persistent="false">

        <intent android:action="android.settings.ACTION_CONTENT_SUGGESTIONS_SETTINGS" />
    </androidx.preference.PreferenceScreen>

    <SwitchPreference
        android:key="pref_desktop_show_labels"
        android:title="@string/desktop_show_labels"
+6 −0
Original line number Diff line number Diff line
@@ -92,6 +92,9 @@ public class SettingsActivity extends FragmentActivity
    private static final String SEARCH_PACKAGE = "com.google.android.googlequicksearchbox";
    public static final String KEY_TRUST_APPS = "pref_trust_apps";

    private static final String KEY_SUGGESTIONS = "pref_suggestions";
    private static final String SUGGESTIONS_PACKAGE = "com.google.android.as";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
@@ -310,6 +313,9 @@ public class SettingsActivity extends FragmentActivity
                        return true;
                    });
                    return true;

                case KEY_SUGGESTIONS:
                    return LineageUtils.isPackageEnabled(getActivity(), SUGGESTIONS_PACKAGE);
            }

            return true;