From 2ca4318cc1ee57dda907ba2069bd61d162b1baef Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Thu, 31 Aug 2017 06:57:16 -0700 Subject: 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 --- .../dialer/notification/AndroidManifest.xml | 16 +- .../notification/DialerNotificationManager.java | 125 ++++++ .../notification/GroupedNotificationUtil.java | 66 --- .../dialer/notification/NotificationChannelId.java | 41 ++ .../notification/NotificationChannelManager.java | 456 ++++++--------------- .../notification/NotificationManagerUtils.java | 41 ++ .../dialer/notification/NotificationThrottler.java | 126 ++++++ .../notification/PackageUpdatedReceiver.java | 37 -- .../dialer/notification/VoicemailChannelUtils.java | 217 ++++++++++ .../dialer/notification/res/values-af/strings.xml | 1 - .../dialer/notification/res/values-am/strings.xml | 1 - .../dialer/notification/res/values-ar/strings.xml | 1 - .../dialer/notification/res/values-az/strings.xml | 1 - .../notification/res/values-b+sr+Latn/strings.xml | 1 - .../dialer/notification/res/values-be/strings.xml | 1 - .../dialer/notification/res/values-bg/strings.xml | 1 - .../dialer/notification/res/values-bn/strings.xml | 1 - .../dialer/notification/res/values-bs/strings.xml | 1 - .../dialer/notification/res/values-ca/strings.xml | 1 - .../dialer/notification/res/values-cs/strings.xml | 1 - .../dialer/notification/res/values-da/strings.xml | 1 - .../dialer/notification/res/values-de/strings.xml | 1 - .../dialer/notification/res/values-el/strings.xml | 1 - .../notification/res/values-en-rAU/strings.xml | 1 - .../notification/res/values-en-rGB/strings.xml | 1 - .../notification/res/values-en-rIN/strings.xml | 1 - .../notification/res/values-es-rUS/strings.xml | 1 - .../dialer/notification/res/values-es/strings.xml | 1 - .../dialer/notification/res/values-et/strings.xml | 1 - .../dialer/notification/res/values-eu/strings.xml | 1 - .../dialer/notification/res/values-fa/strings.xml | 1 - .../dialer/notification/res/values-fi/strings.xml | 1 - .../notification/res/values-fr-rCA/strings.xml | 1 - .../dialer/notification/res/values-fr/strings.xml | 1 - .../dialer/notification/res/values-gl/strings.xml | 1 - .../dialer/notification/res/values-gu/strings.xml | 1 - .../dialer/notification/res/values-hi/strings.xml | 1 - .../dialer/notification/res/values-hr/strings.xml | 1 - .../dialer/notification/res/values-hu/strings.xml | 1 - .../dialer/notification/res/values-hy/strings.xml | 1 - .../dialer/notification/res/values-in/strings.xml | 1 - .../dialer/notification/res/values-is/strings.xml | 1 - .../dialer/notification/res/values-it/strings.xml | 1 - .../dialer/notification/res/values-iw/strings.xml | 1 - .../dialer/notification/res/values-ja/strings.xml | 1 - .../dialer/notification/res/values-ka/strings.xml | 1 - .../dialer/notification/res/values-kk/strings.xml | 1 - .../dialer/notification/res/values-km/strings.xml | 1 - .../dialer/notification/res/values-kn/strings.xml | 1 - .../dialer/notification/res/values-ko/strings.xml | 1 - .../dialer/notification/res/values-ky/strings.xml | 1 - .../dialer/notification/res/values-lo/strings.xml | 1 - .../dialer/notification/res/values-lt/strings.xml | 1 - .../dialer/notification/res/values-lv/strings.xml | 1 - .../dialer/notification/res/values-mk/strings.xml | 1 - .../dialer/notification/res/values-ml/strings.xml | 1 - .../dialer/notification/res/values-mn/strings.xml | 1 - .../dialer/notification/res/values-mr/strings.xml | 1 - .../dialer/notification/res/values-ms/strings.xml | 1 - .../dialer/notification/res/values-my/strings.xml | 1 - .../dialer/notification/res/values-nb/strings.xml | 1 - .../dialer/notification/res/values-ne/strings.xml | 1 - .../dialer/notification/res/values-nl/strings.xml | 1 - .../dialer/notification/res/values-no/strings.xml | 1 - .../dialer/notification/res/values-pa/strings.xml | 1 - .../dialer/notification/res/values-pl/strings.xml | 1 - .../notification/res/values-pt-rBR/strings.xml | 1 - .../notification/res/values-pt-rPT/strings.xml | 1 - .../dialer/notification/res/values-pt/strings.xml | 1 - .../dialer/notification/res/values-ro/strings.xml | 1 - .../dialer/notification/res/values-ru/strings.xml | 1 - .../dialer/notification/res/values-si/strings.xml | 1 - .../dialer/notification/res/values-sk/strings.xml | 1 - .../dialer/notification/res/values-sl/strings.xml | 1 - .../dialer/notification/res/values-sq/strings.xml | 1 - .../dialer/notification/res/values-sr/strings.xml | 1 - .../dialer/notification/res/values-sv/strings.xml | 1 - .../dialer/notification/res/values-sw/strings.xml | 1 - .../dialer/notification/res/values-ta/strings.xml | 1 - .../dialer/notification/res/values-te/strings.xml | 1 - .../dialer/notification/res/values-th/strings.xml | 1 - .../dialer/notification/res/values-tl/strings.xml | 1 - .../dialer/notification/res/values-tr/strings.xml | 1 - .../dialer/notification/res/values-uk/strings.xml | 1 - .../dialer/notification/res/values-ur/strings.xml | 1 - .../dialer/notification/res/values-uz/strings.xml | 1 - .../dialer/notification/res/values-vi/strings.xml | 1 - .../notification/res/values-zh-rCN/strings.xml | 1 - .../notification/res/values-zh-rHK/strings.xml | 1 - .../notification/res/values-zh-rTW/strings.xml | 1 - .../dialer/notification/res/values-zu/strings.xml | 1 - .../android/dialer/notification/res/values/ids.xml | 27 -- .../dialer/notification/res/values/strings.xml | 1 - 93 files changed, 675 insertions(+), 560 deletions(-) create mode 100644 java/com/android/dialer/notification/DialerNotificationManager.java delete mode 100644 java/com/android/dialer/notification/GroupedNotificationUtil.java create mode 100644 java/com/android/dialer/notification/NotificationChannelId.java create mode 100644 java/com/android/dialer/notification/NotificationManagerUtils.java create mode 100644 java/com/android/dialer/notification/NotificationThrottler.java delete mode 100644 java/com/android/dialer/notification/PackageUpdatedReceiver.java create mode 100644 java/com/android/dialer/notification/VoicemailChannelUtils.java delete mode 100644 java/com/android/dialer/notification/res/values/ids.xml (limited to 'java/com/android/dialer/notification') diff --git a/java/com/android/dialer/notification/AndroidManifest.xml b/java/com/android/dialer/notification/AndroidManifest.xml index 741f481ca..b89d8f816 100644 --- a/java/com/android/dialer/notification/AndroidManifest.xml +++ b/java/com/android/dialer/notification/AndroidManifest.xml @@ -1,3 +1,4 @@ + - - - - - - - - - - - - diff --git a/java/com/android/dialer/notification/DialerNotificationManager.java b/java/com/android/dialer/notification/DialerNotificationManager.java new file mode 100644 index 000000000..0e3420169 --- /dev/null +++ b/java/com/android/dialer/notification/DialerNotificationManager.java @@ -0,0 +1,125 @@ +/* + * 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 + */ + +package com.android.dialer.notification; + +import android.app.Notification; +import android.app.NotificationManager; +import android.content.Context; +import android.service.notification.StatusBarNotification; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.v4.os.BuildCompat; +import android.text.TextUtils; +import android.util.Pair; +import com.android.dialer.common.Assert; +import com.android.dialer.common.LogUtil; + +/** + * Wrapper around the notification manager APIs. The wrapper ensures that channels are set and that + * notifications are limited to 10 per group. + */ +public final class DialerNotificationManager { + public static void notify(@NonNull Context context, int id, @NonNull Notification notification) { + Assert.isNotNull(context); + Assert.isNotNull(notification); + throw Assert.createUnsupportedOperationFailException("all notifications must have tags"); + } + + public static void notify( + @NonNull Context context, @NonNull String tag, int id, @NonNull Notification notification) { + Assert.isNotNull(context); + Assert.isNotNull(notification); + Assert.checkArgument(!TextUtils.isEmpty(tag)); + + if (BuildCompat.isAtLeastO()) { + Assert.checkArgument(!TextUtils.isEmpty(notification.getChannelId())); + } + + getNotificationManager(context).notify(tag, id, notification); + NotificationThrottler.throttle(context, notification); + } + + public static void cancel(@NonNull Context context, int id) { + Assert.isNotNull(context); + throw Assert.createUnsupportedOperationFailException( + "notification IDs are not unique across the app, a tag must be specified"); + } + + public static void cancel(@NonNull Context context, @NonNull String tag, int id) { + Assert.isNotNull(context); + Assert.checkArgument(!TextUtils.isEmpty(tag)); + + NotificationManager notificationManager = getNotificationManager(context); + StatusBarNotification[] notifications = notificationManager.getActiveNotifications(); + + String groupKey = findGroupKey(notifications, tag, id); + if (!TextUtils.isEmpty(groupKey)) { + Pair groupSummaryAndCount = + getGroupSummaryAndCount(notifications, groupKey); + if (groupSummaryAndCount.first != null && groupSummaryAndCount.second <= 1) { + LogUtil.i( + "DialerNotificationManager.cancel", + "last notification in group (%s) removed, also removing group summary", + groupKey); + notificationManager.cancel( + groupSummaryAndCount.first.getTag(), groupSummaryAndCount.first.getId()); + } + } + + notificationManager.cancel(tag, id); + } + + public static StatusBarNotification[] getActiveNotifications(@NonNull Context context) { + Assert.isNotNull(context); + return getNotificationManager(context).getActiveNotifications(); + } + + @Nullable + private static String findGroupKey( + @NonNull StatusBarNotification[] notifications, @NonNull String tag, int id) { + for (StatusBarNotification notification : notifications) { + if (TextUtils.equals(tag, notification.getTag()) && id == notification.getId()) { + return notification.getNotification().getGroup(); + } + } + return null; + } + + @NonNull + private static Pair getGroupSummaryAndCount( + @NonNull StatusBarNotification[] notifications, @NonNull String groupKey) { + StatusBarNotification groupSummaryNotification = null; + int groupCount = 0; + for (StatusBarNotification notification : notifications) { + if (TextUtils.equals(groupKey, notification.getNotification().getGroup())) { + if ((notification.getNotification().flags & Notification.FLAG_GROUP_SUMMARY) != 0) { + groupSummaryNotification = notification; + } else { + groupCount++; + } + } + } + return new Pair<>(groupSummaryNotification, groupCount); + } + + @NonNull + private static NotificationManager getNotificationManager(@NonNull Context context) { + return context.getSystemService(NotificationManager.class); + } + + private DialerNotificationManager() {} +} diff --git a/java/com/android/dialer/notification/GroupedNotificationUtil.java b/java/com/android/dialer/notification/GroupedNotificationUtil.java deleted file mode 100644 index 3925248d5..000000000 --- a/java/com/android/dialer/notification/GroupedNotificationUtil.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 - */ - -package com.android.dialer.notification; - -import android.app.NotificationManager; -import android.service.notification.StatusBarNotification; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import java.util.Objects; - -/** Utilities for dealing with grouped notifications */ -public final class GroupedNotificationUtil { - - /** - * Remove notification(s) that were added as part of a group. Will ensure that if this is the last - * notification in the group the summary will be removed. - * - * @param tag String tag as included in {@link NotificationManager#notify(String, int, - * android.app.Notification)}. If null will remove all notifications under id - * @param id notification id as included with {@link NotificationManager#notify(String, int, - * android.app.Notification)}. - * @param summaryTag String tag of the summary notification - */ - public static void removeNotification( - @NonNull NotificationManager notificationManager, - @Nullable String tag, - int id, - @NonNull String summaryTag) { - if (tag == null) { - // Clear all grouped notifications - for (StatusBarNotification notification : notificationManager.getActiveNotifications()) { - if (notification.getId() == id) { - notificationManager.cancel(notification.getTag(), id); - } - } - } else { - notificationManager.cancel(tag, id); - - // See if other non-summary grouped notifications exist, and if not then clear the summary - boolean clearSummary = true; - for (StatusBarNotification notification : notificationManager.getActiveNotifications()) { - if (notification.getId() == id && !Objects.equals(summaryTag, notification.getTag())) { - clearSummary = false; - break; - } - } - if (clearSummary) { - notificationManager.cancel(summaryTag, id); - } - } - } -} diff --git a/java/com/android/dialer/notification/NotificationChannelId.java b/java/com/android/dialer/notification/NotificationChannelId.java new file mode 100644 index 000000000..4ab3d44f2 --- /dev/null +++ b/java/com/android/dialer/notification/NotificationChannelId.java @@ -0,0 +1,41 @@ +/* + * 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 + */ + +package com.android.dialer.notification; + +import android.support.annotation.StringDef; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** Centralized source of all notification channels used by Dialer. */ +@Retention(RetentionPolicy.SOURCE) +@StringDef({ + NotificationChannelId.INCOMING_CALL, + NotificationChannelId.ONGOING_CALL, + NotificationChannelId.MISSED_CALL, + NotificationChannelId.DEFAULT, +}) +public @interface NotificationChannelId { + // This value is white listed in the system. + // See /vendor/google/nexus_overlay/common/frameworks/base/core/res/res/values/config.xml + String INCOMING_CALL = "phone_incoming_call"; + + String ONGOING_CALL = "phone_ongoing_call"; + + String MISSED_CALL = "phone_missed_call"; + + String DEFAULT = "phone_default"; +} diff --git a/java/com/android/dialer/notification/NotificationChannelManager.java b/java/com/android/dialer/notification/NotificationChannelManager.java index 88679066d..790aac36f 100644 --- a/java/com/android/dialer/notification/NotificationChannelManager.java +++ b/java/com/android/dialer/notification/NotificationChannelManager.java @@ -17,366 +17,156 @@ package com.android.dialer.notification; import android.annotation.TargetApi; -import android.app.Notification; import android.app.NotificationChannel; -import android.app.NotificationChannelGroup; import android.app.NotificationManager; import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; import android.media.AudioAttributes; -import android.net.Uri; import android.os.Build.VERSION_CODES; -import android.provider.Settings; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; -import android.support.annotation.StringDef; import android.support.v4.os.BuildCompat; -import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; -import android.telecom.TelecomManager; -import android.telephony.TelephonyManager; -import com.android.contacts.common.compat.TelephonyManagerCompat; -import com.android.dialer.buildtype.BuildType; +import android.util.ArraySet; +import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; -import com.android.dialer.common.concurrent.DialerExecutors; -import com.android.dialer.telecom.TelecomUtil; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.util.List; -import java.util.Objects; +import java.util.Set; -/** Contains info on how to create {@link NotificationChannel NotificationChannels} */ -public class NotificationChannelManager { - - private static final String PREFS_FILENAME = "NotificationChannelManager"; - private static final String PREF_NEED_FIRST_INIT = "needFirstInit"; - private static NotificationChannelManager instance; - - public static NotificationChannelManager getInstance() { - if (instance == null) { - instance = new NotificationChannelManager(); - } - return instance; - } +/** Creates all notification channels for Dialer. */ +@TargetApi(VERSION_CODES.O) +public final class NotificationChannelManager { /** - * Set the channel of notification appropriately. Will create the channel if it does not already - * exist. Safe to call pre-O (will no-op). + * Creates all the notification channels Dialer will need. This method is called at app startup + * and must be fast. Currently it takes between 3 to 7 milliseconds on a Pixel XL. + * + *

An alternative approach would be to lazily create channels when we actualy post a + * notification. The advatange to precreating channels is that: * - *

phoneAccount should only be null if channelName is {@link Channel#DEFAULT} or {@link - * Channel#MISSED_CALL} since these do not have account-specific settings. + *

    + *
  • channels will be available to user right away. For example, users can customize voicemail + * sounds when they first get their device without waiting for a voicemail to arrive first. + *
  • code that posts a notification can be simpler + *
  • channel management code is simpler and it's easier to ensure that the correct set of + * channels are visible. + *
      */ - @TargetApi(26) - public static void applyChannel( - @NonNull Notification.Builder notification, - @NonNull Context context, - @Channel String channelName, - @Nullable PhoneAccountHandle phoneAccount) { - checkNullity(channelName, phoneAccount); - - if (BuildCompat.isAtLeastO()) { - NotificationChannel channel = - NotificationChannelManager.getInstance().getChannel(context, channelName, phoneAccount); - notification.setChannelId(channel.getId()); - } - } - - private static void checkNullity( - @Channel String channelName, @Nullable PhoneAccountHandle phoneAccount) { - if (phoneAccount != null || channelAllowsNullPhoneAccountHandle(channelName)) { - return; - } - - // TODO (b/36568553): don't throw an exception once most cases have been identified - IllegalArgumentException exception = - new IllegalArgumentException( - "Phone account handle must not be null on channel " + channelName); - if (BuildType.get() == BuildType.RELEASE) { - LogUtil.e("NotificationChannelManager.applyChannel", null, exception); - } else { - throw exception; - } - } - - private static boolean channelAllowsNullPhoneAccountHandle(@Channel String channelName) { - switch (channelName) { - case Channel.DEFAULT: - case Channel.MISSED_CALL: - return true; - default: - return false; - } - } + public static void initChannels(@NonNull Context context) { + Assert.checkArgument(BuildCompat.isAtLeastO()); + Assert.isNotNull(context); - /** The base Channel IDs for {@link NotificationChannel} */ - @Retention(RetentionPolicy.SOURCE) - @StringDef({ - Channel.INCOMING_CALL, - Channel.ONGOING_CALL, - Channel.ONGOING_CALL_OLD, - Channel.MISSED_CALL, - Channel.VOICEMAIL, - Channel.EXTERNAL_CALL, - Channel.DEFAULT - }) - public @interface Channel { - @Deprecated String ONGOING_CALL_OLD = "ongoingCall"; - String INCOMING_CALL = "incomingCall"; - String ONGOING_CALL = "ongoingCall2"; - String MISSED_CALL = "missedCall"; - String VOICEMAIL = "voicemail"; - String EXTERNAL_CALL = "externalCall"; - String DEFAULT = "default"; - } - - @Channel - private static final String[] prepopulatedAccountChannels = - new String[] {Channel.INCOMING_CALL, Channel.ONGOING_CALL, Channel.VOICEMAIL}; - - @Channel - private static final String[] prepopulatedGlobalChannels = - new String[] {Channel.MISSED_CALL, Channel.DEFAULT}; - - private NotificationChannelManager() {} - - public void firstInitIfNeeded(@NonNull Context context) { - if (BuildCompat.isAtLeastO()) { - DialerExecutors.createNonUiTaskBuilder(this::firstInitIfNeededSync) - .build() - .executeSerial(context); - } - } - - private boolean firstInitIfNeededSync(@NonNull Context context) { - if (needsFirstInit(context)) { - initChannels(context); - return true; - } - return false; - } - - public boolean needsFirstInit(@NonNull Context context) { - return (BuildCompat.isAtLeastO() - && getSharedPreferences(context).getBoolean(PREF_NEED_FIRST_INIT, true)); - } - - @RequiresApi(VERSION_CODES.N) - private SharedPreferences getSharedPreferences(@NonNull Context context) { - // Use device protected storage since in some cases this will need to be accessed while device - // is locked - context = context.createDeviceProtectedStorageContext(); - return context.getSharedPreferences(PREFS_FILENAME, Context.MODE_PRIVATE); - } - - @RequiresApi(26) - public Intent getSettingsIntentForChannel( - @NonNull Context context, @Channel String channelName, PhoneAccountHandle accountHandle) { - checkNullity(channelName, accountHandle); - Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS); - intent.putExtra( - Settings.EXTRA_CHANNEL_ID, getChannel(context, channelName, accountHandle).getId()); - intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName()); - return intent; - } + NotificationManager notificationManager = context.getSystemService(NotificationManager.class); + Set desiredChannelIds = getAllDesiredChannelIds(context); + Set existingChannelIds = getAllExistingChannelIds(context); - @TargetApi(26) - @SuppressWarnings("AndroidApiChecker") - public void initChannels(@NonNull Context context) { - if (!BuildCompat.isAtLeastO()) { + if (desiredChannelIds.equals(existingChannelIds)) { return; } - LogUtil.enterBlock("NotificationChannelManager.initChannels"); - List phoneAccounts = TelecomUtil.getCallCapablePhoneAccounts(context); - - // Remove notification channels for PhoneAccounts that don't exist anymore - NotificationManager notificationManager = context.getSystemService(NotificationManager.class); - List notificationChannelGroups = - notificationManager.getNotificationChannelGroups(); - notificationChannelGroups - .stream() - .filter(group -> !idExists(group.getId(), phoneAccounts)) - .forEach(group -> deleteGroup(notificationManager, group)); - - for (PhoneAccountHandle phoneAccountHandle : phoneAccounts) { - for (@Channel String channel : prepopulatedAccountChannels) { - getChannel(context, channel, phoneAccountHandle); + LogUtil.i( + "NotificationChannelManager.initChannels", + "doing an expensive initialization of all notification channels"); + LogUtil.i( + "NotificationChannelManager.initChannels", "desired channel IDs: " + desiredChannelIds); + LogUtil.i( + "NotificationChannelManager.initChannels", "existing channel IDs: " + existingChannelIds); + + // Delete any old channels that we don't use any more. This is safe because if we're recreate + // this later then any user settings will be restored. An example is SIM specific voicemail + // channel that gets deleted when the user removes the SIM and is then restored when the user + // re-inserts the SIM. + for (String existingChannelId : existingChannelIds) { + if (!desiredChannelIds.contains(existingChannelId)) { + notificationManager.deleteNotificationChannel(existingChannelId); } } - for (@Channel String channel : prepopulatedGlobalChannels) { - getChannel(context, channel, null); - } - getSharedPreferences(context).edit().putBoolean(PREF_NEED_FIRST_INIT, false).apply(); - } - - @TargetApi(26) - private void deleteGroup( - @NonNull NotificationManager notificationManager, @NonNull NotificationChannelGroup group) { - for (NotificationChannel channel : group.getChannels()) { - notificationManager.deleteNotificationChannel(channel.getId()); - } - notificationManager.deleteNotificationChannelGroup(group.getId()); - } - - private boolean idExists(String id, List phoneAccountHandles) { - for (PhoneAccountHandle handle : phoneAccountHandles) { - if (Objects.equals(handle.getId(), id)) { - return true; - } - } - return false; + // Just recreate all desired channels. We won't do this often so it's ok to do this now. + createIncomingCallChannel(context); + createOngoingCallChannel(context); + createMissedCallChannel(context); + createDefaultChannel(context); + VoicemailChannelUtils.createAllChannels(context); } @NonNull - @RequiresApi(26) - private NotificationChannel getChannel( - @NonNull Context context, - @Channel String channelName, - @Nullable PhoneAccountHandle phoneAccount) { - String channelId = channelNameToId(channelName, phoneAccount); - NotificationChannel channel = getNotificationManager(context).getNotificationChannel(channelId); - if (channel == null) { - channel = createChannel(context, channelName, phoneAccount); - } - return channel; + public static String getVoicemailChannelId( + @NonNull Context context, @Nullable PhoneAccountHandle handle) { + Assert.checkArgument(BuildCompat.isAtLeastO()); + Assert.isNotNull(context); + return VoicemailChannelUtils.getChannelId(context, handle); } - private static String channelNameToId( - @Channel String name, @Nullable PhoneAccountHandle phoneAccountHandle) { - if (phoneAccountHandle == null) { - return name; - } else { - return name + ":" + phoneAccountHandle.getId(); - } - } - - @RequiresApi(26) - private NotificationChannel createChannel( - Context context, - @Channel String channelName, - @Nullable PhoneAccountHandle phoneAccountHandle) { - String channelId = channelNameToId(channelName, phoneAccountHandle); - - if (phoneAccountHandle != null) { - PhoneAccount account = getTelecomManager(context).getPhoneAccount(phoneAccountHandle); - NotificationChannelGroup group = - new NotificationChannelGroup( - phoneAccountHandle.getId(), - (account == null) ? phoneAccountHandle.getId() : account.getLabel().toString()); - getNotificationManager(context) - .createNotificationChannelGroup(group); // No-op if already exists - } else if (!channelAllowsNullPhoneAccountHandle(channelName)) { - LogUtil.w( - "NotificationChannelManager.createChannel", - "Null PhoneAccountHandle with channel " + channelName); - } - - Uri silentRingtone = Uri.EMPTY; - - CharSequence name; - int importance; - boolean canShowBadge; - boolean lights; - boolean vibration; - Uri sound; - switch (channelName) { - case Channel.INCOMING_CALL: - name = context.getText(R.string.notification_channel_incoming_call); - importance = NotificationManager.IMPORTANCE_MAX; - canShowBadge = false; - lights = true; - vibration = false; - sound = silentRingtone; - break; - case Channel.MISSED_CALL: - name = context.getText(R.string.notification_channel_missed_call); - importance = NotificationManager.IMPORTANCE_DEFAULT; - canShowBadge = true; - lights = true; - vibration = true; - sound = silentRingtone; - break; - case Channel.ONGOING_CALL: - name = context.getText(R.string.notification_channel_ongoing_call); - importance = NotificationManager.IMPORTANCE_DEFAULT; - canShowBadge = false; - lights = false; - vibration = false; - sound = silentRingtone; - deleteOldOngoingCallChannelIfNeeded(context, phoneAccountHandle); - break; - case Channel.VOICEMAIL: - name = context.getText(R.string.notification_channel_voicemail); - importance = NotificationManager.IMPORTANCE_DEFAULT; - canShowBadge = true; - lights = true; - vibration = - TelephonyManagerCompat.isVoicemailVibrationEnabled( - getTelephonyManager(context), phoneAccountHandle); - sound = - TelephonyManagerCompat.getVoicemailRingtoneUri( - getTelephonyManager(context), phoneAccountHandle); - break; - case Channel.EXTERNAL_CALL: - name = context.getText(R.string.notification_channel_external_call); - importance = NotificationManager.IMPORTANCE_HIGH; - canShowBadge = false; - lights = true; - vibration = true; - sound = null; - break; - case Channel.DEFAULT: - name = context.getText(R.string.notification_channel_misc); - importance = NotificationManager.IMPORTANCE_DEFAULT; - canShowBadge = false; - lights = true; - vibration = true; - sound = null; - break; - default: - throw new IllegalArgumentException("Unknown channel: " + channelName); - } - - NotificationChannel channel = new NotificationChannel(channelId, name, importance); - channel.setShowBadge(canShowBadge); - if (sound != null) { - // silentRingtone acts as a sentinel value to indicate that setSound should still be called, - // but with a null value to indicate no sound. - channel.setSound( - sound.equals(silentRingtone) ? null : sound, - new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build()); - } - channel.enableLights(lights); - channel.enableVibration(vibration); - getNotificationManager(context).createNotificationChannel(channel); - return channel; - } - - @RequiresApi(26) - private void deleteOldOngoingCallChannelIfNeeded( - @NonNull Context context, PhoneAccountHandle phoneAccountHandle) { - String channelId = channelNameToId(Channel.ONGOING_CALL_OLD, phoneAccountHandle); - NotificationManager notificationManager = getNotificationManager(context); - NotificationChannel channel = notificationManager.getNotificationChannel(channelId); - if (channel != null) { - LogUtil.i( - "NotificationManager.deleteOldOngoingCallChannelIfNeeded", - "Old ongoing channel found. Deleting to create new channel"); - notificationManager.deleteNotificationChannel(channel.getId()); - } - } - - private static NotificationManager getNotificationManager(@NonNull Context context) { - return context.getSystemService(NotificationManager.class); - } - - private static TelephonyManager getTelephonyManager(@NonNull Context context) { - return context.getSystemService(TelephonyManager.class); + private static Set getAllExistingChannelIds(@NonNull Context context) { + Set result = new ArraySet<>(); + NotificationManager notificationManager = context.getSystemService(NotificationManager.class); + for (NotificationChannel channel : notificationManager.getNotificationChannels()) { + result.add(channel.getId()); + } + return result; + } + + private static Set getAllDesiredChannelIds(@NonNull Context context) { + Set result = new ArraySet<>(); + result.add(NotificationChannelId.INCOMING_CALL); + result.add(NotificationChannelId.ONGOING_CALL); + result.add(NotificationChannelId.MISSED_CALL); + result.add(NotificationChannelId.DEFAULT); + result.addAll(VoicemailChannelUtils.getAllChannelIds(context)); + return result; + } + + private static void createIncomingCallChannel(@NonNull Context context) { + NotificationChannel channel = + new NotificationChannel( + NotificationChannelId.INCOMING_CALL, + context.getText(R.string.notification_channel_incoming_call), + NotificationManager.IMPORTANCE_MAX); + channel.setShowBadge(false); + channel.enableLights(true); + channel.enableVibration(false); + channel.setSound( + null, new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build()); + context.getSystemService(NotificationManager.class).createNotificationChannel(channel); + } + + private static void createOngoingCallChannel(@NonNull Context context) { + NotificationChannel channel = + new NotificationChannel( + NotificationChannelId.ONGOING_CALL, + context.getText(R.string.notification_channel_ongoing_call), + NotificationManager.IMPORTANCE_DEFAULT); + channel.setShowBadge(false); + channel.enableLights(false); + channel.enableVibration(false); + channel.setSound( + null, new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build()); + context.getSystemService(NotificationManager.class).createNotificationChannel(channel); + } + + private static void createMissedCallChannel(@NonNull Context context) { + NotificationChannel channel = + new NotificationChannel( + NotificationChannelId.MISSED_CALL, + context.getText(R.string.notification_channel_missed_call), + NotificationManager.IMPORTANCE_DEFAULT); + channel.setShowBadge(true); + channel.enableLights(true); + channel.enableVibration(true); + channel.setSound( + null, new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build()); + context.getSystemService(NotificationManager.class).createNotificationChannel(channel); + } + + private static void createDefaultChannel(@NonNull Context context) { + NotificationChannel channel = + new NotificationChannel( + NotificationChannelId.DEFAULT, + context.getText(R.string.notification_channel_misc), + NotificationManager.IMPORTANCE_DEFAULT); + channel.setShowBadge(false); + channel.enableLights(true); + channel.enableVibration(true); + context.getSystemService(NotificationManager.class).createNotificationChannel(channel); } - private static TelecomManager getTelecomManager(@NonNull Context context) { - return context.getSystemService(TelecomManager.class); - } + private NotificationChannelManager() {} } diff --git a/java/com/android/dialer/notification/NotificationManagerUtils.java b/java/com/android/dialer/notification/NotificationManagerUtils.java new file mode 100644 index 000000000..d99a9036d --- /dev/null +++ b/java/com/android/dialer/notification/NotificationManagerUtils.java @@ -0,0 +1,41 @@ +/* + * 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 + */ + +package com.android.dialer.notification; + +import android.app.NotificationManager; +import android.content.Context; +import android.service.notification.StatusBarNotification; +import android.support.annotation.NonNull; +import android.text.TextUtils; +import com.android.dialer.common.Assert; + +/** Utilities to manage notifications. */ +public final class NotificationManagerUtils { + public static void cancelAllInGroup(@NonNull Context context, @NonNull String groupKey) { + Assert.isNotNull(context); + Assert.checkArgument(!TextUtils.isEmpty(groupKey)); + + NotificationManager notificationManager = context.getSystemService(NotificationManager.class); + for (StatusBarNotification notification : notificationManager.getActiveNotifications()) { + if (TextUtils.equals(groupKey, notification.getNotification().getGroup())) { + notificationManager.cancel(notification.getTag(), notification.getId()); + } + } + } + + private NotificationManagerUtils() {} +} diff --git a/java/com/android/dialer/notification/NotificationThrottler.java b/java/com/android/dialer/notification/NotificationThrottler.java new file mode 100644 index 000000000..9db744df6 --- /dev/null +++ b/java/com/android/dialer/notification/NotificationThrottler.java @@ -0,0 +1,126 @@ +/* + * 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 + */ + +package com.android.dialer.notification; + +import android.app.Notification; +import android.app.NotificationManager; +import android.content.Context; +import android.service.notification.StatusBarNotification; +import android.support.annotation.NonNull; +import android.text.TextUtils; +import com.android.dialer.common.Assert; +import com.android.dialer.common.LogUtil; +import com.android.dialer.logging.DialerImpression; +import com.android.dialer.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +/** + * Utility to ensure that only a certain number of notifications are shown for a particular + * notification type. Once the limit is reached, older notifications are cancelled. + */ +/* package */ class NotificationThrottler { + /** + * For gropued bundled notifications, the system UI will only display the last 8. For grouped + * unbundled notifications, the system displays all notifications until a global maximum of 50 is + * reached. + */ + private static final int MAX_NOTIFICATIONS_PER_TAG = 10; + + private static final int HIGH_GLOBAL_NOTIFICATION_COUNT = 45; + + private static boolean didLogHighGlobalNotificationCountReached; + + /* package */ static void throttle(@NonNull Context context, @NonNull Notification notification) { + Assert.isNotNull(context); + Assert.isNotNull(notification); + + // No limiting for non-grouped notifications. + String groupKey = notification.getGroup(); + if (TextUtils.isEmpty(groupKey)) { + return; + } + + NotificationManager notificationManager = context.getSystemService(NotificationManager.class); + StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); + if (activeNotifications.length > HIGH_GLOBAL_NOTIFICATION_COUNT + && !didLogHighGlobalNotificationCountReached) { + LogUtil.i( + "NotificationThrottler.throttle", + "app has %d notifications, system may suppress future notifications", + activeNotifications.length); + didLogHighGlobalNotificationCountReached = true; + Logger.get(context) + .logImpression(DialerImpression.Type.HIGH_GLOBAL_NOTIFICATION_COUNT_REACHED); + } + + // Count the number of notificatons for this group (excluding the summary). + int count = 0; + for (StatusBarNotification currentNotification : activeNotifications) { + if (isNotificationInGroup(currentNotification, groupKey)) { + count++; + } + } + + if (count > MAX_NOTIFICATIONS_PER_TAG) { + LogUtil.i( + "NotificationThrottler.throttle", + "groupKey: %s is over limit, count: %d, limit: %d", + groupKey, + count, + MAX_NOTIFICATIONS_PER_TAG); + List notifications = getSortedMatchingNotifications(context, groupKey); + for (int i = 0; i < (count - MAX_NOTIFICATIONS_PER_TAG); i++) { + notificationManager.cancel(notifications.get(i).getTag(), notifications.get(i).getId()); + } + } + } + + private static List getSortedMatchingNotifications( + @NonNull Context context, @NonNull String groupKey) { + List notifications = new ArrayList<>(); + NotificationManager notificationManager = context.getSystemService(NotificationManager.class); + for (StatusBarNotification notification : notificationManager.getActiveNotifications()) { + if (isNotificationInGroup(notification, groupKey)) { + notifications.add(notification); + } + } + Collections.sort( + notifications, + new Comparator() { + @Override + public int compare(StatusBarNotification left, StatusBarNotification right) { + return Long.compare(left.getPostTime(), right.getPostTime()); + } + }); + return notifications; + } + + private static boolean isNotificationInGroup( + @NonNull StatusBarNotification notification, @NonNull String groupKey) { + // Don't include group summaries. + if ((notification.getNotification().flags & Notification.FLAG_GROUP_SUMMARY) != 0) { + return false; + } + + return TextUtils.equals(groupKey, notification.getNotification().getGroup()); + } + + private NotificationThrottler() {} +} diff --git a/java/com/android/dialer/notification/PackageUpdatedReceiver.java b/java/com/android/dialer/notification/PackageUpdatedReceiver.java deleted file mode 100644 index feed40263..000000000 --- a/java/com/android/dialer/notification/PackageUpdatedReceiver.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 - */ - -package com.android.dialer.notification; - -import android.annotation.TargetApi; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.support.v4.os.BuildCompat; - -/** Inits the notification channels when Dialer or OS is updated */ -public class PackageUpdatedReceiver extends BroadcastReceiver { - - @Override - @TargetApi(26) - public void onReceive(Context context, Intent intent) { - if (!BuildCompat.isAtLeastO()) { - return; - } - context = context.createDeviceProtectedStorageContext(); - NotificationChannelManager.getInstance().initChannels(context); - } -} diff --git a/java/com/android/dialer/notification/VoicemailChannelUtils.java b/java/com/android/dialer/notification/VoicemailChannelUtils.java new file mode 100644 index 000000000..e2d0f3a21 --- /dev/null +++ b/java/com/android/dialer/notification/VoicemailChannelUtils.java @@ -0,0 +1,217 @@ +/* + * 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 + */ + +package com.android.dialer.notification; + +import android.annotation.TargetApi; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.content.Context; +import android.media.AudioAttributes; +import android.os.Build.VERSION_CODES; +import android.provider.Settings; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.v4.os.BuildCompat; +import android.telecom.PhoneAccount; +import android.telecom.PhoneAccountHandle; +import android.telecom.TelecomManager; +import android.telephony.TelephonyManager; +import android.text.TextUtils; +import android.util.ArraySet; +import com.android.dialer.common.Assert; +import com.android.dialer.common.LogUtil; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +/** Utilities for working with voicemail channels. */ +@TargetApi(VERSION_CODES.O) +/* package */ final class VoicemailChannelUtils { + private static final String GLOBAL_VOICEMAIL_CHANNEL_ID = "phone_voicemail"; + private static final String PER_ACCOUNT_VOICEMAIL_CHANNEL_ID_PREFIX = "phone_voicemail_account_"; + + static Set getAllChannelIds(@NonNull Context context) { + Assert.checkArgument(BuildCompat.isAtLeastO()); + Assert.isNotNull(context); + + Set result = new ArraySet<>(); + if (isSingleSimDevice(context)) { + result.add(GLOBAL_VOICEMAIL_CHANNEL_ID); + } else { + for (PhoneAccountHandle handle : getAllEligableAccounts(context)) { + result.add(getChannelIdForAccount(handle)); + } + } + return result; + } + + static void createAllChannels(@NonNull Context context) { + Assert.checkArgument(BuildCompat.isAtLeastO()); + Assert.isNotNull(context); + + if (isSingleSimDevice(context)) { + createGlobalVoicemailChannel(context); + } else { + for (PhoneAccountHandle handle : getAllEligableAccounts(context)) { + createVoicemailChannelForAccount(context, handle); + } + } + } + + @NonNull + static String getChannelId(@NonNull Context context, @Nullable PhoneAccountHandle handle) { + Assert.checkArgument(BuildCompat.isAtLeastO()); + Assert.isNotNull(context); + + // Most devices we deal with have a single SIM slot. No need to distinguish between phone + // accounts. + if (isSingleSimDevice(context)) { + return GLOBAL_VOICEMAIL_CHANNEL_ID; + } + + // We can get a null phone account at random points (modem reboot, etc...). Gracefully degrade + // by using the default channel. + if (handle == null) { + LogUtil.i( + "VoicemailChannelUtils.getChannelId", + "no phone account on a multi-SIM device, using default channel"); + return NotificationChannelId.DEFAULT; + } + + // Voicemail notifications should always be associated with a SIM based phone account. + if (!isChannelAllowedForAccount(context, handle)) { + LogUtil.i( + "VoicemailChannelUtils.getChannelId", + "phone account is not for a SIM, using default channel"); + return NotificationChannelId.DEFAULT; + } + + // Now we're in the multi-SIM case. + String channelId = getChannelIdForAccount(handle); + if (!doesChannelExist(context, channelId)) { + LogUtil.i( + "VoicemailChannelUtils.getChannelId", + "voicemail channel not found for phone account (possible SIM swap?), creating a new one"); + createVoicemailChannelForAccount(context, handle); + } + return channelId; + } + + private static boolean doesChannelExist(@NonNull Context context, @NonNull String channelId) { + return context.getSystemService(NotificationManager.class).getNotificationChannel(channelId) + != null; + } + + private static String getChannelIdForAccount(@NonNull PhoneAccountHandle handle) { + Assert.isNotNull(handle); + return PER_ACCOUNT_VOICEMAIL_CHANNEL_ID_PREFIX + ":" + handle.getId(); + } + + /** + * Creates a voicemail channel but doesn't associate it with a SIM. For devices with only one SIM + * slot this is ideal because there won't be duplication in the settings UI. + */ + private static void createGlobalVoicemailChannel(@NonNull Context context) { + NotificationChannel channel = newChannel(context, GLOBAL_VOICEMAIL_CHANNEL_ID, null); + + TelecomManager telecomManager = context.getSystemService(TelecomManager.class); + PhoneAccountHandle handle = + telecomManager.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL); + if (handle == null) { + LogUtil.i( + "VoicemailChannelUtils.createGlobalVoicemailChannel", + "phone account is null, not migrating sound settings"); + } else if (!isChannelAllowedForAccount(context, handle)) { + LogUtil.i( + "VoicemailChannelUtils.createGlobalVoicemailChannel", + "phone account is not eligable, not migrating sound settings"); + } else { + migrateVoicemailSoundSettings(context, channel, handle); + } + context.getSystemService(NotificationManager.class).createNotificationChannel(channel); + } + + private static List getAllEligableAccounts(@NonNull Context context) { + List handles = new ArrayList<>(); + TelecomManager telecomManager = context.getSystemService(TelecomManager.class); + for (PhoneAccountHandle handle : telecomManager.getCallCapablePhoneAccounts()) { + if (isChannelAllowedForAccount(context, handle)) { + handles.add(handle); + } + } + return handles; + } + + private static void createVoicemailChannelForAccount( + @NonNull Context context, @NonNull PhoneAccountHandle handle) { + PhoneAccount phoneAccount = + context.getSystemService(TelecomManager.class).getPhoneAccount(handle); + NotificationChannel channel = + newChannel(context, getChannelIdForAccount(handle), phoneAccount.getLabel()); + migrateVoicemailSoundSettings(context, channel, handle); + context.getSystemService(NotificationManager.class).createNotificationChannel(channel); + } + + private static void migrateVoicemailSoundSettings( + @NonNull Context context, + @NonNull NotificationChannel channel, + @NonNull PhoneAccountHandle handle) { + TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class); + channel.enableVibration(telephonyManager.isVoicemailVibrationEnabled(handle)); + channel.setSound( + telephonyManager.getVoicemailRingtoneUri(handle), + new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build()); + } + + private static boolean isChannelAllowedForAccount( + @NonNull Context context, @NonNull PhoneAccountHandle handle) { + PhoneAccount phoneAccount = + context.getSystemService(TelecomManager.class).getPhoneAccount(handle); + if (phoneAccount == null) { + return false; + } + if (!phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { + return false; + } + return true; + } + + private static NotificationChannel newChannel( + @NonNull Context context, @NonNull String channelId, @Nullable CharSequence nameSuffix) { + CharSequence name = context.getText(R.string.notification_channel_voicemail); + // TODO(sail): Use a string resource template after v10. + if (!TextUtils.isEmpty(nameSuffix)) { + name = TextUtils.concat(name, ": ", nameSuffix); + } + + NotificationChannel channel = + new NotificationChannel(channelId, name, NotificationManager.IMPORTANCE_DEFAULT); + channel.setShowBadge(true); + channel.enableLights(true); + channel.enableVibration(true); + channel.setSound( + Settings.System.DEFAULT_NOTIFICATION_URI, + new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build()); + return channel; + } + + private static boolean isSingleSimDevice(@NonNull Context context) { + return context.getSystemService(TelephonyManager.class).getPhoneCount() <= 1; + } + + private VoicemailChannelUtils() {} +} diff --git a/java/com/android/dialer/notification/res/values-af/strings.xml b/java/com/android/dialer/notification/res/values-af/strings.xml index 08dd754dd..e48249b3c 100644 --- a/java/com/android/dialer/notification/res/values-af/strings.xml +++ b/java/com/android/dialer/notification/res/values-af/strings.xml @@ -21,6 +21,5 @@ "Deurlopende oproepe" "Gemiste oproepe" "Stemboodskappe" - "Ekterne oproepe" "Verstek" diff --git a/java/com/android/dialer/notification/res/values-am/strings.xml b/java/com/android/dialer/notification/res/values-am/strings.xml index 56d6c2ca1..0983e0591 100644 --- a/java/com/android/dialer/notification/res/values-am/strings.xml +++ b/java/com/android/dialer/notification/res/values-am/strings.xml @@ -21,6 +21,5 @@ "በመካሄድ ላይ ያሉ ጥሪዎች" "ያመለጡ ጥሪዎች" "የድምፅ መልዕክቶች" - "ውጫዊ ጥሪዎች" "ነባሪ" diff --git a/java/com/android/dialer/notification/res/values-ar/strings.xml b/java/com/android/dialer/notification/res/values-ar/strings.xml index 71857c274..ab6059ff1 100644 --- a/java/com/android/dialer/notification/res/values-ar/strings.xml +++ b/java/com/android/dialer/notification/res/values-ar/strings.xml @@ -21,6 +21,5 @@ "المكالمات الجارية" "المكالمات الفائتة" "رسائل البريد الصوتي" - "المكالمات الخارجية" "افتراضي" diff --git a/java/com/android/dialer/notification/res/values-az/strings.xml b/java/com/android/dialer/notification/res/values-az/strings.xml index f907e554e..425f30ad7 100644 --- a/java/com/android/dialer/notification/res/values-az/strings.xml +++ b/java/com/android/dialer/notification/res/values-az/strings.xml @@ -21,6 +21,5 @@ "Gedən zənglər" "Buraxılmış zənglər" "Səsli məktublar" - "External calls" "Defolt" diff --git a/java/com/android/dialer/notification/res/values-b+sr+Latn/strings.xml b/java/com/android/dialer/notification/res/values-b+sr+Latn/strings.xml index 4d5b5e78a..4598e7644 100644 --- a/java/com/android/dialer/notification/res/values-b+sr+Latn/strings.xml +++ b/java/com/android/dialer/notification/res/values-b+sr+Latn/strings.xml @@ -21,6 +21,5 @@ "Pozivi u toku" "Propušteni pozivi" "Govorne poruke" - "Spoljni pozivi" "Podrazumevano" diff --git a/java/com/android/dialer/notification/res/values-be/strings.xml b/java/com/android/dialer/notification/res/values-be/strings.xml index 70defe342..586a36c31 100644 --- a/java/com/android/dialer/notification/res/values-be/strings.xml +++ b/java/com/android/dialer/notification/res/values-be/strings.xml @@ -21,6 +21,5 @@ "Адбываючыяся выклікі" "Прапушчаныя выклікі" "Галасавая пошта" - "Знешнія выклікі" "Стандартны" diff --git a/java/com/android/dialer/notification/res/values-bg/strings.xml b/java/com/android/dialer/notification/res/values-bg/strings.xml index 1ec202e6c..9bc8f8f02 100644 --- a/java/com/android/dialer/notification/res/values-bg/strings.xml +++ b/java/com/android/dialer/notification/res/values-bg/strings.xml @@ -21,6 +21,5 @@ "Текущи обаждания" "Пропуснати обаждания" "Гласови съобщения" - "Външни обаждания" "По подразбиране" diff --git a/java/com/android/dialer/notification/res/values-bn/strings.xml b/java/com/android/dialer/notification/res/values-bn/strings.xml index 886f8317d..1d7781797 100644 --- a/java/com/android/dialer/notification/res/values-bn/strings.xml +++ b/java/com/android/dialer/notification/res/values-bn/strings.xml @@ -21,6 +21,5 @@ "সংযুক্ত কল" "মিস করা কল" "ভয়েসমেল" - "বাহ্যিক কল" "ডিফল্ট" diff --git a/java/com/android/dialer/notification/res/values-bs/strings.xml b/java/com/android/dialer/notification/res/values-bs/strings.xml index e408a6468..dedbb1c2d 100644 --- a/java/com/android/dialer/notification/res/values-bs/strings.xml +++ b/java/com/android/dialer/notification/res/values-bs/strings.xml @@ -21,6 +21,5 @@ "Tekući pozivi" "Propušteni pozivi" "Poruke govorne pošte" - "Vanjski pozivi" "Zadano" diff --git a/java/com/android/dialer/notification/res/values-ca/strings.xml b/java/com/android/dialer/notification/res/values-ca/strings.xml index ea81b627a..1c19d0f74 100644 --- a/java/com/android/dialer/notification/res/values-ca/strings.xml +++ b/java/com/android/dialer/notification/res/values-ca/strings.xml @@ -21,6 +21,5 @@ "Trucades en curs" "Trucades perdudes" "Missatges de veu" - "Trucades externes" "Predeterminat" diff --git a/java/com/android/dialer/notification/res/values-cs/strings.xml b/java/com/android/dialer/notification/res/values-cs/strings.xml index 9ea7b61ca..c428ca2f3 100644 --- a/java/com/android/dialer/notification/res/values-cs/strings.xml +++ b/java/com/android/dialer/notification/res/values-cs/strings.xml @@ -21,6 +21,5 @@ "Probíhající hovory" "Zmeškané hovory" "Hlasové zprávy" - "Externí hovory" "Výchozí" diff --git a/java/com/android/dialer/notification/res/values-da/strings.xml b/java/com/android/dialer/notification/res/values-da/strings.xml index e4fc4dded..7f0ce9f10 100644 --- a/java/com/android/dialer/notification/res/values-da/strings.xml +++ b/java/com/android/dialer/notification/res/values-da/strings.xml @@ -21,6 +21,5 @@ "Igangværende opkald" "Ubesvarede opkald" "Talebeskeder" - "Eksterne opkald" "Standard" diff --git a/java/com/android/dialer/notification/res/values-de/strings.xml b/java/com/android/dialer/notification/res/values-de/strings.xml index 7fce6bf47..86b752016 100644 --- a/java/com/android/dialer/notification/res/values-de/strings.xml +++ b/java/com/android/dialer/notification/res/values-de/strings.xml @@ -21,6 +21,5 @@ "Laufende Anrufe" "Entgangene Anrufe" "Mailboxnachrichten" - "Externe Anrufe" "Standard" diff --git a/java/com/android/dialer/notification/res/values-el/strings.xml b/java/com/android/dialer/notification/res/values-el/strings.xml index a25bb43e9..812dc2564 100644 --- a/java/com/android/dialer/notification/res/values-el/strings.xml +++ b/java/com/android/dialer/notification/res/values-el/strings.xml @@ -21,6 +21,5 @@ "Κλήσεις σε εξέλιξη" "Αναπάντητες κλήσεις" "Μηνύματα αυτόματου τηλεφωνητή" - "Εξωτερικές κλήσεις" "Προεπιλογή" diff --git a/java/com/android/dialer/notification/res/values-en-rAU/strings.xml b/java/com/android/dialer/notification/res/values-en-rAU/strings.xml index 7d4bd825b..43b722beb 100644 --- a/java/com/android/dialer/notification/res/values-en-rAU/strings.xml +++ b/java/com/android/dialer/notification/res/values-en-rAU/strings.xml @@ -21,6 +21,5 @@ "Ongoing calls" "Missed calls" "Voicemail" - "External calls" "Default" diff --git a/java/com/android/dialer/notification/res/values-en-rGB/strings.xml b/java/com/android/dialer/notification/res/values-en-rGB/strings.xml index 7d4bd825b..43b722beb 100644 --- a/java/com/android/dialer/notification/res/values-en-rGB/strings.xml +++ b/java/com/android/dialer/notification/res/values-en-rGB/strings.xml @@ -21,6 +21,5 @@ "Ongoing calls" "Missed calls" "Voicemail" - "External calls" "Default" diff --git a/java/com/android/dialer/notification/res/values-en-rIN/strings.xml b/java/com/android/dialer/notification/res/values-en-rIN/strings.xml index 7d4bd825b..43b722beb 100644 --- a/java/com/android/dialer/notification/res/values-en-rIN/strings.xml +++ b/java/com/android/dialer/notification/res/values-en-rIN/strings.xml @@ -21,6 +21,5 @@ "Ongoing calls" "Missed calls" "Voicemail" - "External calls" "Default" diff --git a/java/com/android/dialer/notification/res/values-es-rUS/strings.xml b/java/com/android/dialer/notification/res/values-es-rUS/strings.xml index fe8fe1354..c56edcfe6 100644 --- a/java/com/android/dialer/notification/res/values-es-rUS/strings.xml +++ b/java/com/android/dialer/notification/res/values-es-rUS/strings.xml @@ -21,6 +21,5 @@ "Llamadas en curso" "Llamadas perdidas" "Mensajes de voz" - "Llamadas externas" "Predeterminado" diff --git a/java/com/android/dialer/notification/res/values-es/strings.xml b/java/com/android/dialer/notification/res/values-es/strings.xml index fe8fe1354..c56edcfe6 100644 --- a/java/com/android/dialer/notification/res/values-es/strings.xml +++ b/java/com/android/dialer/notification/res/values-es/strings.xml @@ -21,6 +21,5 @@ "Llamadas en curso" "Llamadas perdidas" "Mensajes de voz" - "Llamadas externas" "Predeterminado" diff --git a/java/com/android/dialer/notification/res/values-et/strings.xml b/java/com/android/dialer/notification/res/values-et/strings.xml index 41623951f..9c60a3195 100644 --- a/java/com/android/dialer/notification/res/values-et/strings.xml +++ b/java/com/android/dialer/notification/res/values-et/strings.xml @@ -21,6 +21,5 @@ "Käimasolevad kõned" "Vastamata kõned" "Kõnepostisõnumid" - "Välised kõned" "Vaikeseade" diff --git a/java/com/android/dialer/notification/res/values-eu/strings.xml b/java/com/android/dialer/notification/res/values-eu/strings.xml index 326ac0ab6..d94ac0ab6 100644 --- a/java/com/android/dialer/notification/res/values-eu/strings.xml +++ b/java/com/android/dialer/notification/res/values-eu/strings.xml @@ -21,6 +21,5 @@ "Abian diren deiak" "Dei galduak" "Ahots-mezuak" - "Kanpoko deiak" "Lehenetsia" diff --git a/java/com/android/dialer/notification/res/values-fa/strings.xml b/java/com/android/dialer/notification/res/values-fa/strings.xml index f1a7efc3d..edbc98336 100644 --- a/java/com/android/dialer/notification/res/values-fa/strings.xml +++ b/java/com/android/dialer/notification/res/values-fa/strings.xml @@ -21,6 +21,5 @@ "تماس‌های درحال انجام" "تماس‌های بی‌پاسخ" "پست‌های صوتی" - "تماس‌های خارجی" "پیش‌فرض" diff --git a/java/com/android/dialer/notification/res/values-fi/strings.xml b/java/com/android/dialer/notification/res/values-fi/strings.xml index c88c2325a..87652f8a8 100644 --- a/java/com/android/dialer/notification/res/values-fi/strings.xml +++ b/java/com/android/dialer/notification/res/values-fi/strings.xml @@ -21,6 +21,5 @@ "Käynnissä olevat puhelut" "Vastaamattomat puhelut" "Vastaajaviestit" - "Ulkopuoliset puhelut" "Oletus" diff --git a/java/com/android/dialer/notification/res/values-fr-rCA/strings.xml b/java/com/android/dialer/notification/res/values-fr-rCA/strings.xml index a21d6b28b..5a2d7dcfe 100644 --- a/java/com/android/dialer/notification/res/values-fr-rCA/strings.xml +++ b/java/com/android/dialer/notification/res/values-fr-rCA/strings.xml @@ -21,6 +21,5 @@ "Appels en cours" "Appels manqués" "Messages vocaux" - "Appels externes" "Par défaut" diff --git a/java/com/android/dialer/notification/res/values-fr/strings.xml b/java/com/android/dialer/notification/res/values-fr/strings.xml index a21d6b28b..5a2d7dcfe 100644 --- a/java/com/android/dialer/notification/res/values-fr/strings.xml +++ b/java/com/android/dialer/notification/res/values-fr/strings.xml @@ -21,6 +21,5 @@ "Appels en cours" "Appels manqués" "Messages vocaux" - "Appels externes" "Par défaut" diff --git a/java/com/android/dialer/notification/res/values-gl/strings.xml b/java/com/android/dialer/notification/res/values-gl/strings.xml index 3b57a59b3..0e7fb612b 100644 --- a/java/com/android/dialer/notification/res/values-gl/strings.xml +++ b/java/com/android/dialer/notification/res/values-gl/strings.xml @@ -21,6 +21,5 @@ "Chamadas saíntes" "Chamadas perdidas" "Correos de voz" - "Chamadas externas" "Predeterminado" diff --git a/java/com/android/dialer/notification/res/values-gu/strings.xml b/java/com/android/dialer/notification/res/values-gu/strings.xml index f185e5971..a4a0a7ae1 100644 --- a/java/com/android/dialer/notification/res/values-gu/strings.xml +++ b/java/com/android/dialer/notification/res/values-gu/strings.xml @@ -21,6 +21,5 @@ "ચાલુ કૉલ" "છૂટેલા કૉલ" "વૉઇસમેઇલ" - "બાહ્ય કૉલ" "ડિફૉલ્ટ" diff --git a/java/com/android/dialer/notification/res/values-hi/strings.xml b/java/com/android/dialer/notification/res/values-hi/strings.xml index 89c8e5547..69ed9b0b2 100644 --- a/java/com/android/dialer/notification/res/values-hi/strings.xml +++ b/java/com/android/dialer/notification/res/values-hi/strings.xml @@ -21,6 +21,5 @@ "चल रहे कॉल" "छूटे कॉल" "वॉइसमेल" - "बाहरी कॉल" "डिफ़ॉल्ट" diff --git a/java/com/android/dialer/notification/res/values-hr/strings.xml b/java/com/android/dialer/notification/res/values-hr/strings.xml index 9f786d7d8..a5924c3ce 100644 --- a/java/com/android/dialer/notification/res/values-hr/strings.xml +++ b/java/com/android/dialer/notification/res/values-hr/strings.xml @@ -21,6 +21,5 @@ "Pozivi u tijeku" "Propušteni pozivi" "Poruke govorne pošte" - "Vanjski pozivi" "Zadano" diff --git a/java/com/android/dialer/notification/res/values-hu/strings.xml b/java/com/android/dialer/notification/res/values-hu/strings.xml index 09fa795d6..719252f0f 100644 --- a/java/com/android/dialer/notification/res/values-hu/strings.xml +++ b/java/com/android/dialer/notification/res/values-hu/strings.xml @@ -21,6 +21,5 @@ "Kimenő hívások" "Nem fogadott hívások" "Hangüzenetek" - "Külső hívások" "Alapértelmezett" diff --git a/java/com/android/dialer/notification/res/values-hy/strings.xml b/java/com/android/dialer/notification/res/values-hy/strings.xml index 693898a55..6bb2c34e3 100644 --- a/java/com/android/dialer/notification/res/values-hy/strings.xml +++ b/java/com/android/dialer/notification/res/values-hy/strings.xml @@ -21,6 +21,5 @@ "Ընթացիկ զանգեր" "Բաց թողնված զանգեր" "Ձայնային փոստ" - "Արտաքին զանգեր" "Կանխադրված" diff --git a/java/com/android/dialer/notification/res/values-in/strings.xml b/java/com/android/dialer/notification/res/values-in/strings.xml index 405b2927d..88ef3d524 100644 --- a/java/com/android/dialer/notification/res/values-in/strings.xml +++ b/java/com/android/dialer/notification/res/values-in/strings.xml @@ -21,6 +21,5 @@ "Panggilan keluar" "Panggilan tak terjawab" "Pesan suara" - "Panggilan eksternal" "Default" diff --git a/java/com/android/dialer/notification/res/values-is/strings.xml b/java/com/android/dialer/notification/res/values-is/strings.xml index be84917fc..166d97443 100644 --- a/java/com/android/dialer/notification/res/values-is/strings.xml +++ b/java/com/android/dialer/notification/res/values-is/strings.xml @@ -21,6 +21,5 @@ "Símtöl í gangi" "Ósvöruð símtöl" "Talhólfsskilaboð" - "Utanaðkomandi símtöl" "Sjálfgefið" diff --git a/java/com/android/dialer/notification/res/values-it/strings.xml b/java/com/android/dialer/notification/res/values-it/strings.xml index 1ac6e2d41..7b55da991 100644 --- a/java/com/android/dialer/notification/res/values-it/strings.xml +++ b/java/com/android/dialer/notification/res/values-it/strings.xml @@ -21,6 +21,5 @@ "Chiamate in uscita" "Chiamate perse" "Messaggi vocali" - "Chiamate esterne" "Predefinito" diff --git a/java/com/android/dialer/notification/res/values-iw/strings.xml b/java/com/android/dialer/notification/res/values-iw/strings.xml index ed07b8643..2b8b9df33 100644 --- a/java/com/android/dialer/notification/res/values-iw/strings.xml +++ b/java/com/android/dialer/notification/res/values-iw/strings.xml @@ -21,6 +21,5 @@ "שיחות יוצאות" "שיחות שלא נענו" "הודעות קוליות" - "שיחות חיצוניות" "ברירת מחדל" diff --git a/java/com/android/dialer/notification/res/values-ja/strings.xml b/java/com/android/dialer/notification/res/values-ja/strings.xml index 3265d7266..2ff8da7d0 100644 --- a/java/com/android/dialer/notification/res/values-ja/strings.xml +++ b/java/com/android/dialer/notification/res/values-ja/strings.xml @@ -21,6 +21,5 @@ "通話中" "不在着信" "ボイスメール" - "外部通話" "デフォルト" diff --git a/java/com/android/dialer/notification/res/values-ka/strings.xml b/java/com/android/dialer/notification/res/values-ka/strings.xml index 6d81465e2..73394efeb 100644 --- a/java/com/android/dialer/notification/res/values-ka/strings.xml +++ b/java/com/android/dialer/notification/res/values-ka/strings.xml @@ -21,6 +21,5 @@ "გამავალი ზარები" "გამოტოვებული ზარები" "ხმოვანი ფოსტა" - "გარე ზარები" "ნაგულისხმევი" diff --git a/java/com/android/dialer/notification/res/values-kk/strings.xml b/java/com/android/dialer/notification/res/values-kk/strings.xml index 35733fb04..8151c9ca9 100644 --- a/java/com/android/dialer/notification/res/values-kk/strings.xml +++ b/java/com/android/dialer/notification/res/values-kk/strings.xml @@ -21,6 +21,5 @@ "Қазіргі қоңыраулар" "Қабылданбаған қоңыраулар" "Дауыстық хабарлар" - "Сыртқы қоңыраулар" "Әдепкі" diff --git a/java/com/android/dialer/notification/res/values-km/strings.xml b/java/com/android/dialer/notification/res/values-km/strings.xml index 42bc11350..22131ff39 100644 --- a/java/com/android/dialer/notification/res/values-km/strings.xml +++ b/java/com/android/dialer/notification/res/values-km/strings.xml @@ -21,6 +21,5 @@ "ការ​ហៅ​បន្ត" "ការ​ហៅ​ដែល​មិន​បាន​ទទួល" "សារ​ជា​សំឡេង" - "ការ​ហៅខាង​ក្រៅ" "លំ​នាំ​ដើម" diff --git a/java/com/android/dialer/notification/res/values-kn/strings.xml b/java/com/android/dialer/notification/res/values-kn/strings.xml index 45f26e378..d6e55bdb1 100644 --- a/java/com/android/dialer/notification/res/values-kn/strings.xml +++ b/java/com/android/dialer/notification/res/values-kn/strings.xml @@ -21,6 +21,5 @@ "ಚಾಲ್ತಿಯಲ್ಲಿರುವ ಕರೆಗಳು" "ಮಿಸ್ಡ್‌ ಕರೆಗಳು" "ಧ್ವನಿಮೇಲ್‌ಗಳು" - "ಹೊರಗಿನ ಕರೆಗಳು" "ಡಿಫಾಲ್ಟ್" diff --git a/java/com/android/dialer/notification/res/values-ko/strings.xml b/java/com/android/dialer/notification/res/values-ko/strings.xml index d806cad06..5a667176d 100644 --- a/java/com/android/dialer/notification/res/values-ko/strings.xml +++ b/java/com/android/dialer/notification/res/values-ko/strings.xml @@ -21,6 +21,5 @@ "진행 중인 전화" "부재중 전화" "음성사서함" - "외부 전화" "기본" diff --git a/java/com/android/dialer/notification/res/values-ky/strings.xml b/java/com/android/dialer/notification/res/values-ky/strings.xml index eb6adf6e7..c5259315a 100644 --- a/java/com/android/dialer/notification/res/values-ky/strings.xml +++ b/java/com/android/dialer/notification/res/values-ky/strings.xml @@ -21,6 +21,5 @@ "Учурдагы чалуулар" "Кабыл алынбаган чалуулар" "Үнкаттар" - "Тышкы чалуулар" "Демейки" diff --git a/java/com/android/dialer/notification/res/values-lo/strings.xml b/java/com/android/dialer/notification/res/values-lo/strings.xml index f439807de..a52d9df14 100644 --- a/java/com/android/dialer/notification/res/values-lo/strings.xml +++ b/java/com/android/dialer/notification/res/values-lo/strings.xml @@ -21,6 +21,5 @@ "ສາຍໂທອອກ" "ສາຍບໍ່ໄດ້ຮັບ" "ຂໍ້ຄວາມສຽງ" - "ສາຍພາຍນອກ" "ຄ່າເລີ່ມຕົ້ນ" diff --git a/java/com/android/dialer/notification/res/values-lt/strings.xml b/java/com/android/dialer/notification/res/values-lt/strings.xml index f08697ad6..6f26d3e66 100644 --- a/java/com/android/dialer/notification/res/values-lt/strings.xml +++ b/java/com/android/dialer/notification/res/values-lt/strings.xml @@ -21,6 +21,5 @@ "Vykstantys skambučiai" "Praleisti skambučiai" "Balso pašto pranešimai" - "Išoriniai skambučiai" "Numatytasis" diff --git a/java/com/android/dialer/notification/res/values-lv/strings.xml b/java/com/android/dialer/notification/res/values-lv/strings.xml index d465b682d..1819d810a 100644 --- a/java/com/android/dialer/notification/res/values-lv/strings.xml +++ b/java/com/android/dialer/notification/res/values-lv/strings.xml @@ -21,6 +21,5 @@ "Aktīvie zvani" "Neatbildētie zvani" "Balss pasta ziņojumi" - "Ārējie zvani" "Noklusējums" diff --git a/java/com/android/dialer/notification/res/values-mk/strings.xml b/java/com/android/dialer/notification/res/values-mk/strings.xml index 838065ba9..56459c479 100644 --- a/java/com/android/dialer/notification/res/values-mk/strings.xml +++ b/java/com/android/dialer/notification/res/values-mk/strings.xml @@ -21,6 +21,5 @@ "Појдовни повици" "Пропуштени повици" "Говорни пораки" - "Надворешни повици" "Стандардно" diff --git a/java/com/android/dialer/notification/res/values-ml/strings.xml b/java/com/android/dialer/notification/res/values-ml/strings.xml index 448186a36..49a64e8f5 100644 --- a/java/com/android/dialer/notification/res/values-ml/strings.xml +++ b/java/com/android/dialer/notification/res/values-ml/strings.xml @@ -21,6 +21,5 @@ "നിലവിലുള്ള കോളുകൾ" "മിസ്‌ഡ് കോളുകൾ" "വോയ്‌സ്മെയിലുകൾ" - "എക്‌സ്റ്റേണൽ കോളുകൾ" "ഡിഫോൾട്ട്" diff --git a/java/com/android/dialer/notification/res/values-mn/strings.xml b/java/com/android/dialer/notification/res/values-mn/strings.xml index 3dca52e6b..28297b3c1 100644 --- a/java/com/android/dialer/notification/res/values-mn/strings.xml +++ b/java/com/android/dialer/notification/res/values-mn/strings.xml @@ -21,6 +21,5 @@ "Үргэлжилж буй дуудлага" "Аваагүй дуудлага" "Дуут шуудан" - "Гадаад дуудлага" "Өгөгдмөл" diff --git a/java/com/android/dialer/notification/res/values-mr/strings.xml b/java/com/android/dialer/notification/res/values-mr/strings.xml index 568537640..38fbd606a 100644 --- a/java/com/android/dialer/notification/res/values-mr/strings.xml +++ b/java/com/android/dialer/notification/res/values-mr/strings.xml @@ -21,6 +21,5 @@ "सुरू असलेले कॉल" "सुटलेले कॉल" "व्हॉइसमेल" - "बाह्य कॉल" "डीफॉल्ट" diff --git a/java/com/android/dialer/notification/res/values-ms/strings.xml b/java/com/android/dialer/notification/res/values-ms/strings.xml index a1961c4a4..ec7be04ef 100644 --- a/java/com/android/dialer/notification/res/values-ms/strings.xml +++ b/java/com/android/dialer/notification/res/values-ms/strings.xml @@ -21,6 +21,5 @@ "Panggilan sedang berlangsung" "Panggilan terlepas" "Mel suara" - "Panggilan luar" "Lalai" diff --git a/java/com/android/dialer/notification/res/values-my/strings.xml b/java/com/android/dialer/notification/res/values-my/strings.xml index 26398b459..44df84798 100644 --- a/java/com/android/dialer/notification/res/values-my/strings.xml +++ b/java/com/android/dialer/notification/res/values-my/strings.xml @@ -21,6 +21,5 @@ "လက်ရှိခေါ်ဆိုမှုများ" "လွဲသွားသော ခေါ်ဆိုမှုများ" "အသံစာပို့စနစ်များ" - "ပြင်ပခေါ်ဆိုမှုများ" "မူရင်း" diff --git a/java/com/android/dialer/notification/res/values-nb/strings.xml b/java/com/android/dialer/notification/res/values-nb/strings.xml index e4ccd48a0..8e63fd24b 100644 --- a/java/com/android/dialer/notification/res/values-nb/strings.xml +++ b/java/com/android/dialer/notification/res/values-nb/strings.xml @@ -21,6 +21,5 @@ "Pågående samtaler" "Tapte anrop" "Talepost" - "Eksterne anrop" "Standard" diff --git a/java/com/android/dialer/notification/res/values-ne/strings.xml b/java/com/android/dialer/notification/res/values-ne/strings.xml index 8ccd2997a..e653bb3f8 100644 --- a/java/com/android/dialer/notification/res/values-ne/strings.xml +++ b/java/com/android/dialer/notification/res/values-ne/strings.xml @@ -21,6 +21,5 @@ "जारी रहेका कलहरू" "छुटेका कलहरू" "भ्वाइस मेलहरू" - "बाह्य कलहरू" "पूर्वनिर्धारित मान" diff --git a/java/com/android/dialer/notification/res/values-nl/strings.xml b/java/com/android/dialer/notification/res/values-nl/strings.xml index e46dd19e3..094cc357f 100644 --- a/java/com/android/dialer/notification/res/values-nl/strings.xml +++ b/java/com/android/dialer/notification/res/values-nl/strings.xml @@ -21,6 +21,5 @@ "Actieve oproepen" "Gemiste oproepen" "Voicemails" - "Externe oproepen" "Standaard" diff --git a/java/com/android/dialer/notification/res/values-no/strings.xml b/java/com/android/dialer/notification/res/values-no/strings.xml index e4ccd48a0..8e63fd24b 100644 --- a/java/com/android/dialer/notification/res/values-no/strings.xml +++ b/java/com/android/dialer/notification/res/values-no/strings.xml @@ -21,6 +21,5 @@ "Pågående samtaler" "Tapte anrop" "Talepost" - "Eksterne anrop" "Standard" diff --git a/java/com/android/dialer/notification/res/values-pa/strings.xml b/java/com/android/dialer/notification/res/values-pa/strings.xml index 40709c1ac..c4ee97b22 100644 --- a/java/com/android/dialer/notification/res/values-pa/strings.xml +++ b/java/com/android/dialer/notification/res/values-pa/strings.xml @@ -21,6 +21,5 @@ "ਆਊਟਗੋਇੰਗ ਕਾਲਾਂ" "ਖੁੰਝੀਆਂ ਕਾਲਾਂ" "ਵੌਇਸਮੇਲਾਂ" - "ਬਾਹਰੀ ਕਾਲਾਂ" "ਪੂਰਵ-ਨਿਰਧਾਰਤ" diff --git a/java/com/android/dialer/notification/res/values-pl/strings.xml b/java/com/android/dialer/notification/res/values-pl/strings.xml index 73b795cff..4b3346001 100644 --- a/java/com/android/dialer/notification/res/values-pl/strings.xml +++ b/java/com/android/dialer/notification/res/values-pl/strings.xml @@ -21,6 +21,5 @@ "Połączenia trwające" "Połączenia nieodebrane" "Wiadomości głosowe" - "Połączenia zewnętrzne" "Domyślny" diff --git a/java/com/android/dialer/notification/res/values-pt-rBR/strings.xml b/java/com/android/dialer/notification/res/values-pt-rBR/strings.xml index f6e41cb11..4b988c3cc 100644 --- a/java/com/android/dialer/notification/res/values-pt-rBR/strings.xml +++ b/java/com/android/dialer/notification/res/values-pt-rBR/strings.xml @@ -21,6 +21,5 @@ "Chamadas em andamento" "Chamadas perdidas" "Correios de voz" - "Chamadas externas" "Padrão" diff --git a/java/com/android/dialer/notification/res/values-pt-rPT/strings.xml b/java/com/android/dialer/notification/res/values-pt-rPT/strings.xml index ec42a5bf5..45b31ebd0 100644 --- a/java/com/android/dialer/notification/res/values-pt-rPT/strings.xml +++ b/java/com/android/dialer/notification/res/values-pt-rPT/strings.xml @@ -21,6 +21,5 @@ "Chamadas efetuadas" "Chamadas não atendidas" "Mensagens de correio de voz" - "Chamadas externas" "Predefinição" diff --git a/java/com/android/dialer/notification/res/values-pt/strings.xml b/java/com/android/dialer/notification/res/values-pt/strings.xml index f6e41cb11..4b988c3cc 100644 --- a/java/com/android/dialer/notification/res/values-pt/strings.xml +++ b/java/com/android/dialer/notification/res/values-pt/strings.xml @@ -21,6 +21,5 @@ "Chamadas em andamento" "Chamadas perdidas" "Correios de voz" - "Chamadas externas" "Padrão" diff --git a/java/com/android/dialer/notification/res/values-ro/strings.xml b/java/com/android/dialer/notification/res/values-ro/strings.xml index 7deeabba3..040c58ad2 100644 --- a/java/com/android/dialer/notification/res/values-ro/strings.xml +++ b/java/com/android/dialer/notification/res/values-ro/strings.xml @@ -21,6 +21,5 @@ "Apeluri în desfășurare" "Apeluri nepreluate" "Mesaje vocale" - "Apeluri externe" "Prestabilit" diff --git a/java/com/android/dialer/notification/res/values-ru/strings.xml b/java/com/android/dialer/notification/res/values-ru/strings.xml index 3a1140455..a8117990a 100644 --- a/java/com/android/dialer/notification/res/values-ru/strings.xml +++ b/java/com/android/dialer/notification/res/values-ru/strings.xml @@ -21,6 +21,5 @@ "Текущие вызовы" "Пропущенные вызовы" "Голосовые сообщения" - "Внешние вызовы" "По умолчанию" diff --git a/java/com/android/dialer/notification/res/values-si/strings.xml b/java/com/android/dialer/notification/res/values-si/strings.xml index bf0a5a798..3ad0af729 100644 --- a/java/com/android/dialer/notification/res/values-si/strings.xml +++ b/java/com/android/dialer/notification/res/values-si/strings.xml @@ -21,6 +21,5 @@ "යන ඇමතුම්" "මඟ හැරුණු ඇමතුම්" "හඬ තැපැල්" - "බාහිර ඇමතුම්" "පෙරනිමි" diff --git a/java/com/android/dialer/notification/res/values-sk/strings.xml b/java/com/android/dialer/notification/res/values-sk/strings.xml index 4a67e60d2..30941bcd5 100644 --- a/java/com/android/dialer/notification/res/values-sk/strings.xml +++ b/java/com/android/dialer/notification/res/values-sk/strings.xml @@ -21,6 +21,5 @@ "Prebiehajúce hovory" "Zmeškané hovory" "Hlasové správy" - "Externé hovory" "Predvolené" diff --git a/java/com/android/dialer/notification/res/values-sl/strings.xml b/java/com/android/dialer/notification/res/values-sl/strings.xml index e54111d12..70474b87b 100644 --- a/java/com/android/dialer/notification/res/values-sl/strings.xml +++ b/java/com/android/dialer/notification/res/values-sl/strings.xml @@ -21,6 +21,5 @@ "Aktivni klici" "Neodgovorjeni klici" "Sporočila v odzivniku" - "Zunanji klici" "Privzeto" diff --git a/java/com/android/dialer/notification/res/values-sq/strings.xml b/java/com/android/dialer/notification/res/values-sq/strings.xml index 42d4daac3..03bc24775 100644 --- a/java/com/android/dialer/notification/res/values-sq/strings.xml +++ b/java/com/android/dialer/notification/res/values-sq/strings.xml @@ -21,6 +21,5 @@ "Telefonatat në vazhdim" "Telefonatat e humbura" "Postat zanore" - "Telefonatat e jashtme" "I parazgjedhur" diff --git a/java/com/android/dialer/notification/res/values-sr/strings.xml b/java/com/android/dialer/notification/res/values-sr/strings.xml index 10477170f..8326c0403 100644 --- a/java/com/android/dialer/notification/res/values-sr/strings.xml +++ b/java/com/android/dialer/notification/res/values-sr/strings.xml @@ -21,6 +21,5 @@ "Позиви у току" "Пропуштени позиви" "Говорне поруке" - "Спољни позиви" "Подразумевано" diff --git a/java/com/android/dialer/notification/res/values-sv/strings.xml b/java/com/android/dialer/notification/res/values-sv/strings.xml index 6c9ff83b7..e3170d48f 100644 --- a/java/com/android/dialer/notification/res/values-sv/strings.xml +++ b/java/com/android/dialer/notification/res/values-sv/strings.xml @@ -21,6 +21,5 @@ "Pågående samtal" "Missade samtal" "Röstmeddelanden" - "Externa samtal" "Standard" diff --git a/java/com/android/dialer/notification/res/values-sw/strings.xml b/java/com/android/dialer/notification/res/values-sw/strings.xml index a493f8897..d0a65b08c 100644 --- a/java/com/android/dialer/notification/res/values-sw/strings.xml +++ b/java/com/android/dialer/notification/res/values-sw/strings.xml @@ -21,6 +21,5 @@ "Simu zinazoendelea" "Simu ambazo hukujibu" "Ujumbe wa sauti" - "Simu za nje" "Chaguo-msingi" diff --git a/java/com/android/dialer/notification/res/values-ta/strings.xml b/java/com/android/dialer/notification/res/values-ta/strings.xml index d3000cf90..8a6ae89a8 100644 --- a/java/com/android/dialer/notification/res/values-ta/strings.xml +++ b/java/com/android/dialer/notification/res/values-ta/strings.xml @@ -21,6 +21,5 @@ "செயலில் உள்ள அழைப்புகள்" "தவறிய அழைப்புகள்" "குரலஞ்சல்கள்" - "வெளி அழைப்புகள்" "இயல்பு" diff --git a/java/com/android/dialer/notification/res/values-te/strings.xml b/java/com/android/dialer/notification/res/values-te/strings.xml index b14b21071..b1911d34d 100644 --- a/java/com/android/dialer/notification/res/values-te/strings.xml +++ b/java/com/android/dialer/notification/res/values-te/strings.xml @@ -21,6 +21,5 @@ "కొనసాగుతున్న కాల్‌లు" "సమాధానమివ్వని కాల్‌లు" "వాయిస్ మెయిల్‌లు" - "బాహ్య కాల్‌లు" "డిఫాల్ట్" diff --git a/java/com/android/dialer/notification/res/values-th/strings.xml b/java/com/android/dialer/notification/res/values-th/strings.xml index 45248bbbe..b2949e42f 100644 --- a/java/com/android/dialer/notification/res/values-th/strings.xml +++ b/java/com/android/dialer/notification/res/values-th/strings.xml @@ -21,6 +21,5 @@ "สายที่สนทนาอยู่" "สายที่ไม่ได้รับ" "ข้อความเสียง" - "สายนอก" "ค่าเริ่มต้น" diff --git a/java/com/android/dialer/notification/res/values-tl/strings.xml b/java/com/android/dialer/notification/res/values-tl/strings.xml index 3e88a055f..1219ad86f 100644 --- a/java/com/android/dialer/notification/res/values-tl/strings.xml +++ b/java/com/android/dialer/notification/res/values-tl/strings.xml @@ -21,6 +21,5 @@ "Mga kasalukuyang tawag" "Mga hindi nasagot na tawag" "Mga voicemail" - "Mga external na tawag" "Default" diff --git a/java/com/android/dialer/notification/res/values-tr/strings.xml b/java/com/android/dialer/notification/res/values-tr/strings.xml index d4e063bc2..71c91c806 100644 --- a/java/com/android/dialer/notification/res/values-tr/strings.xml +++ b/java/com/android/dialer/notification/res/values-tr/strings.xml @@ -21,6 +21,5 @@ "Devam eden çağrılar" "Cevapsız çağrılar" "Sesli mesajlar" - "Harici çağrılar" "Varsayılan" diff --git a/java/com/android/dialer/notification/res/values-uk/strings.xml b/java/com/android/dialer/notification/res/values-uk/strings.xml index a83a58460..a002f42e1 100644 --- a/java/com/android/dialer/notification/res/values-uk/strings.xml +++ b/java/com/android/dialer/notification/res/values-uk/strings.xml @@ -21,6 +21,5 @@ "Поточні виклики" "Пропущені виклики" "Голосова пошта" - "Зовнішні виклики" "За умовчанням" diff --git a/java/com/android/dialer/notification/res/values-ur/strings.xml b/java/com/android/dialer/notification/res/values-ur/strings.xml index ba6e0d1da..805fe08f8 100644 --- a/java/com/android/dialer/notification/res/values-ur/strings.xml +++ b/java/com/android/dialer/notification/res/values-ur/strings.xml @@ -21,6 +21,5 @@ "جاری کالیں" "چھوٹی ہوئی کالیں" "صوتی میلز" - "بیرونی کالیں" "ڈیفالٹ" diff --git a/java/com/android/dialer/notification/res/values-uz/strings.xml b/java/com/android/dialer/notification/res/values-uz/strings.xml index d45ff47d2..16075b031 100644 --- a/java/com/android/dialer/notification/res/values-uz/strings.xml +++ b/java/com/android/dialer/notification/res/values-uz/strings.xml @@ -21,6 +21,5 @@ "Davom etayotgan suhbatlar" "Javobsiz chaqiruvlar" "Ovozli xabarlar" - "Tashqi chaqiruvlar" "Standart" diff --git a/java/com/android/dialer/notification/res/values-vi/strings.xml b/java/com/android/dialer/notification/res/values-vi/strings.xml index 6df88721e..b6ab3d2d8 100644 --- a/java/com/android/dialer/notification/res/values-vi/strings.xml +++ b/java/com/android/dialer/notification/res/values-vi/strings.xml @@ -21,6 +21,5 @@ "Cuộc gọi đến" "Cuộc gọi nhỡ" "Thư thoại" - "Cuộc gọi bên ngoài" "Mặc định" diff --git a/java/com/android/dialer/notification/res/values-zh-rCN/strings.xml b/java/com/android/dialer/notification/res/values-zh-rCN/strings.xml index fa5f0a657..1ef46c2b9 100644 --- a/java/com/android/dialer/notification/res/values-zh-rCN/strings.xml +++ b/java/com/android/dialer/notification/res/values-zh-rCN/strings.xml @@ -21,6 +21,5 @@ "正在进行的通话" "未接电话" "语音邮件" - "外部来电" "默认" diff --git a/java/com/android/dialer/notification/res/values-zh-rHK/strings.xml b/java/com/android/dialer/notification/res/values-zh-rHK/strings.xml index 307a7f9bf..43a6fabf6 100644 --- a/java/com/android/dialer/notification/res/values-zh-rHK/strings.xml +++ b/java/com/android/dialer/notification/res/values-zh-rHK/strings.xml @@ -21,6 +21,5 @@ "進行中的通話" "未接來電" "留言信箱" - "外部通話" "預設" diff --git a/java/com/android/dialer/notification/res/values-zh-rTW/strings.xml b/java/com/android/dialer/notification/res/values-zh-rTW/strings.xml index 054a2d737..35236be1d 100644 --- a/java/com/android/dialer/notification/res/values-zh-rTW/strings.xml +++ b/java/com/android/dialer/notification/res/values-zh-rTW/strings.xml @@ -21,6 +21,5 @@ "進行中的通話" "未接來電" "語音留言" - "外部通話" "預設" diff --git a/java/com/android/dialer/notification/res/values-zu/strings.xml b/java/com/android/dialer/notification/res/values-zu/strings.xml index 744ffc816..f3d95531f 100644 --- a/java/com/android/dialer/notification/res/values-zu/strings.xml +++ b/java/com/android/dialer/notification/res/values-zu/strings.xml @@ -21,6 +21,5 @@ "Amakholi aqhubekayo" "Amakholi akuphuthile" "Amavoyisimeyili" - "Amakholi angaphandle" "Okuzenzakalelayo" diff --git a/java/com/android/dialer/notification/res/values/ids.xml b/java/com/android/dialer/notification/res/values/ids.xml deleted file mode 100644 index c965f319d..000000000 --- a/java/com/android/dialer/notification/res/values/ids.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/java/com/android/dialer/notification/res/values/strings.xml b/java/com/android/dialer/notification/res/values/strings.xml index cb3119f67..a3c6935aa 100644 --- a/java/com/android/dialer/notification/res/values/strings.xml +++ b/java/com/android/dialer/notification/res/values/strings.xml @@ -20,7 +20,6 @@ Ongoing calls Missed calls Voicemails - External calls Default -- cgit v1.2.3