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

Commit 5114e1dc authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ia1765cb4,Ib262ca4b

* changes:
  Use new dialer base theme instead of AppCompat theme for spam blocking promo dialog.
  Append the directory ID when building contact lookup URIs in CP2 lookups.
parents e10f20f6 97308c95
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.DeletedContacts;
import android.provider.ContactsContract.Directory;
import android.support.annotation.Nullable;
import android.support.v4.util.ArrayMap;
import android.support.v4.util.ArraySet;
@@ -134,7 +135,8 @@ public final class Cp2DefaultDirectoryPhoneLookup implements PhoneLookup<Cp2Info
        return Cp2Info.getDefaultInstance();
      }
      while (cursor.moveToNext()) {
        cp2ContactInfos.add(Cp2Projections.buildCp2ContactInfoFromCursor(appContext, cursor));
        cp2ContactInfos.add(
            Cp2Projections.buildCp2ContactInfoFromCursor(appContext, cursor, Directory.DEFAULT));
      }
    } finally {
      if (cursor != null) {
@@ -794,7 +796,8 @@ public final class Cp2DefaultDirectoryPhoneLookup implements PhoneLookup<Cp2Info
                  cp2ContactInfosByNumber.put(validE164Number, cp2ContactInfos);
                }
                cp2ContactInfos.add(
                    Cp2Projections.buildCp2ContactInfoFromCursor(appContext, cursor));
                    Cp2Projections.buildCp2ContactInfoFromCursor(
                        appContext, cursor, Directory.DEFAULT));
              }
            }
          }
@@ -818,7 +821,8 @@ public final class Cp2DefaultDirectoryPhoneLookup implements PhoneLookup<Cp2Info
            } else {
              while (cursor.moveToNext()) {
                cp2ContactInfos.add(
                    Cp2Projections.buildCp2ContactInfoFromCursor(appContext, cursor));
                    Cp2Projections.buildCp2ContactInfoFromCursor(
                        appContext, cursor, Directory.DEFAULT));
              }
            }
          }
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ public final class Cp2ExtendedDirectoryPhoneLookup implements PhoneLookup<Cp2Inf

            do {
              cp2InfoBuilder.addCp2ContactInfo(
                  Cp2Projections.buildCp2ContactInfoFromCursor(appContext, cursor));
                  Cp2Projections.buildCp2ContactInfoFromCursor(appContext, cursor, directoryId));
            } while (cursor.moveToNext());
          }

+10 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.dialer.phonelookup.cp2;

import android.content.Context;
import android.database.Cursor;
import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.PhoneLookup;
@@ -85,7 +86,8 @@ final class Cp2Projections {
   * Builds a {@link Cp2ContactInfo} based on the current row of {@code cursor}, of which the
   * projection is either {@link #PHONE_PROJECTION} or {@link #PHONE_LOOKUP_PROJECTION}.
   */
  static Cp2ContactInfo buildCp2ContactInfoFromCursor(Context appContext, Cursor cursor) {
  static Cp2ContactInfo buildCp2ContactInfoFromCursor(
      Context appContext, Cursor cursor, long directoryId) {
    String displayName = cursor.getString(CP2_INFO_NAME_INDEX);
    String photoThumbnailUri = cursor.getString(CP2_INFO_PHOTO_THUMBNAIL_URI_INDEX);
    String photoUri = cursor.getString(CP2_INFO_PHOTO_URI_INDEX);
@@ -116,7 +118,13 @@ final class Cp2Projections {
    }
    infoBuilder.setContactId(contactId);
    if (!TextUtils.isEmpty(lookupKey)) {
      infoBuilder.setLookupUri(Contacts.getLookupUri(contactId, lookupKey).toString());
      infoBuilder.setLookupUri(
          Contacts.getLookupUri(contactId, lookupKey)
              .buildUpon()
              .appendQueryParameter(
                  ContactsContract.DIRECTORY_PARAM_KEY, String.valueOf(directoryId))
              .build()
              .toString());
    }

    // Only PHONE_PROJECTION has a column containing carrier presence info.
+6 −3
Original line number Diff line number Diff line
@@ -62,9 +62,12 @@
    <item name="dialpad_text_color_secondary">?android:attr/textColorSecondaryInverse</item>
  </style>

  <style name="AfterCallNotificationTheme" parent="@android:style/Theme.Material.Light.Dialog">
    <!-- This colorAccent is to style checkboxes in the dialogs -->
    <item name="colorAccent">?android:attr/colorPrimary</item>
  <style name="AfterCallNotificationTheme" parent="Dialer.ThemeBase.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:colorBackgroundCacheHint">@null</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowAnimationStyle">@android:style/Animation</item>
  </style>

  <style name="AfterCallDialogStyle" parent="@android:style/Theme.Material.Light.Dialog">