diff options
author | Eric Erfanian <erfanian@google.com> | 2017-08-31 06:57:16 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-31 16:13:53 +0000 |
commit | 2ca4318cc1ee57dda907ba2069bd61d162b1baef (patch) | |
tree | e282668a9587cf6c1ec7b604dea860400c75c6c7 /java/com/android/dialer/blocking/FilteredNumbersUtil.java | |
parent | 68038172793ee0e2ab3e2e56ddfbeb82879d1f58 (diff) |
Update Dialer source to latest internal Google revision.
Previously, Android's Dialer app was developed in an internal Google
source control system and only exported to public during AOSP drops.
The Dialer team is now switching to a public development model similar
to the telephony team.
This CL represents all internal Google changes that were committed to
Dialer between the public O release and today's tip of tree on internal
master. This CL squashes those changes into a single commit.
In subsequent changes, changes will be exported on a per-commit basis.
Test: make, flash install, run
Merged-In: I45270eaa8ce732d71a1bd84b08c7fa0e99af3160
Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8
PiperOrigin-RevId: 167068436
Diffstat (limited to 'java/com/android/dialer/blocking/FilteredNumbersUtil.java')
-rw-r--r-- | java/com/android/dialer/blocking/FilteredNumbersUtil.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/java/com/android/dialer/blocking/FilteredNumbersUtil.java b/java/com/android/dialer/blocking/FilteredNumbersUtil.java index cdcf1f78d..fba3b86db 100644 --- a/java/com/android/dialer/blocking/FilteredNumbersUtil.java +++ b/java/com/android/dialer/blocking/FilteredNumbersUtil.java @@ -16,7 +16,6 @@ package com.android.dialer.blocking; import android.app.Notification; -import android.app.NotificationManager; import android.app.PendingIntent; import android.content.ContentValues; import android.content.Context; @@ -27,6 +26,7 @@ import android.provider.ContactsContract.Contacts; import android.provider.Settings; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; +import android.support.v4.os.BuildCompat; import android.support.v4.os.UserManagerCompat; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; @@ -35,8 +35,8 @@ import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler.OnHasBlockedN import com.android.dialer.common.LogUtil; import com.android.dialer.logging.InteractionEvent; import com.android.dialer.logging.Logger; -import com.android.dialer.notification.NotificationChannelManager; -import com.android.dialer.notification.NotificationChannelManager.Channel; +import com.android.dialer.notification.DialerNotificationManager; +import com.android.dialer.notification.NotificationChannelId; import com.android.dialer.util.DialerUtils; import com.android.dialer.util.PermissionsUtil; import java.util.concurrent.TimeUnit; @@ -45,8 +45,7 @@ import java.util.concurrent.TimeUnit; public class FilteredNumbersUtil { public static final String CALL_BLOCKING_NOTIFICATION_TAG = "call_blocking"; - public static final int CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_NOTIFICATION_ID = - R.id.notification_call_blocking_disabled_by_emergency_call; + public static final int CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_NOTIFICATION_ID = 10; // Pref key for storing the time of end of the last emergency call in milliseconds after epoch.\ @VisibleForTesting public static final String LAST_EMERGENCY_CALL_MS_PREF_KEY = "last_emergency_call_ms"; @@ -243,8 +242,6 @@ public class FilteredNumbersUtil { return; } - NotificationManager notificationManager = - (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); Notification.Builder builder = new Notification.Builder(context) .setSmallIcon(R.drawable.quantum_ic_block_white_24) @@ -254,7 +251,9 @@ public class FilteredNumbersUtil { context.getString(R.string.call_blocking_disabled_notification_text)) .setAutoCancel(true); - NotificationChannelManager.applyChannel(builder, context, Channel.DEFAULT, null); + if (BuildCompat.isAtLeastO()) { + builder.setChannelId(NotificationChannelId.DEFAULT); + } builder.setContentIntent( PendingIntent.getActivity( context, @@ -262,7 +261,8 @@ public class FilteredNumbersUtil { FilteredNumberCompat.createManageBlockedNumbersIntent(context), PendingIntent.FLAG_UPDATE_CURRENT)); - notificationManager.notify( + DialerNotificationManager.notify( + context, CALL_BLOCKING_NOTIFICATION_TAG, CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_NOTIFICATION_ID, builder.build()); |