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

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

Merge "Prevent crash in Search from Stack overflow"

parents a760cc12 f6cf598d
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -163,15 +163,4 @@ public class ChannelImportanceSettings extends NotificationSettingsBase
        mChannel.lockFields(USER_LOCKED_IMPORTANCE);
        mBackend.updateChannel(mAppRow.pkg, mAppRow.uid, mChannel);
    }

    // This page exists per notification channel; should not be included
    // in search
    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider() {
                @Override
                public List<SearchIndexableResource> getXmlResourcesToIndex(
                        Context context, boolean enabled) {
                    return null;
                }
            };
}
+14 −26
Original line number Diff line number Diff line
@@ -208,15 +208,19 @@ abstract public class NotificationSettingsBase extends DashboardFragment {
                intent,
                0 //PackageManager.MATCH_DEFAULT_ONLY
        );
        if (DEBUG) Log.d(TAG, "Found " + resolveInfos.size() + " preference activities"
        if (DEBUG) {
            Log.d(TAG, "Found " + resolveInfos.size() + " preference activities"
                    + (resolveInfos.size() == 0 ? " ;_;" : ""));
        }
        for (ResolveInfo ri : resolveInfos) {
            final ActivityInfo activityInfo = ri.activityInfo;
            final ApplicationInfo appInfo = activityInfo.applicationInfo;
            if (mAppRow.settingsIntent != null) {
                if (DEBUG) Log.v(TAG, "Ignoring duplicate notification preference activity ("
                if (DEBUG) {
                    Log.d(TAG, "Ignoring duplicate notification preference activity ("
                            + activityInfo.name + ") for package "
                            + activityInfo.packageName);
                }
                continue;
            }
            mAppRow.settingsIntent = intent
@@ -365,8 +369,10 @@ abstract public class NotificationSettingsBase extends DashboardFragment {
        public void onReceive(Context context, Intent intent) {
            String packageName = intent.getData().getSchemeSpecificPart();
            if (mPkgInfo == null || TextUtils.equals(mPkgInfo.packageName, packageName)) {
                if (DEBUG) Log.d(TAG, "Package (" + packageName + ") removed. Removing"
                if (DEBUG) {
                    Log.d(TAG, "Package (" + packageName + ") removed. Removing"
                            + "NotificationSettingsBase.");
                }
                onPackageRemoved();
            }
        }
@@ -380,24 +386,6 @@ abstract public class NotificationSettingsBase extends DashboardFragment {
                return left.getId().compareTo(right.getId());
            };

    /**
     * These screens aren't searchable - they only make sense in the context of an app, so
     * surfacing a generic version would be impossible.
     */
    public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider() {
                @Override
                public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
                        boolean enabled) {
                    return new ArrayList<>();
                }

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

    protected class ImportanceListener {
        protected void onImportanceChanged() {
            final PreferenceScreen screen = getPreferenceScreen();
+0 −9
Original line number Diff line number Diff line
@@ -64,10 +64,6 @@ import com.android.settings.location.LocationSettings;
import com.android.settings.location.ScanningSettings;
import com.android.settings.network.NetworkDashboardFragment;
import com.android.settings.nfc.PaymentSettings;
import com.android.settings.notification.AppNotificationSettings;
import com.android.settings.notification.ChannelGroupNotificationSettings;
import com.android.settings.notification.ChannelImportanceSettings;
import com.android.settings.notification.ChannelNotificationSettings;
import com.android.settings.notification.ConfigureNotificationSettings;
import com.android.settings.notification.SoundSettings;
import com.android.settings.notification.ZenModeAutomationSettings;
@@ -161,7 +157,6 @@ public final class SearchIndexableResources {
        addIndex(TtsEnginePreferenceFragment.class);
        addIndex(MagnificationPreferenceFragment.class);
        addIndex(AccessibilityShortcutPreferenceFragment.class);
        addIndex(ChannelImportanceSettings.class);
        addIndex(DreamSettings.class);
        addIndex(SupportDashboardActivity.class);
        addIndex(AutomaticStorageManagerSettings.class);
@@ -171,10 +166,6 @@ public final class SearchIndexableResources {
        addIndex(LockscreenDashboardFragment.class);
        addIndex(ZenModeBehaviorSettings.class);
        addIndex(ZenModeAutomationSettings.class);
        addIndex(AppNotificationSettings.class);
        addIndex(ChannelNotificationSettings.class);
        addIndex(ChannelImportanceSettings.class);
        addIndex(ChannelGroupNotificationSettings.class);
    }

    private SearchIndexableResources() {
+5 −1
Original line number Diff line number Diff line
@@ -7,6 +7,10 @@ com.android.settings.fuelgauge.AdvancedPowerUsageDetail
com.android.settings.development.featureflags.FeatureFlagsDashboard
com.android.settings.development.qstile.DevelopmentTileConfigFragment
com.android.settings.deviceinfo.StorageProfileFragment
com.android.settings.notification.ChannelNotificationSettings
com.android.settings.notification.ChannelImportanceSettings
com.android.settings.notification.ChannelGroupNotificationSettings
com.android.settings.notification.AppNotificationSettings
com.android.settings.wifi.details.WifiNetworkDetailsFragment
com.android.settings.wifi.p2p.WifiP2pSettings
com.android.settings.enterprise.ApplicationListFragment$AdminGrantedPermissionCamera
+1 −1

File changed.

Contains only whitespace changes.