Merge "fixed NPE while initializing controllers by commenting out the failure one for temporal fix" into main
diff --git a/res/xml/development_settings.xml b/res/xml/development_settings.xml
index f0a2881..e1ccad8 100644
--- a/res/xml/development_settings.xml
+++ b/res/xml/development_settings.xml
@@ -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"
diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
index 4c8b2dc..a483f9f 100644
--- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
+++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
@@ -49,6 +49,7 @@
 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 @@
     }
 
     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 @@
         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)));
diff --git a/src/com/android/settings/search/BaseSearchIndexProvider.java b/src/com/android/settings/search/BaseSearchIndexProvider.java
index 581eb2e..d21d983 100644
--- a/src/com/android/settings/search/BaseSearchIndexProvider.java
+++ b/src/com/android/settings/search/BaseSearchIndexProvider.java
@@ -136,7 +136,7 @@
         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);