support locale change for notification channels
Bug: 37911731
Test: Manual test with different languages
Change-Id: I31d1c3c34afcde5811f6402da168df6b183c1fd6
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index e10b3f3..07b1b10 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -54,7 +54,7 @@
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyCapabilities;
-import com.android.internal.telephony.util.TelephonyNotificationBuilder;
+import com.android.internal.telephony.util.NotificationChannelController;
import com.android.phone.settings.VoicemailNotificationSettingsUtil;
import com.android.phone.settings.VoicemailSettingsActivity;
@@ -342,7 +342,7 @@
Resources res = mContext.getResources();
PersistableBundle carrierConfig = PhoneGlobals.getInstance().getCarrierConfigForSubId(
subId);
- Notification.Builder builder = new TelephonyNotificationBuilder(mContext);
+ Notification.Builder builder = new Notification.Builder(mContext);
builder.setSmallIcon(resId)
.setWhen(System.currentTimeMillis())
.setColor(subInfo.getIconTint())
@@ -353,7 +353,7 @@
.setColor(res.getColor(R.color.dialer_theme_color))
.setOngoing(carrierConfig.getBoolean(
CarrierConfigManager.KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL))
- .setChannel(TelephonyNotificationBuilder.CHANNEL_ID_VOICE_MAIL);
+ .setChannel(NotificationChannelController.CHANNEL_ID_VOICE_MAIL);
if (VoicemailNotificationSettingsUtil.isVibrationEnabled(phone)) {
builder.setDefaults(Notification.DEFAULT_VIBRATE);
@@ -499,14 +499,14 @@
notificationTitle = mContext.getString(R.string.labelCF);
}
- Notification.Builder builder = new TelephonyNotificationBuilder(mContext)
+ Notification.Builder builder = new Notification.Builder(mContext)
.setSmallIcon(R.drawable.stat_sys_phone_call_forward)
.setColor(subInfo.getIconTint())
.setContentTitle(notificationTitle)
.setContentText(mContext.getString(R.string.sum_cfu_enabled_indicator))
.setShowWhen(false)
.setOngoing(true)
- .setChannel(TelephonyNotificationBuilder.CHANNEL_ID_CALL_FORWARD);
+ .setChannel(NotificationChannelController.CHANNEL_ID_CALL_FORWARD);
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
@@ -552,12 +552,12 @@
final CharSequence contentText = mContext.getText(R.string.roaming_reenable_message);
- final Notification.Builder builder = new TelephonyNotificationBuilder(mContext)
+ final Notification.Builder builder = new Notification.Builder(mContext)
.setSmallIcon(android.R.drawable.stat_sys_warning)
.setContentTitle(mContext.getText(R.string.roaming))
.setColor(mContext.getResources().getColor(R.color.dialer_theme_color))
.setContentText(contentText)
- .setChannel(TelephonyNotificationBuilder.CHANNEL_ID_MOBILE_DATA_ALERT);
+ .setChannel(NotificationChannelController.CHANNEL_ID_MOBILE_DATA_ALERT);
List<UserInfo> users = mUserManager.getUsers(true);
for (int i = 0; i < users.size(); i++) {
@@ -589,14 +589,14 @@
private void showNetworkSelection(String operator) {
if (DBG) log("showNetworkSelection(" + operator + ")...");
- Notification.Builder builder = new TelephonyNotificationBuilder(mContext)
+ Notification.Builder builder = new Notification.Builder(mContext)
.setSmallIcon(android.R.drawable.stat_sys_warning)
.setContentTitle(mContext.getString(R.string.notification_network_selection_title))
.setContentText(
mContext.getString(R.string.notification_network_selection_text, operator))
.setShowWhen(false)
.setOngoing(true)
- .setChannel(TelephonyNotificationBuilder.CHANNEL_ID_ALERT);
+ .setChannel(NotificationChannelController.CHANNEL_ID_ALERT);
// create the target network operators settings intent
Intent intent = new Intent(Intent.ACTION_MAIN);