summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java
AgeCommit message (Collapse)Author
2016-04-13Fix crash on call blocking settings open with no contacts permission.Sarmad Hashmi
+Check if app has CONTACTS permission before querying contacts database Fixes: 27977009 Change-Id: If6ed7c31b6a94383d1d3a6a888520b6ed400b037
2016-03-21No notification shown for blocking after E911 callBrandon Maxwell
The Dialer is no longer responsible for showing a notification that call blocking is disabled after the user makes an emergency call. This CL ensures that the notification isn't shown. Change-Id: Ib87679a067831b771d99e5b2b205c84101f05fef Fixes: 27705312
2015-11-30Checking for recent emergency call before deleting voiemailBrandon Maxwell
Bug: 25818151 Change-Id: I6b8b5ebfe1c9555b8394ad7db652e23bbc216f83
2015-11-12Adding Logging to call blocking interactionsBrandon Maxwell
+ Added Clearcut logging when users block, unblock, undo, or import blocked numbers. Location of blocking is noted, e.g. CallLog, CallDetails, ManagementScreen + Added class with Constants matching proto definition Bug: 25288435 Change-Id: I7fbef52d0e31b49c31dadbc0b4d775969d97420a
2015-11-11Blocking number suppresses voicemails in the same minuteBrandon Maxwell
~ Modified FilteredNumbersUtil to check if a voicemail needs to be blocked by checking if the voicemail date matches the block date to the minute, rather than millisecond ~ Modified FilteredNumbersUtil#shouldBlockVoicemail to improve readability + Added tests to verify FilteredNumbersUtil#shouldBlockVoicemail Bug: 25346075 Change-Id: I9851a574f0d13b7f09c99438810454770c88aa8b
2015-11-02Don't try to iterate through empty cursorYorke Lee
Bug: 25429251 Change-Id: If2b4b875e3433f252a34d1afeaf3eaa3a1a3c3fc
2015-10-30Rename check method to isBlockedNumber.Andrew Lee
+ Clearer name about functionality, and async nature. + Change it to return "false" if it fails and is trying to block an invalid number, rather than returning "true". This matches a more standard success/fail return paradigm. + Update logic for showing "invalid" message based on return value. + Simplify parameter set which it takes in; always take nubmer and countryIso, because they can be used to calculate the normalized #. Bug: 25343277 Change-Id: If6fb28a6395e207047f4b27bfac37f5c70a9bac3
2015-10-30Merge "Fix checking for invalid numbers." into ub-contactsdialer-a-devAndrew Lee
2015-10-30Fix checking for invalid numbers.Andrew Lee
Some of the checking for invalid numbers was broken by code cleanups yesterday, and blocking of numbers which can't be normalized had been allowed (which is no good). Fixing this, by unifying checks for whether or not a number can be blocked. Bug: 25343277 Change-Id: Ia631a3e53e3f9ed58e173055a5e18086d95c9d02
2015-10-30Merge "Always hide blocked calls." into ub-contactsdialer-a-devAndrew Lee
2015-10-30Merge "Cleanup variable naming for easier reading." into ub-contactsdialer-a-devAndrew Lee
2015-10-30Always hide blocked calls.Andrew Lee
- Remove setting for show/hide. - Remove utilities and behaviors for show/hide. ~ Continue filtering blocked call types in call log (which may be marked by other applications.) ~ Change behavior after blocking call; instead of keeping the call log entry but changing the type to BLOCKED, delete it instead. + Default behavior is now to delete entries and visual voicemails of blocked calls. Bug: 25378068 Bug: 25106387 Change-Id: I8cbc419b25cce6ba39099857cffe4eb1df9d0bef
2015-10-29Dismiss blocking disabled notification after touch.Andrew Lee
Before, it would linger around, even after the user had touched it and visited the settings screen. Feels like more standard behavior for it to be dismissed at this point (user has clearly seen it, and it doesn't really contain any info which needs to persist). Bug: 25377379 Change-Id: I5608a3d735fd084f4493c0fcd51d9dcedf04dc6f
2015-10-29Cleanup variable naming for easier reading.Andrew Lee
Bug: 25343277 Change-Id: I166a142f1537835b13afb2d15c0893aacda4eedd
2015-10-28Rename activity for blocked numbers settings.Andrew Lee
Manage is more related to a specific screen, new name seems to make more sense based on location in settings menu of application. Bug: 25343277 Change-Id: Ia45c1b7aa91c045078fd1473500f5d474e1c598f
2015-10-28Merge "Notify for call blocking disabled by E911." into ub-contactsdialer-a-devAndrew Lee
2015-10-28Notify for call blocking disabled by E911.Andrew Lee
+ Add method and listener to FilteredNumberAsyncQueryHandler to query for whether there are any blocked numbers. + Added utility function for showing a notification, which points to the blocked numbers setting screen. This notification will only be shown if the user has blocked numbers. + Add a boolean flag to track whether we have shown this notification after an emergency call. This is to address the (edge) case where the user makes an emergency call when they have not blocked any numbers, but then later blocks a number. + Added strings for notification. Bug: 25327365 Change-Id: I3179f3884271ea0a504ef8c9a61bf9dfbd18ef10
2015-10-28Disable call blocking for SIP numbers.Andrew Lee
Bug: 25342525 Change-Id: I9a845ffa25323b53175dc0eac2da1f2b4311abe3
2015-10-27Provide debug hook for call blocking / E911.Andrew Lee
Add a systems settings config, which is checked for the delay threshold if a particular debug VERBOSE logging mode is used. Usage: adb shell setprop log.tag.DebugEmergencyCall VERBOSE adb shell settings put system dialer_emergency_call_threshold_ms 60000 Bug: 25216954 Change-Id: Ia9b179e16819d3d8232cbedd49d5744d7b69a825
2015-10-26Merge "Allow voicemail numbers to be blocked." into ub-contactsdialer-a-devAndrew Lee
2015-10-26Allow voicemail numbers to be blocked.Andrew Lee
Though it is lighter on logic now, it still seems helpful to have a common helper to return whether it should be possible to proceed with blocking a number. Bug: 25230222 Change-Id: I99f93f1cfc09988b3dec77f71541463c96d06225
2015-10-21Disable call blocking after emergency call.Andrew Lee
Will be disabled for 48 hours after an emergency call. + Add utility for noting last time of an emergency call. + Add utility for comparing current time to last time of an emergency call. + If current time is within 48 hours of emergency call, display text in settings explaining why call blocking is disabled. Bug: 24418319 Change-Id: I6824340f04fae17b73f17843a9f6ef991afa0327
2015-10-20Add import fragment, rearrange fragments.Andrew Lee
+ Add a fragment (and adapter) for displaying numbers from contacts marked as send to voicemail. This fragment has import functionality. + Refactor logic around the Blocked Numbers activity; relocate a lot of the fragment-specific logic, particularly around actionbars, to within the fragments themselves. + Simplify fragment management logic by using replace instead of show/hide. Bug: 23351616 Change-Id: I5c1076d6d001a8401234f57c27ada4bcd90e6c27
2015-10-20Delete voicemails from blocked users.Andrew Lee
+ Delete voicemail when the notification is received if the number is blocked and the "hide" setting is set to true. + Changed utility to take time into account; only block voicemail notifications and delete voicemails if the voicemails are from after the time when the number was blocked. Bug: 24134270 Change-Id: I2f3b24d6291a6cec4a7d8530b00dd5a4656ab024
2015-10-20Add setting for hiding blocked calls.Andrew Lee
+ Add settings switch to blocked number settings. + Add utility for checking/setting whether calls should be blocked. + Filter out blocked calls in call log query, if appropriate. + Refresh call log fragment after a change in setting. Followup work: delete voicemails for calls by blocked numbers after the time when the user blocked them. Bug: 24134270 Change-Id: I85088697559ef6fb446b82617f14f1c6fa893df1
2015-10-19Disable VM notification for blocked numbers.Andrew Lee
+ Added a utility to do a synchronous lookup for whether a number is blocked, but it should not be used normally from the UI thread. + Change voicemail notifier code to obtain countryIso, and pass back list of calls to notify as list (to make it easier to remove elements). Bug: 23944007 Change-Id: Iad1f8ee200b8f8734be3db0504482fcdee61e412
2015-10-19Don't allow blocking of emergency or VM numbers.Andrew Lee
Bug: 24680730 Bug: 24303461 Change-Id: Ibd7d431355ca97eb2ae7f29537809987a8d5f96d
2015-10-16Add import for SEND_TO_VOICEMAIL.Andrew Lee
+ Add utility class for async import functions. + Move check for contacts with SEND_TO_VOICEMAIl to util. + Add function for adding phone numbers of contacts with SEND_TO_VOICEMAIL to the block list, then clearing the SEND_TO_VOICEMAIL flag. + Fixed bug where the import text would not be shown for an empty block list. Rearranged layouts slightly to facilitate this. + Protect against null listeners in FilteredNumberAsyncQueryHandler. Bug: 23351616 Change-Id: Id526e16f20a3d28966bbc5e458cecfcd03ecb20f