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

Commit 362de569 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4498106 from 04706000 to pi-release

Change-Id: I0720052ba3389a414245437e4cc9d53d5332e05c
parents 56de6c84 04706000
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2017 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0"
    android:tint="?attr/colorControlNormal">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/>
</vector>
 No newline at end of file
+75 −99
Original line number Diff line number Diff line
@@ -17,9 +17,7 @@
package com.android.dialer.app.calllog;

import android.app.FragmentManager;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import com.android.dialer.blocking.BlockReportSpamDialogs;
@@ -30,6 +28,7 @@ import com.android.dialer.logging.DialerImpression;
import com.android.dialer.logging.Logger;
import com.android.dialer.logging.ReportingLocation;
import com.android.dialer.spam.Spam;
import com.android.dialer.spam.SpamComponent;

/** Listener to show dialogs for block and report spam actions. */
public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClickListener {
@@ -38,6 +37,7 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
  private final FragmentManager mFragmentManager;
  private final RecyclerView.Adapter mAdapter;
  private final FilteredNumberAsyncQueryHandler mFilteredNumberAsyncQueryHandler;
  private final Spam spam;

  public BlockReportSpamListener(
      Context context,
@@ -48,6 +48,7 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
    mFragmentManager = fragmentManager;
    mAdapter = adapter;
    mFilteredNumberAsyncQueryHandler = filteredNumberAsyncQueryHandler;
    spam = SpamComponent.get(context).spam();
  }

  @Override
@@ -59,18 +60,15 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
      @NonNull final ContactSource.Type contactSourceType) {
    BlockReportSpamDialogs.BlockReportSpamDialogFragment.newInstance(
            displayNumber,
            Spam.get(mContext).isDialogReportSpamCheckedByDefault(),
            new BlockReportSpamDialogs.OnSpamDialogClickListener() {
              @Override
              public void onClick(boolean isSpamChecked) {
            spam.isDialogReportSpamCheckedByDefault(),
            isSpamChecked -> {
              LogUtil.i("BlockReportSpamListener.onBlockReportSpam", "onClick");
                if (isSpamChecked && Spam.get(mContext).isSpamEnabled()) {
              if (isSpamChecked && spam.isSpamEnabled()) {
                Logger.get(mContext)
                    .logImpression(
                        DialerImpression.Type
                            .REPORT_CALL_AS_SPAM_VIA_CALL_LOG_BLOCK_REPORT_SPAM_SENT_VIA_BLOCK_NUMBER_DIALOG);
                  Spam.get(mContext)
                      .reportSpamFromCallHistory(
                spam.reportSpamFromCallHistory(
                    number,
                    countryIso,
                    callType,
@@ -78,17 +76,13 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
                    contactSourceType);
              }
              mFilteredNumberAsyncQueryHandler.blockNumber(
                    new FilteredNumberAsyncQueryHandler.OnBlockNumberListener() {
                      @Override
                      public void onBlockComplete(Uri uri) {
                  uri -> {
                    Logger.get(mContext)
                        .logImpression(DialerImpression.Type.USER_ACTION_BLOCKED_NUMBER);
                    mAdapter.notifyDataSetChanged();
                      }
                  },
                  number,
                  countryIso);
              }
            },
            null)
        .show(mFragmentManager, BlockReportSpamDialogs.BLOCK_REPORT_SPAM_DIALOG_TAG);
@@ -103,18 +97,15 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
      @NonNull final ContactSource.Type contactSourceType) {
    BlockReportSpamDialogs.BlockDialogFragment.newInstance(
            displayNumber,
            Spam.get(mContext).isSpamEnabled(),
            new BlockReportSpamDialogs.OnConfirmListener() {
              @Override
              public void onClick() {
            spam.isSpamEnabled(),
            () -> {
              LogUtil.i("BlockReportSpamListener.onBlock", "onClick");
                if (Spam.get(mContext).isSpamEnabled()) {
              if (spam.isSpamEnabled()) {
                Logger.get(mContext)
                    .logImpression(
                        DialerImpression.Type
                            .DIALOG_ACTION_CONFIRM_NUMBER_SPAM_INDIRECTLY_VIA_BLOCK_NUMBER);
                  Spam.get(mContext)
                      .reportSpamFromCallHistory(
                spam.reportSpamFromCallHistory(
                    number,
                    countryIso,
                    callType,
@@ -122,17 +113,13 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
                    contactSourceType);
              }
              mFilteredNumberAsyncQueryHandler.blockNumber(
                    new FilteredNumberAsyncQueryHandler.OnBlockNumberListener() {
                      @Override
                      public void onBlockComplete(Uri uri) {
                  uri -> {
                    Logger.get(mContext)
                        .logImpression(DialerImpression.Type.USER_ACTION_BLOCKED_NUMBER);
                    mAdapter.notifyDataSetChanged();
                      }
                  },
                  number,
                  countryIso);
              }
            },
            null)
        .show(mFragmentManager, BlockReportSpamDialogs.BLOCK_DIALOG_TAG);
@@ -150,15 +137,12 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
    BlockReportSpamDialogs.UnblockDialogFragment.newInstance(
            displayNumber,
            isSpam,
            new BlockReportSpamDialogs.OnConfirmListener() {
              @Override
              public void onClick() {
            () -> {
              LogUtil.i("BlockReportSpamListener.onUnblock", "onClick");
                if (isSpam && Spam.get(mContext).isSpamEnabled()) {
              if (isSpam && spam.isSpamEnabled()) {
                Logger.get(mContext)
                    .logImpression(DialerImpression.Type.REPORT_AS_NOT_SPAM_VIA_UNBLOCK_NUMBER);
                  Spam.get(mContext)
                      .reportNotSpamFromCallHistory(
                spam.reportNotSpamFromCallHistory(
                    number,
                    countryIso,
                    callType,
@@ -166,16 +150,12 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
                    contactSourceType);
              }
              mFilteredNumberAsyncQueryHandler.unblock(
                    new FilteredNumberAsyncQueryHandler.OnUnblockNumberListener() {
                      @Override
                      public void onUnblockComplete(int rows, ContentValues values) {
                  (rows, values) -> {
                    Logger.get(mContext)
                        .logImpression(DialerImpression.Type.USER_ACTION_UNBLOCKED_NUMBER);
                    mAdapter.notifyDataSetChanged();
                      }
                  },
                  blockId);
              }
            },
            null)
        .show(mFragmentManager, BlockReportSpamDialogs.UNBLOCK_DIALOG_TAG);
@@ -190,15 +170,12 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
      final ContactSource.Type contactSourceType) {
    BlockReportSpamDialogs.ReportNotSpamDialogFragment.newInstance(
            displayNumber,
            new BlockReportSpamDialogs.OnConfirmListener() {
              @Override
              public void onClick() {
            () -> {
              LogUtil.i("BlockReportSpamListener.onReportNotSpam", "onClick");
                if (Spam.get(mContext).isSpamEnabled()) {
              if (spam.isSpamEnabled()) {
                Logger.get(mContext)
                    .logImpression(DialerImpression.Type.DIALOG_ACTION_CONFIRM_NUMBER_NOT_SPAM);
                  Spam.get(mContext)
                      .reportNotSpamFromCallHistory(
                spam.reportNotSpamFromCallHistory(
                    number,
                    countryIso,
                    callType,
@@ -206,7 +183,6 @@ public class BlockReportSpamListener implements CallLogListItemViewHolder.OnClic
                    contactSourceType);
              }
              mAdapter.notifyDataSetChanged();
              }
            },
            null)
        .show(mFragmentManager, BlockReportSpamDialogs.NOT_SPAM_DIALOG_TAG);
+4 −3
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ import com.android.dialer.phonenumbercache.CallLogQuery;
import com.android.dialer.phonenumbercache.ContactInfo;
import com.android.dialer.phonenumbercache.ContactInfoHelper;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
import com.android.dialer.spam.Spam;
import com.android.dialer.spam.SpamComponent;
import com.android.dialer.util.PermissionsUtil;
import java.util.ArrayList;
import java.util.Map;
@@ -667,7 +667,7 @@ public class CallLogAdapter extends GroupingListAdapter
      mContactInfoCache.start();
    }
    mContactsPreferences.refreshValue(ContactsPreferences.DISPLAY_ORDER_KEY);
    mIsSpamEnabled = Spam.get(mActivity).isSpamEnabled();
    mIsSpamEnabled = SpamComponent.get(mActivity).spam().isSpamEnabled();
    getDuo().registerListener(this);
    notifyDataSetChanged();
  }
@@ -862,7 +862,8 @@ public class CallLogAdapter extends GroupingListAdapter
              // Call log cards with only outgoing calls should never be displayed as spam.
              viewHolder.isSpam =
                  details.hasIncomingCalls()
                      && Spam.get(mActivity)
                      && SpamComponent.get(mActivity)
                          .spam()
                          .checkSpamStatusSynchronous(viewHolder.number, viewHolder.countryIso);
              details.isSpam = viewHolder.isSpam;
            }
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.dialer.phonenumbergeoutil.impl.PhoneNumberGeoUtilModule;
import com.android.dialer.precall.impl.PreCallModule;
import com.android.dialer.preferredsim.suggestion.stub.StubSimSuggestionModule;
import com.android.dialer.simulator.impl.SimulatorModule;
import com.android.dialer.spam.StubSpamModule;
import com.android.dialer.storage.StorageModule;
import com.android.dialer.strictmode.impl.SystemStrictModeModule;
import com.android.incallui.calllocation.stub.StubCallLocationModule;
@@ -58,6 +59,7 @@ import javax.inject.Singleton;
    VoicemailModule.class,
    StubSimSuggestionModule.class,
    StubFeedbackModule.class,
    StubSpamModule.class,
  }
)
public interface AospDialerRootComponent extends BaseDialerRootComponent {}
+3 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.dialer.phonenumbergeoutil.PhoneNumberGeoUtilComponent;
import com.android.dialer.precall.PreCallComponent;
import com.android.dialer.preferredsim.suggestion.SimSuggestionComponent;
import com.android.dialer.simulator.SimulatorComponent;
import com.android.dialer.spam.SpamComponent;
import com.android.dialer.storage.StorageComponent;
import com.android.dialer.strictmode.StrictModeComponent;
import com.android.incallui.calllocation.CallLocationComponent;
@@ -57,4 +58,5 @@ public interface BaseDialerRootComponent
        SimulatorComponent.HasComponent,
        StorageComponent.HasComponent,
        StrictModeComponent.HasComponent,
        VoicemailComponent.HasComponent {}
        VoicemailComponent.HasComponent,
        SpamComponent.HasComponent {}
Loading