Loading src/java/com/android/internal/telephony/CarrierServiceStateTracker.java +20 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,8 @@ public class CarrierServiceStateTracker extends Handler { @VisibleForTesting public static final String ACTION_NEVER_ASK_AGAIN = "SilenceNoWifiEmrgCallingNotification"; public static final String ACTION_NEVER_ASK_AGAIN = "com.android.internal.telephony.action.SILENCE_WIFI_CALLING_NOTIFICATION"; public final NotificationActionReceiver mActionReceiver = new NotificationActionReceiver(); @VisibleForTesting Loading Loading @@ -733,6 +734,7 @@ public class CarrierServiceStateTracker extends Handler { public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(ACTION_NEVER_ASK_AGAIN)) { Rlog.i(LOG_TAG, "NotificationActionReceiver: ACTION_NEVER_ASK_AGAIN"); dismissEmergencyCallingNotification(); // insert a key to silence future notifications SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit(); Loading @@ -743,5 +745,22 @@ public class CarrierServiceStateTracker extends Handler { context.unregisterReceiver(mActionReceiver); } } /** * Dismiss the notification when the "Do Not Ask Again" button is clicked */ private void dismissEmergencyCallingNotification() { if (!mFeatureFlags.stopSpammingEmergencyNotification()) { return; } try { NotificationType t = mNotificationTypeMap.get(NOTIFICATION_EMERGENCY_NETWORK); if (t != null) { cancelNotification(t); } } catch (Exception e) { Rlog.e(LOG_TAG, "dismissEmergencyCallingNotification", e); } } } } Loading
src/java/com/android/internal/telephony/CarrierServiceStateTracker.java +20 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,8 @@ public class CarrierServiceStateTracker extends Handler { @VisibleForTesting public static final String ACTION_NEVER_ASK_AGAIN = "SilenceNoWifiEmrgCallingNotification"; public static final String ACTION_NEVER_ASK_AGAIN = "com.android.internal.telephony.action.SILENCE_WIFI_CALLING_NOTIFICATION"; public final NotificationActionReceiver mActionReceiver = new NotificationActionReceiver(); @VisibleForTesting Loading Loading @@ -733,6 +734,7 @@ public class CarrierServiceStateTracker extends Handler { public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(ACTION_NEVER_ASK_AGAIN)) { Rlog.i(LOG_TAG, "NotificationActionReceiver: ACTION_NEVER_ASK_AGAIN"); dismissEmergencyCallingNotification(); // insert a key to silence future notifications SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit(); Loading @@ -743,5 +745,22 @@ public class CarrierServiceStateTracker extends Handler { context.unregisterReceiver(mActionReceiver); } } /** * Dismiss the notification when the "Do Not Ask Again" button is clicked */ private void dismissEmergencyCallingNotification() { if (!mFeatureFlags.stopSpammingEmergencyNotification()) { return; } try { NotificationType t = mNotificationTypeMap.get(NOTIFICATION_EMERGENCY_NETWORK); if (t != null) { cancelNotification(t); } } catch (Exception e) { Rlog.e(LOG_TAG, "dismissEmergencyCallingNotification", e); } } } }