diff options
author | Brandon Maxwell <maxwelb@google.com> | 2015-11-20 15:22:00 -0800 |
---|---|---|
committer | Brandon Maxwell <maxwelb@google.com> | 2015-11-30 11:42:02 -0800 |
commit | 2dd62788bbc6aa486899b18869a7fdfaec056314 (patch) | |
tree | a4d0fd20e62535c56894383aea80b62421bdb16c /src | |
parent | 9650e1bb0c9a61be7e9250bd0c47cb5a5d29efff (diff) |
Checking for recent emergency call before deleting voiemail
Bug: 25818151
Change-Id: I6b8b5ebfe1c9555b8394ad7db652e23bbc216f83
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/filterednumber/FilteredNumbersUtil.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java index 23ce8a8de..e3870ded9 100644 --- a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java +++ b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java @@ -31,10 +31,6 @@ import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.widget.Toast; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.TimeUnit; - import com.android.contacts.common.testing.NeededForTesting; import com.android.dialer.R; import com.android.dialer.database.FilteredNumberAsyncQueryHandler; @@ -44,6 +40,8 @@ import com.android.dialer.database.FilteredNumberContract.FilteredNumberColumns; import com.android.dialer.logging.InteractionEvent; import com.android.dialer.logging.Logger; +import java.util.concurrent.TimeUnit; + /** * Utility to help with tasks related to filtered numbers. */ @@ -53,11 +51,11 @@ public class FilteredNumbersUtil { private static final long RECENT_EMERGENCY_CALL_THRESHOLD_MS = 1000 * 60 * 60 * 24 * 2; // Pref key for storing the time of end of the last emergency call in milliseconds after epoch. - private static final String LAST_EMERGENCY_CALL_MS_PREF_KEY = "last_emergency_call_ms"; + protected static final String LAST_EMERGENCY_CALL_MS_PREF_KEY = "last_emergency_call_ms"; // Pref key for storing whether a notification has been dispatched to notify the user that call // blocking has been disabled because of a recent emergency call. - private static final String NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY = + protected static final String NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY = "notified_call_blocking_disabled_by_emergency_call"; public static final String CALL_BLOCKING_NOTIFICATION_TAG = "call_blocking"; @@ -241,6 +239,10 @@ public class FilteredNumbersUtil { return false; } + if (hasRecentEmergencyCall(context)) { + return false; + } + final Cursor cursor = context.getContentResolver().query( FilteredNumber.CONTENT_URI, new String[] { |