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

Commit b61c137f authored by calderwoodra's avatar calderwoodra Committed by android-build-merger
Browse files

Merge changes Iae86dabb,I1db81304

am: a109ed80

Change-Id: Idaac7535bce9af699df26c9c81575db491c69ad4
parents 45b779f1 a109ed80
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1453,6 +1453,12 @@ public class DialtactsActivity extends TransactionSafeActivity
    return false;
  }

  @Override
  public boolean shouldShowDialpadChooser() {
    // Show the dialpad chooser if we're in a call
    return true;
  }

  @Override
  public void onSearchListTouch() {
    if (isDialpadShown) {
+15 −15
Original line number Diff line number Diff line
@@ -222,18 +222,6 @@ public class CallLogFragment extends Fragment
    final Activity activity = getActivity();
    final ContentResolver resolver = activity.getContentResolver();
    callLogQueryHandler = new CallLogQueryHandler(activity, resolver, this, logLimit);

    if (PermissionsUtil.hasCallLogReadPermissions(getContext())) {
      resolver.registerContentObserver(CallLog.CONTENT_URI, true, callLogObserver);
    } else {
      LogUtil.w("CallLogFragment.onCreate", "call log permission not available");
    }
    if (PermissionsUtil.hasContactsReadPermissions(getContext())) {
      resolver.registerContentObserver(
          ContactsContract.Contacts.CONTENT_URI, true, contactsObserver);
    } else {
      LogUtil.w("CallLogFragment.onCreate", "contacts permission not available.");
    }
    setHasOptionsMenu(true);
  }

@@ -412,6 +400,19 @@ public class CallLogFragment extends Fragment
      updateEmptyMessage(callTypeFilter);
    }

    ContentResolver resolver = getActivity().getContentResolver();
    if (PermissionsUtil.hasCallLogReadPermissions(getContext())) {
      resolver.registerContentObserver(CallLog.CONTENT_URI, true, callLogObserver);
    } else {
      LogUtil.w("CallLogFragment.onCreate", "call log permission not available");
    }
    if (PermissionsUtil.hasContactsReadPermissions(getContext())) {
      resolver.registerContentObserver(
          ContactsContract.Contacts.CONTENT_URI, true, contactsObserver);
    } else {
      LogUtil.w("CallLogFragment.onCreate", "contacts permission not available.");
    }

    this.hasReadCallLogPermission = hasReadCallLogPermission;

    /*
@@ -432,6 +433,8 @@ public class CallLogFragment extends Fragment
  @Override
  public void onPause() {
    LogUtil.enterBlock("CallLogFragment.onPause");
    getActivity().getContentResolver().unregisterContentObserver(callLogObserver);
    getActivity().getContentResolver().unregisterContentObserver(contactsObserver);
    if (getUserVisibleHint()) {
      onNotVisible();
    }
@@ -465,9 +468,6 @@ public class CallLogFragment extends Fragment
    if (adapter != null) {
      adapter.changeCursor(null);
    }

    getActivity().getContentResolver().unregisterContentObserver(callLogObserver);
    getActivity().getContentResolver().unregisterContentObserver(contactsObserver);
    super.onDestroy();
  }

+2 −3
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import com.android.dialer.blockreportspam.BlockReportSpamDialogs.OnConfirmListen
import com.android.dialer.blockreportspam.BlockReportSpamDialogs.OnSpamDialogClickListener;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.logging.ContactSource;
import com.android.dialer.logging.DialerImpression;
import com.android.dialer.logging.Logger;
import com.android.dialer.protos.ProtoParsers;
@@ -109,7 +108,7 @@ public final class ShowBlockReportSpamDialogReceiver extends BroadcastReceiver {
                dialogInfo.getCountryIso(),
                dialogInfo.getCallType(),
                dialogInfo.getReportingLocation(),
                ContactSource.Type.UNKNOWN_SOURCE_TYPE /* TODO(a bug): Fix. */);
                dialogInfo.getContactSource());
          }

          // TODO(a bug): Block the number.
@@ -154,7 +153,7 @@ public final class ShowBlockReportSpamDialogReceiver extends BroadcastReceiver {
                dialogInfo.getCountryIso(),
                dialogInfo.getCallType(),
                dialogInfo.getReportingLocation(),
                ContactSource.Type.UNKNOWN_SOURCE_TYPE /* TODO(a bug): Fix. */);
                dialogInfo.getContactSource());
          }
        };

+5 −1
Original line number Diff line number Diff line
@@ -7,11 +7,12 @@ option optimize_for = LITE_RUNTIME;

package com.android.dialer.blockreportspam;

import "java/com/android/dialer/logging/contact_source.proto";
import "java/com/android/dialer/logging/reporting_location.proto";

// Contains information needed in dialogs that allow a user to block a number
// and/or report it as spam/not spam.
// Next ID: 5
// Next ID: 6
message BlockReportSpamDialogInfo {
  // A dialer-normalized version of the number used in the dialogs.
  // See DialerPhoneNumber#normalized_number.
@@ -27,4 +28,7 @@ message BlockReportSpamDialogInfo {
  // The location where the number is reported.
  optional com.android.dialer.logging.ReportingLocation.Type
      reporting_location = 4;

  // The source where contact info is associated with the number.
  optional com.android.dialer.logging.ContactSource.Type contact_source = 5;
}
 No newline at end of file
+6 −1
Original line number Diff line number Diff line
@@ -21,8 +21,10 @@ option optimize_for = LITE_RUNTIME;

package com.android.dialer;

import "java/com/android/dialer/logging/contact_source.proto";

// Information related to the phone number of the call.
// Next ID: 12
// Next ID: 13
message NumberAttributes {
  // The name (which may be a person's name or business name, but not a number)
  // formatted exactly as it should appear to the user. If the user's locale or
@@ -65,4 +67,7 @@ message NumberAttributes {

  // Whether the number is spam.
  optional bool is_spam = 11;

  // Source of the contact associated with the number.
  optional com.android.dialer.logging.ContactSource.Type contact_source = 12;
}
 No newline at end of file
Loading