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

Commit 05b5e891 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I46e819a0,I4ee4ff98,Ifae9c912,Idc58efce,I60b0122f

* changes:
  Add skeleton for SpamPhoneLookup
  Show Icon and label for blocked numbers
  Bubble v2 a11y.
  Add flag to enable NUI shortcut.
  Rename "ApdlInfo" as "SpamInfo" in proto PhoneLookupInfo.
parents 42a0152d 849f332f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -21,11 +21,11 @@ import android.content.SharedPreferences;
import android.support.annotation.MainThread;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import com.android.dialer.buildtype.BuildType;
import com.android.dialer.calllog.datasources.CallLogDataSource;
import com.android.dialer.calllog.datasources.DataSources;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.configprovider.ConfigProviderBindings;
import com.android.dialer.storage.Unencrypted;
import javax.inject.Inject;
import javax.inject.Singleton;
@@ -61,7 +61,7 @@ public final class CallLogFramework implements CallLogDataSource.ContentObserver
    // users will have "new call log" content observers firing. These observers usually do simple
    // things like writing shared preferences.
    // TODO(zachh): Find a way to access Main#isNewUiEnabled without creating a circular dependency.
    if (BuildType.get() == BuildType.BUGFOOD || LogUtil.isDebugEnabled()) {
    if (ConfigProviderBindings.get(appContext).getBoolean("is_nui_shortcut_enabled", false)) {
      for (CallLogDataSource dataSource : dataSources.getDataSourcesIncludingSystemCallLog()) {
        dataSource.registerContentObservers(appContext, this);
      }
+10 −3
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ public class AnnotatedCallLogContentProvider extends ContentProvider {
  }

  private AnnotatedCallLogDatabaseHelper databaseHelper;
  private Coalescer coalescer;

  private final ThreadLocal<Boolean> applyingBatch = new ThreadLocal<>();

@@ -87,7 +86,12 @@ public class AnnotatedCallLogContentProvider extends ContentProvider {
  @Override
  public boolean onCreate() {
    databaseHelper = new AnnotatedCallLogDatabaseHelper(getContext(), MAX_ROWS);
    coalescer = CallLogDatabaseComponent.get(getContext()).coalescer();

    // Note: As this method is called before Application#onCreate, we must *not* initialize objects
    // that require preparation work done in Application#onCreate.
    // One example is to avoid obtaining an instance that depends on Google's proprietary config,
    // which is initialized in Application#onCreate.

    return true;
  }

@@ -158,7 +162,10 @@ public class AnnotatedCallLogContentProvider extends ContentProvider {
                null,
                null,
                AnnotatedCallLog.TIMESTAMP + " DESC")) {
          Cursor coalescedRows = coalescer.coalesce(allAnnotatedCallLogRows);
          Cursor coalescedRows =
              CallLogDatabaseComponent.get(getContext())
                  .coalescer()
                  .coalesce(allAnnotatedCallLogRows);
          coalescedRows.setNotificationUri(
              getContext().getContentResolver(), CoalescedAnnotatedCallLog.CONTENT_URI);
          return coalescedRows;
+3 −0
Original line number Diff line number Diff line
@@ -58,4 +58,7 @@ message NumberAttributes {
  // True if the CP2 information is incomplete and needs to be queried at
  // display time.
  optional bool is_cp2_info_incomplete = 9;

  // The number is blocked.
  optional bool is_blocked = 10;
}
 No newline at end of file
+2 −5
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor;
import com.android.dialer.common.concurrent.Annotations.LightweightExecutor;
import com.android.dialer.inject.ApplicationContext;
import com.android.dialer.phonelookup.PhoneLookup;
import com.android.dialer.phonelookup.PhoneLookupInfo;
import com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator;
@@ -68,7 +67,6 @@ import javax.inject.Inject;
public final class PhoneLookupDataSource
    implements CallLogDataSource, PhoneLookup.ContentObserverCallbacks {

  private final Context appContext;
  private final PhoneLookup<PhoneLookupInfo> phoneLookup;
  private final ListeningExecutorService backgroundExecutorService;
  private final ListeningExecutorService lightweightExecutorService;
@@ -95,11 +93,9 @@ public final class PhoneLookupDataSource
  @Inject
  PhoneLookupDataSource(
      PhoneLookup<PhoneLookupInfo> phoneLookup,
      @ApplicationContext Context appContext,
      @BackgroundExecutor ListeningExecutorService backgroundExecutorService,
      @LightweightExecutor ListeningExecutorService lightweightExecutorService) {
    this.phoneLookup = phoneLookup;
    this.appContext = appContext;
    this.backgroundExecutorService = backgroundExecutorService;
    this.lightweightExecutorService = lightweightExecutorService;
  }
@@ -584,7 +580,7 @@ public final class PhoneLookupDataSource

  private void updateContentValues(ContentValues contentValues, PhoneLookupInfo phoneLookupInfo) {
    PhoneLookupInfoConsolidator phoneLookupInfoConsolidator =
        new PhoneLookupInfoConsolidator(appContext, phoneLookupInfo);
        new PhoneLookupInfoConsolidator(phoneLookupInfo);
    contentValues.put(
        AnnotatedCallLog.NUMBER_ATTRIBUTES,
        NumberAttributes.newBuilder()
@@ -595,6 +591,7 @@ public final class PhoneLookupDataSource
            .setNumberTypeLabel(phoneLookupInfoConsolidator.getNumberLabel())
            .setIsBusiness(phoneLookupInfoConsolidator.isBusiness())
            .setIsVoicemail(phoneLookupInfoConsolidator.isVoicemail())
            .setIsBlocked(phoneLookupInfoConsolidator.isBlocked())
            .setCanReportAsInvalidNumber(phoneLookupInfoConsolidator.canReportAsInvalidNumber())
            .setIsCp2InfoIncomplete(phoneLookupInfoConsolidator.isCp2LocalInfoIncomplete())
            .build()
+2 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import com.android.dialer.calllogutils.CallTypeIconsView;
import com.android.dialer.common.concurrent.DialerExecutorComponent;
import com.android.dialer.compat.telephony.TelephonyManagerCompat;
import com.android.dialer.contactphoto.ContactPhotoManager;
import com.android.dialer.contactphoto.NumberAttributeConverter;
import com.android.dialer.oem.MotorolaUtils;
import com.android.dialer.time.Clock;
import com.google.common.util.concurrent.FutureCallback;
@@ -138,7 +139,7 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder {
            quickContactBadge,
            parseUri(row.numberAttributes().getLookupUri()),
            row.numberAttributes().getPhotoId(),
            parseUri(row.numberAttributes().getPhotoUri()),
            NumberAttributeConverter.getPhotoUri(context, row.numberAttributes()),
            CallLogEntryText.buildPrimaryText(context, row).toString(),
            CallLogContactTypes.getContactType(row));
  }
Loading