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

Commit 38db0c78 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ic61819b8,I4149abe1,Ic738a6dd,I297faa26,Ib6a929ef, ...

* changes:
  Prevent PreCallActivity from showing in lockscreen if it is not started in the lockscreen
  Prevent change SIM icon from showing during a voicemail call
  Expose user home country code as public method in Mediator Interface.
  Update assisted dialing setting text.
  Contact list no longer jumps to the top when the cp2 database updates.
  Refactor DialpadFragment's DtmfKeyListener
  Adjust strings for select SIM dialog
  Add impressions for dual sim features
parents 9c93611e 9264b265
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -27,6 +27,11 @@ public interface AssistedDialingMediator {
  /** Returns {@code true} if the current client platform supports Assisted Dialing. */
  public boolean isPlatformEligible();

  /** Returns the country code in which the library thinks the user typically resides. */
  @SuppressWarnings("AndroidApiChecker") // Use of optional
  @TargetApi(VERSION_CODES.N)
  public Optional<String> userHomeCountryCode();

  @SuppressWarnings("AndroidApiChecker") // Use of optional
  @TargetApi(VERSION_CODES.N)
  public Optional<TransformationInfo> attemptAssistedDial(@NonNull String numberToTransform);
+8 −0
Original line number Diff line number Diff line
@@ -56,6 +56,14 @@ final class AssistedDialingMediatorImpl implements AssistedDialingMediator {
    return true;
  }

  /** Returns the country code in which the library thinks the user typically resides. */
  @Override
  @SuppressWarnings("AndroidApiChecker") // Use of optional
  @TargetApi(VERSION_CODES.N)
  public Optional<String> userHomeCountryCode() {
    return locationDetector.getUpperCaseUserHomeCountry();
  }

  /**
   * Returns an Optional of type String containing the transformed number that was provided. The
   * transformed number should be capable of dialing out of the User's current country and
+8 −0
Original line number Diff line number Diff line
@@ -32,6 +32,14 @@ public final class AssistedDialingMediatorStub implements AssistedDialingMediato
    return Optional.empty();
  }

  /** Always returns an empty Optional. */
  @Override
  @SuppressWarnings("AndroidApiChecker") // Use of optional
  @TargetApi(VERSION_CODES.N)
  public Optional<String> userHomeCountryCode() {
    return Optional.empty();
  }

  @Override
  public boolean isPlatformEligible() {
    return false;
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
  <string name="assisted_dialing_setting_title">Assisted dialing</string>

  <!-- Label for a setting enabling assisted dialing switch preference-->
  <string name="assisted_dialing_setting_summary">Automatically correct the phone number prefix when traveling and calling international numbers</string>
  <string name="assisted_dialing_setting_summary">Predict and add a country code when you call while traveling abroad</string>

  <!-- Key for the assisted dialing setting toggle-->
  <string name="assisted_dialing_setting_toggle_key" translatable="false">assisted_dialing_setting_toggle_key</string>
+10 −7
Original line number Diff line number Diff line
@@ -49,22 +49,24 @@ final class ContactsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder

  private final ArrayMap<ContactViewHolder, Integer> holderMap = new ArrayMap<>();
  private final Context context;
  private final Cursor cursor;
  private final @Header int header;
  private final @ClickAction int clickAction;

  // List of contact sublist headers
  private final String[] headers;

  private String[] headers = new String[0];
  // Number of contacts that correspond to each header in {@code headers}.
  private final int[] counts;
  private int[] counts = new int[0];
  // Cursor with list of contacts
  private Cursor cursor;

  ContactsAdapter(
      Context context, Cursor cursor, @Header int header, @ClickAction int clickAction) {
  ContactsAdapter(Context context, @Header int header, @ClickAction int clickAction) {
    this.context = context;
    this.cursor = cursor;
    this.header = header;
    this.clickAction = clickAction;
  }

  void updateCursor(Cursor cursor) {
    this.cursor = cursor;
    headers = cursor.getExtras().getStringArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES);
    counts = cursor.getExtras().getIntArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS);
    if (counts != null) {
@@ -78,6 +80,7 @@ final class ContactsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
            "ContactsAdapter", "Count sum (%d) != cursor count (%d).", sum, cursor.getCount());
      }
    }
    notifyDataSetChanged();
  }

  @Override
Loading