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

Commit 4a0bf074 authored by android-build-prod (mdb)'s avatar android-build-prod (mdb) Committed by Gerrit Code Review
Browse files

Merge changes I481fbbc7,I57e48b5d,Ieb52489b,I2763ddd9

* changes:
  Translation tweaks.
  Migrated context menu to be a PopupMenu instead.
  Add column for call mapping id to AnnotatedCallLog database.
  Don't force open keyboard when RTT is active.
parents dd18cb13 2cc1bfc1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ public final class CallDetailsCursorLoader extends CursorLoader {
        AnnotatedCallLog.TIMESTAMP,
        AnnotatedCallLog.DURATION,
        AnnotatedCallLog.DATA_USAGE,
        AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME
        AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME,
        AnnotatedCallLog.CALL_MAPPING_ID
      };

  // Indexes for COLUMNS_FOR_CALL_DETAILS
@@ -53,6 +54,7 @@ public final class CallDetailsCursorLoader extends CursorLoader {
  private static final int DURATION = 4;
  private static final int DATA_USAGE = 5;
  private static final int PHONE_ACCOUNT_COMPONENT_NAME = 6;
  private static final int CALL_MAPPING_ID = 7;

  CallDetailsCursorLoader(Context context, CoalescedIds coalescedIds) {
    super(
@@ -140,9 +142,7 @@ public final class CallDetailsCursorLoader extends CursorLoader {
        .setDate(cursor.getLong(TIMESTAMP))
        .setDuration(cursor.getLong(DURATION))
        .setDataUsage(cursor.getLong(DATA_USAGE))

        .setCallMappingId(String.valueOf(cursor.getLong(TIMESTAMP)));

        .setCallMappingId(cursor.getString(CALL_MAPPING_ID));

    String phoneAccountComponentName = cursor.getString(PHONE_ACCOUNT_COMPONENT_NAME);
    entry.setIsDuoCall(DuoComponent.get(context).getDuo().isDuoAccount(phoneAccountComponentName));
+23 −3
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper {
      @ApplicationContext Context appContext,
      @AnnotatedCallLogMaxRows int maxRows,
      @BackgroundExecutor ListeningExecutorService backgroundExecutor) {
    super(appContext, FILENAME, null, 1);
    super(appContext, FILENAME, null, 2);

    this.appContext = appContext;
    this.maxRows = maxRows;
@@ -75,9 +75,24 @@ public class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper {
          + (AnnotatedCallLog.NUMBER_ATTRIBUTES + " blob, ")
          + (AnnotatedCallLog.IS_VOICEMAIL_CALL + " integer, ")
          + (AnnotatedCallLog.VOICEMAIL_CALL_TAG + " text, ")
          + (AnnotatedCallLog.TRANSCRIPTION_STATE + " integer")
          + (AnnotatedCallLog.TRANSCRIPTION_STATE + " integer, ")
          + (AnnotatedCallLog.CALL_MAPPING_ID + " text")
          + ");";

  private static final String ALTER_TABLE_SQL_ADD_CALL_MAPPING_ID_COLUMN =
      "alter table "
          + AnnotatedCallLog.TABLE
          + " add column "
          + AnnotatedCallLog.CALL_MAPPING_ID
          + " text;";
  private static final String UPDATE_CALL_MAPPING_ID_COLUMN =
      "update "
          + AnnotatedCallLog.TABLE
          + " set "
          + AnnotatedCallLog.CALL_MAPPING_ID
          + " = "
          + AnnotatedCallLog.TIMESTAMP;

  /**
   * Deletes all but the first maxRows rows (by timestamp, excluding voicemails) to keep the table a
   * manageable size.
@@ -143,7 +158,12 @@ public class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper {
  }

  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {}
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    if (oldVersion == 1 && newVersion == 2) {
      db.execSQL(ALTER_TABLE_SQL_ADD_CALL_MAPPING_ID_COLUMN);
      db.execSQL(UPDATE_CALL_MAPPING_ID_COLUMN);
    }
  }

  /** Closes the database and deletes it. */
  public ListenableFuture<Void> delete() {
+11 −0
Original line number Diff line number Diff line
@@ -221,6 +221,17 @@ public class AnnotatedCallLogContract {
     * <p>TYPE: TEXT
     */
    public static final String VOICEMAIL_URI = "voicemail_uri";

    /**
     * An unique id to associate this call log row to a {@link android.telecom.Call}.
     *
     * <p>For pre-Q device, this is same as {@link TIMESTAMP}.
     *
     * <p>For Q+ device, this will be copied from {@link android.provider.CallLog.Calls}.
     *
     * <p>Type: TEXT
     */
    public static final String CALL_MAPPING_ID = "call_mapping_id";
  }

  /**
+3 −0
Original line number Diff line number Diff line
@@ -370,6 +370,9 @@ public class SystemCallLogDataSource implements CallLogDataSource {
        contentValues.put(AnnotatedCallLog.DATA_USAGE, dataUsage);
        contentValues.put(AnnotatedCallLog.TRANSCRIPTION, transcription);
        contentValues.put(AnnotatedCallLog.VOICEMAIL_URI, voicemailUri);

        contentValues.put(AnnotatedCallLog.CALL_MAPPING_ID, String.valueOf(date));

        setTranscriptionState(cursor, contentValues);

        if (existingAnnotatedCallLogIds.contains(id)) {
+4 −4
Original line number Diff line number Diff line
@@ -66,28 +66,28 @@
       This translation may require the variables to be rearranged for grammars different than
       english. [CHAR LIMIT=NONE] -->
  <string name="a11y_call_duration_format">
    <xliff:g id="minutes">%d</xliff:g> <xliff:g id="minutes_translation">%s</xliff:g> <xliff:g id="seconds">%d</xliff:g> <xliff:g id="seconds_translation">%s</xliff:g>
    <xliff:g id="minutes">%1$d</xliff:g> <xliff:g id="minutes_translation">%2$s</xliff:g> <xliff:g id="seconds">%3$d</xliff:g> <xliff:g id="seconds_translation">%4$s</xliff:g>
  </string>

  <!-- A string to announce a call duration. For example, in english might say 15 seconds.
       This translation may require the variables to be rearranged for grammars different than
       english. [CHAR LIMIT=NONE] -->
  <string name="a11y_call_duration_short_format">
    <xliff:g id="seconds">%d</xliff:g> <xliff:g id="seconds_translation">%s</xliff:g>
    <xliff:g id="seconds">%1$d</xliff:g> <xliff:g id="seconds_translation">%2$s</xliff:g>
  </string>

  <!-- A pattern to define the layout of a call duration string. for example, in english might
        say 2m 15s. Translation should only rearrange the inputs. minutes_translation and
        seconds_translation should remain in \'quotes\'. [CHAR LIMIT=NONE] -->
  <string name="call_duration_format_pattern">
    <xliff:g id="minutes_special_character">%s</xliff:g>\'<xliff:g id="minutes_translation">%s</xliff:g>\' <xliff:g id="seconds_special_character">%s</xliff:g>\'<xliff:g id="seconds_translation">%s</xliff:g>\'
    <xliff:g id="minutes_special_character">%1$s</xliff:g>\'<xliff:g id="minutes_translation">%2$s</xliff:g>\' <xliff:g id="seconds_special_character">%3$s</xliff:g>\'<xliff:g id="seconds_translation">%4$s</xliff:g>\'
  </string>

  <!-- A pattern to define the layout of a call duration string. for example, in english might
        say 2m 15s. Translation should only rearrange the inputs. seconds_translation should
        remain in \'quotes\'. [CHAR LIMIT=NONE] -->
  <string name="call_duration_short_format_pattern">
    <xliff:g id="seconds_special_character">%s</xliff:g>\'<xliff:g id="seconds_translation">%s</xliff:g>\'
    <xliff:g id="seconds_special_character">%1$s</xliff:g>\'<xliff:g id="seconds_translation">%2$s</xliff:g>\'
  </string>

  <!-- A full string for seconds (time). [CHAR LIMIT=NONE] -->
Loading