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

Commit 13c63260 authored by David Liu's avatar David Liu
Browse files

fixed NPE while initializing controllers by commenting out the failure

one for temporal fix

Added @Nullable in parameters of buildPreferenceControllers() to prevent using nullable parameter to functions requires non-nullable.

Bug: 315330037
Test: see developer options preferences show/hide based on the
controllers isAvailable()

Change-Id: If42faea900a2220d9b1f5e38e1befbd5a555e78a
parent f04ee0df
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -727,10 +727,11 @@
            android:title="@string/enable_non_resizable_multi_window"
            android:summary="@string/enable_non_resizable_multi_window_summary" />

        <SwitchPreferenceCompat
            android:key="back_navigation_animation"
            android:title="@string/back_navigation_animation"
            android:summary="@string/back_navigation_animation_summary" />
        // TODO(b/315859328): Temporally removed since causing search indexing failure.
<!--        <SwitchPreferenceCompat-->
<!--            android:key="back_navigation_animation"-->
<!--            android:title="@string/back_navigation_animation"-->
<!--            android:summary="@string/back_navigation_animation_summary" />-->

        <Preference
            android:key="reset_shortcut_manager_throttling"
+5 −3
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

@@ -606,8 +607,9 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
    }

    private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
            Activity activity, Lifecycle lifecycle, DevelopmentSettingsDashboardFragment fragment,
            BluetoothA2dpConfigStore bluetoothA2dpConfigStore) {
            @Nullable Activity activity, @Nullable Lifecycle lifecycle,
            @Nullable DevelopmentSettingsDashboardFragment fragment,
            @Nullable BluetoothA2dpConfigStore bluetoothA2dpConfigStore) {
        final List<AbstractPreferenceController> controllers = new ArrayList<>();
        controllers.add(new MemoryUsagePreferenceController(context));
        controllers.add(new BugReportPreferenceController(context));
@@ -735,7 +737,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
        controllers.add(new OverlaySettingsPreferenceController(context));
        controllers.add(new StylusHandwritingPreferenceController(context));
        controllers.add(new IngressRateLimitPreferenceController((context)));
        controllers.add(new BackAnimationPreferenceController(context, fragment));
        // controllers.add(new BackAnimationPreferenceController(context, fragment));
        controllers.add(new PhantomProcessPreferenceController(context));
        controllers.add(new ContrastPreferenceController(
                context, context.getSystemService(UiModeManager.class)));
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ public class BaseSearchIndexProvider implements Indexable.SearchIndexProvider {
        try {
            controllersFromCode = createPreferenceControllers(context);
        } catch (Exception e) {
            Log.w(TAG, "Error initial controller");
            Log.w(TAG, "Error initializing controller in fragment: " + this + ", e: " + e);
        }

        final List<SearchIndexableResource> res = getXmlResourcesToIndex(context, true);