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

Commit fe19b40a authored by Chen Xu's avatar Chen Xu Committed by android-build-merger
Browse files

Merge "support locale change for notification channels" into oc-dev

am: f3f52f5c

Change-Id: I06a3f5dc5b7adf3cba186e80a77e7c1d24bdedaa
parents 673f5dc7 f3f52f5c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import android.provider.Settings;
import android.telephony.CarrierConfigManager;
import android.telephony.Rlog;

import com.android.internal.telephony.util.TelephonyNotificationBuilder;
import com.android.internal.telephony.util.NotificationChannelController;

/**
 * This contains Carrier specific logic based on the states/events
@@ -166,7 +166,7 @@ public class CarrierServiceStateTracker extends Handler {
                context.getText(com.android.internal.R.string.NetworkPreferenceSwitchSummary);


        Notification mNotification = new TelephonyNotificationBuilder(context)
        Notification mNotification = new Notification.Builder(context)
                .setWhen(System.currentTimeMillis())
                .setAutoCancel(true)
                .setSmallIcon(com.android.internal.R.drawable.stat_sys_warning)
@@ -176,7 +176,7 @@ public class CarrierServiceStateTracker extends Handler {
                .setStyle(new Notification.BigTextStyle().bigText(details))
                .setContentText(details)
                .setContentIntent(settingsIntent)
                .setChannel(TelephonyNotificationBuilder.CHANNEL_ID_ALERT)
                .setChannel(NotificationChannelController.CHANNEL_ID_ALERT)
                .build();

        notificationManager.notify(NOTIFICATION_ID, mNotification);
+3 −3
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ import android.text.TextUtils;

import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.util.TelephonyNotificationBuilder;
import com.android.internal.telephony.util.NotificationChannelController;
import com.android.internal.util.HexDump;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
@@ -911,7 +911,7 @@ public abstract class InboundSmsHandler extends StateMachine {
            0,
            new Intent(ACTION_OPEN_SMS_APP),
            PendingIntent.FLAG_ONE_SHOT);
        Notification.Builder mBuilder = new TelephonyNotificationBuilder(mContext)
        Notification.Builder mBuilder = new Notification.Builder(mContext)
                .setSmallIcon(com.android.internal.R.drawable.sym_action_chat)
                .setAutoCancel(true)
                .setVisibility(Notification.VISIBILITY_PUBLIC)
@@ -919,7 +919,7 @@ public abstract class InboundSmsHandler extends StateMachine {
                .setContentTitle(mContext.getString(R.string.new_sms_notification_title))
                .setContentText(mContext.getString(R.string.new_sms_notification_content))
                .setContentIntent(intent)
                .setChannelId(TelephonyNotificationBuilder.CHANNEL_ID_SMS);
                .setChannelId(NotificationChannelController.CHANNEL_ID_SMS);
        NotificationManager mNotificationManager =
            (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
        mNotificationManager.notify(
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import com.android.internal.telephony.sip.SipPhone;
import com.android.internal.telephony.sip.SipPhoneFactory;
import com.android.internal.telephony.uicc.IccCardProxy;
import com.android.internal.telephony.uicc.UiccController;
import com.android.internal.telephony.util.NotificationChannelController;
import com.android.internal.util.IndentingPrintWriter;

import java.io.FileDescriptor;
@@ -80,6 +81,7 @@ public class PhoneFactory {
    static private SubscriptionMonitor sSubscriptionMonitor;
    static private TelephonyNetworkFactory[] sTelephonyNetworkFactories;
    static private ImsResolver sImsResolver;
    static private NotificationChannelController sNotificationChannelController;

    static private final HashMap<String, LocalLog>sLocalLogs = new HashMap<String, LocalLog>();

@@ -232,6 +234,8 @@ public class PhoneFactory {
                sProxyController = ProxyController.getInstance(context, sPhones,
                        sUiccController, sCommandsInterfaces, sPhoneSwitcher);

                sNotificationChannelController = new NotificationChannelController(context);

                sTelephonyNetworkFactories = new TelephonyNetworkFactory[numPhones];
                for (int i = 0; i < numPhones; i++) {
                    sTelephonyNetworkFactories[i] = new TelephonyNetworkFactory(
+3 −3
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ import com.android.internal.telephony.uicc.RuimRecords;
import com.android.internal.telephony.uicc.SIMRecords;
import com.android.internal.telephony.uicc.UiccCardApplication;
import com.android.internal.telephony.uicc.UiccController;
import com.android.internal.telephony.util.TelephonyNotificationBuilder;
import com.android.internal.telephony.util.NotificationChannelController;
import com.android.internal.util.IndentingPrintWriter;

import java.io.FileDescriptor;
@@ -3857,7 +3857,7 @@ public class ServiceStateTracker extends Handler {
                    + ", title: " + title + ", details: " + details);
        }

        mNotification = new TelephonyNotificationBuilder(context)
        mNotification = new Notification.Builder(context)
                .setWhen(System.currentTimeMillis())
                .setAutoCancel(true)
                .setSmallIcon(icon)
@@ -3866,7 +3866,7 @@ public class ServiceStateTracker extends Handler {
                        com.android.internal.R.color.system_notification_accent_color))
                .setContentTitle(title)
                .setContentText(details)
                .setChannel(TelephonyNotificationBuilder.CHANNEL_ID_ALERT)
                .setChannel(NotificationChannelController.CHANNEL_ID_ALERT)
                .build();

        NotificationManager notificationManager = (NotificationManager)
+3 −6
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.os.UserHandle;

import android.provider.Telephony;
import android.telecom.VideoProfile;
import android.telephony.CarrierConfigManager;
import android.telephony.PhoneNumberUtils;
@@ -55,7 +54,6 @@ import com.android.ims.ImsEcbm;
import com.android.ims.ImsEcbmStateListener;
import com.android.ims.ImsException;
import com.android.ims.ImsManager;
import com.android.ims.ImsMultiEndpoint;
import com.android.ims.ImsReasonInfo;
import com.android.ims.ImsSsInfo;
import com.android.ims.ImsUtInterface;
@@ -101,7 +99,7 @@ import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.UUSInfo;
import com.android.internal.telephony.gsm.SuppServiceNotification;
import com.android.internal.telephony.uicc.IccRecords;
import com.android.internal.telephony.util.TelephonyNotificationBuilder;
import com.android.internal.telephony.util.NotificationChannelController;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -1552,8 +1550,7 @@ public class ImsPhone extends ImsPhoneBase {
                                PendingIntent.FLAG_UPDATE_CURRENT
                        );

                final Notification notification =
                        new TelephonyNotificationBuilder(mContext)
                final Notification notification = new Notification.Builder(mContext)
                                .setSmallIcon(android.R.drawable.stat_sys_warning)
                                .setContentTitle(title)
                                .setContentText(messageNotification)
@@ -1561,7 +1558,7 @@ public class ImsPhone extends ImsPhoneBase {
                                .setContentIntent(resultPendingIntent)
                                .setStyle(new Notification.BigTextStyle()
                                .bigText(messageNotification))
                                .setChannelId(TelephonyNotificationBuilder.CHANNEL_ID_WFC)
                                .setChannelId(NotificationChannelController.CHANNEL_ID_WFC)
                                .build();
                final String notificationTag = "wifi_calling";
                final int notificationId = 1;
Loading