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

Commit b8db7054 authored by uabdullah's avatar uabdullah Committed by android-build-merger
Browse files

Merge changes I5a55df44,I7230508f

am: e2da6ef8

Change-Id: I6a06d0458ce963ae009ca72016081f623300a810
parents 8178f662 e2da6ef8
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -44,8 +44,12 @@ final class SimulatorMainMenu {
            "Notifications",
            SimulatorNotifications.getActionProvider(activity.getApplicationContext()))
        .addItem("Populate database", () -> populateDatabase(activity.getApplicationContext()))
        .addItem("Populate voicemail", () -> populateVoicemail(activity.getApplicationContext()))
        .addItem(
            "Fast populate database", () -> fastPopulateDatabase(activity.getApplicationContext()))
        .addItem(
            "Fast populate voicemail database",
            () -> populateVoicemailFast(activity.getApplicationContext()))
        .addItem("Clean database", () -> cleanDatabase(activity.getApplicationContext()))
        .addItem("clear preferred SIM", () -> clearPreferredSim(activity.getApplicationContext()))
        .addItem("Sync voicemail", () -> syncVoicemail(activity.getApplicationContext()))
@@ -65,6 +69,32 @@ final class SimulatorMainMenu {
        .executeSerial(new PopulateDatabaseWorkerInput(context, false));
  }

  private static void populateVoicemail(@NonNull Context context) {
    DialerExecutorComponent.get(context)
        .dialerExecutorFactory()
        .createNonUiTaskBuilder(new PopulateVoicemailWorker())
        .build()
        .executeSerial(new PopulateDatabaseWorkerInput(context, false));
  }

  private static void populateVoicemailFast(@NonNull Context context) {
    DialerExecutorComponent.get(context)
        .dialerExecutorFactory()
        .createNonUiTaskBuilder(new PopulateVoicemailWorker())
        .build()
        .executeSerial(new PopulateDatabaseWorkerInput(context, true));
  }

  private static class PopulateVoicemailWorker
      implements Worker<PopulateDatabaseWorkerInput, Void> {
    @Nullable
    @Override
    public Void doInBackground(PopulateDatabaseWorkerInput input) {
      VoicemailPopulator.populateVoicemail(input.context, input.fastMode);
      return null;
    }
  }

  private static void fastPopulateDatabase(@NonNull Context context) {
    DialerExecutorComponent.get(context)
        .dialerExecutorFactory()
+9 −9
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter<ViewHolder>
    // TODO(uabdullah): a bug Remove logging, temporarily here for debugging.
    printHashSet();
    // TODO(uabdullah): a bug Remove logging, temporarily here for debugging.
    printHashMap();
    printArrayMap();

    if (viewHolder instanceof NewVoicemailHeaderViewHolder) {
      LogUtil.i(
@@ -241,7 +241,7 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter<ViewHolder>

      newVoicemailViewHolderArrayMap.remove(newVoicemailViewHolder.getViewHolderId());
      printHashSet();
      printHashMap();
      printArrayMap();
    }

    newVoicemailViewHolder.reset();
@@ -265,7 +265,7 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter<ViewHolder>
    // TODO(uabdullah): a bug Remove logging, temporarily here for debugging.
    printHashSet();
    // TODO(uabdullah): a bug Remove logging, temporarily here for debugging.
    printHashMap();
    printArrayMap();

    // If the viewholder is playing the voicemail, keep updating its media player view (seekbar,
    // duration etc.)
@@ -298,12 +298,12 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter<ViewHolder>
    // TODO(uabdullah): a bug Remove logging, temporarily here for debugging.
    printHashSet();
    // TODO(uabdullah): a bug Remove logging, temporarily here for debugging.
    printHashMap();
    printArrayMap();
  }

  private void printHashMap() {
  private void printArrayMap() {
    LogUtil.i(
        "NewVoicemailAdapter.printHashMap",
        "NewVoicemailAdapter.printArrayMap",
        "hashMapSize: %d, currentlyExpandedViewHolderId:%d",
        newVoicemailViewHolderArrayMap.size(),
        currentlyExpandedViewHolderId);
@@ -311,9 +311,9 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter<ViewHolder>
    if (!newVoicemailViewHolderArrayMap.isEmpty()) {
      String ids = "";
      for (int id : newVoicemailViewHolderArrayMap.keySet()) {
        ids = id + String.valueOf(id) + " ";
        ids = ids + id + " ";
      }
      LogUtil.i("NewVoicemailAdapter.printHashMap", "ids are " + ids);
      LogUtil.i("NewVoicemailAdapter.printArrayMap", "ids are " + ids);
    }
  }

@@ -801,7 +801,7 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter<ViewHolder>
          currentlyExpandedViewHolderId);
      // TODO(uabdullah): a bug Remove logging, temporarily here for debugging.
      printHashSet();
      printHashMap();
      printArrayMap();
      return null;
    }
  }