Loading services/core/java/com/android/server/notification/NotificationManagerService.java +15 −1 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ import android.os.IInterface; import android.os.Looper; import android.os.Message; import android.os.Parcelable; import android.os.PersistableBundle; import android.os.Process; import android.os.RemoteException; import android.os.SystemClock; Loading @@ -112,6 +113,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.NotificationRankingUpdate; import android.service.notification.StatusBarNotification; import android.service.notification.ZenModeConfig; import android.telephony.CarrierConfigManager; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.text.TextUtils; Loading Loading @@ -305,6 +307,8 @@ public class NotificationManagerService extends SystemService { private RankingHandler mRankingHandler; private long mLastOverRateLogTime; private float mMaxPackageEnqueueRate = DEFAULT_MAX_NOTIFICATION_ENQUEUE_RATE; private PersistableBundle mCarrierConfig; private CarrierConfigManager mConfigManager; private static class Archive { final int mBufferSize; Loading Loading @@ -1054,6 +1058,8 @@ public class NotificationManagerService extends SystemService { publishBinderService(Context.NOTIFICATION_SERVICE, mService); publishLocalService(NotificationManagerInternal.class, mInternalService); mConfigManager = (CarrierConfigManager) getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE); } private void sendRegisteredOnlyBroadcast(String action) { Loading Loading @@ -2801,7 +2807,15 @@ public class NotificationManagerService extends SystemService { // These are set inside the conditional if the notification is allowed to make noise. boolean hasValidVibrate = false; boolean hasValidSound = false; if (disableEffects == null boolean smsRingtone = false; if (mCarrierConfig == null) { mCarrierConfig = mConfigManager.getConfig(); } else { smsRingtone = mCarrierConfig.getBoolean( CarrierConfigManager.KEY_CONFIG_SMS_RINGTONE_INCALL); } if ((disableEffects == null || (smsRingtone && mInCall)) && (record.getUserId() == UserHandle.USER_ALL || record.getUserId() == currentUser || mUserProfiles.isCurrentProfile(record.getUserId())) Loading telephony/java/android/telephony/CarrierConfigManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -743,6 +743,12 @@ public class CarrierConfigManager { public static final String KEY_MAP_ANONYMOUS_TO_RESTRICTED_BOOL = "carrier_map_anonymous_to_restricted"; /** * Configuration to play sms ringtone during MO/MT call. * @hide */ public static final String KEY_CONFIG_SMS_RINGTONE_INCALL = "config_sms_ringtone_incall"; /** The default value for every variable. */ private final static PersistableBundle sDefaults; Loading Loading @@ -888,6 +894,7 @@ public class CarrierConfigManager { sDefaults.putStringArray(KEY_SIM_PROVISIONING_STATUS_DETECTION_CARRIER_APP_STRING_ARRAY, null); sDefaults.putBoolean(KEY_MAP_ANONYMOUS_TO_RESTRICTED_BOOL, true); sDefaults.putBoolean(KEY_CONFIG_SMS_RINGTONE_INCALL, true); } /** Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +15 −1 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ import android.os.IInterface; import android.os.Looper; import android.os.Message; import android.os.Parcelable; import android.os.PersistableBundle; import android.os.Process; import android.os.RemoteException; import android.os.SystemClock; Loading @@ -112,6 +113,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.NotificationRankingUpdate; import android.service.notification.StatusBarNotification; import android.service.notification.ZenModeConfig; import android.telephony.CarrierConfigManager; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.text.TextUtils; Loading Loading @@ -305,6 +307,8 @@ public class NotificationManagerService extends SystemService { private RankingHandler mRankingHandler; private long mLastOverRateLogTime; private float mMaxPackageEnqueueRate = DEFAULT_MAX_NOTIFICATION_ENQUEUE_RATE; private PersistableBundle mCarrierConfig; private CarrierConfigManager mConfigManager; private static class Archive { final int mBufferSize; Loading Loading @@ -1054,6 +1058,8 @@ public class NotificationManagerService extends SystemService { publishBinderService(Context.NOTIFICATION_SERVICE, mService); publishLocalService(NotificationManagerInternal.class, mInternalService); mConfigManager = (CarrierConfigManager) getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE); } private void sendRegisteredOnlyBroadcast(String action) { Loading Loading @@ -2801,7 +2807,15 @@ public class NotificationManagerService extends SystemService { // These are set inside the conditional if the notification is allowed to make noise. boolean hasValidVibrate = false; boolean hasValidSound = false; if (disableEffects == null boolean smsRingtone = false; if (mCarrierConfig == null) { mCarrierConfig = mConfigManager.getConfig(); } else { smsRingtone = mCarrierConfig.getBoolean( CarrierConfigManager.KEY_CONFIG_SMS_RINGTONE_INCALL); } if ((disableEffects == null || (smsRingtone && mInCall)) && (record.getUserId() == UserHandle.USER_ALL || record.getUserId() == currentUser || mUserProfiles.isCurrentProfile(record.getUserId())) Loading
telephony/java/android/telephony/CarrierConfigManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -743,6 +743,12 @@ public class CarrierConfigManager { public static final String KEY_MAP_ANONYMOUS_TO_RESTRICTED_BOOL = "carrier_map_anonymous_to_restricted"; /** * Configuration to play sms ringtone during MO/MT call. * @hide */ public static final String KEY_CONFIG_SMS_RINGTONE_INCALL = "config_sms_ringtone_incall"; /** The default value for every variable. */ private final static PersistableBundle sDefaults; Loading Loading @@ -888,6 +894,7 @@ public class CarrierConfigManager { sDefaults.putStringArray(KEY_SIM_PROVISIONING_STATUS_DETECTION_CARRIER_APP_STRING_ARRAY, null); sDefaults.putBoolean(KEY_MAP_ANONYMOUS_TO_RESTRICTED_BOOL, true); sDefaults.putBoolean(KEY_CONFIG_SMS_RINGTONE_INCALL, true); } /** Loading