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

Commit 65251cb8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Refine behaviors of new app page"

parents 8277a0f7 45b8181f
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
    android:title="@string/apps_dashboard_title">

    <Preference
        android:key="all_app_info"
        android:key="all_app_infos"
        android:title="@string/applications_settings"
        android:summary="@string/summary_placeholder"
        android:order="-999"
@@ -55,7 +55,7 @@
        settings:searchable="false"/>

    <Preference
        android:key="default_apps"
        android:key="default_apps_v2"
        android:title="@string/app_default_dashboard_title"
        android:order="-996"
        settings:controller="com.android.settings.applications.DefaultAppsPreferenceController">
@@ -66,4 +66,11 @@
        android:key="dashboard_tile_placeholder"
        android:order="10"/>

    <Preference
        android:key="special_access_v2"
        android:fragment="com.android.settings.applications.specialaccess.SpecialAccessSettings"
        android:title="@string/special_access"
        android:order="20"
        settings:controller="com.android.settings.applications.SpecialAppAccessPreferenceController"/>

</PreferenceScreen>
+27 −1
Original line number Diff line number Diff line
@@ -18,8 +18,11 @@ package com.android.settings.applications;

import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
import android.util.FeatureFlagUtils;

import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -27,6 +30,7 @@ import com.android.settingslib.drawer.CategoryKey;
import com.android.settingslib.search.SearchIndexable;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/** Settings page for apps. */
@@ -65,6 +69,7 @@ public class AppDashboardFragment extends DashboardFragment {
    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        use(SpecialAppAccessPreferenceController.class).setSession(getSettingsLifecycle());
        mAppsPreferenceController = use(AppsPreferenceController.class);
        mAppsPreferenceController.setFragment(this /* fragment */);
    }
@@ -85,5 +90,26 @@ public class AppDashboardFragment extends DashboardFragment {
    }

    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider(R.xml.apps);
            new BaseSearchIndexProvider() {
                @Override
                public List<SearchIndexableResource> getXmlResourcesToIndex(
                        Context context, boolean enabled) {
                    final SearchIndexableResource sir = new SearchIndexableResource(context);
                    sir.xmlResId = R.xml.apps;
                    return Arrays.asList(sir);
                }

                @Override
                public List<AbstractPreferenceController> createPreferenceControllers(
                        Context context) {
                    return buildPreferenceControllers(context);
                }

                @Override
                protected boolean isPageSearchEnabled(Context context) {
                    // TODO(b/174964405): This method should be removed when silky home launched.
                    // Only allow this page can be searchable when silky home enabled.
                    return FeatureFlagUtils.isEnabled(context, FeatureFlags.SILKY_HOME);
                }
            };
}
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class AppsPreferenceController extends BasePreferenceController {
    @VisibleForTesting
    static final String KEY_GENERAL_CATEGORY = "general_category";
    @VisibleForTesting
    static final String KEY_ALL_APP_INFO = "all_app_info";
    static final String KEY_ALL_APP_INFO = "all_app_infos";
    @VisibleForTesting
    static final String KEY_SEE_ALL = "see_all_apps";