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

Commit 80cafcbb authored by linyuh's avatar linyuh Committed by Copybara-Service
Browse files

Make sure we have a host for the search fragment before loading data.

Bug: 110941275
Test: None
PiperOrigin-RevId: 202546724
Change-Id: If8ca1f57ac61288efc13da07cfc88cee72e170c7
parent 5b99e36d
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -121,11 +121,23 @@ public final class NewSearchFragment extends Fragment
  // the contacts in them).
  private final List<Directory> directories = new ArrayList<>();
  private final Runnable loaderCp2ContactsRunnable =
      () -> getLoaderManager().restartLoader(CONTACTS_LOADER_ID, null, this);
      () -> {
        if (getHost() != null) {
          getLoaderManager().restartLoader(CONTACTS_LOADER_ID, null, this);
        }
      };
  private final Runnable loadNearbyPlacesRunnable =
      () -> getLoaderManager().restartLoader(NEARBY_PLACES_LOADER_ID, null, this);
      () -> {
        if (getHost() != null) {
          getLoaderManager().restartLoader(NEARBY_PLACES_LOADER_ID, null, this);
        }
      };
  private final Runnable loadDirectoryContactsRunnable =
      () -> getLoaderManager().restartLoader(DIRECTORY_CONTACTS_LOADER_ID, null, this);
      () -> {
        if (getHost() != null) {
          getLoaderManager().restartLoader(DIRECTORY_CONTACTS_LOADER_ID, null, this);
        }
      };
  private final Runnable capabilitiesUpdatedRunnable = () -> adapter.notifyDataSetChanged();

  private Runnable updatePositionRunnable;