summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Cache repeated Telecom requests from call log.Andrew Lee2015-06-264-24/+24
| | | | | | | | | | | | | This improves call log scrolling performance. + Split "Wrapper" into a utility and a cache. + Use cache for repeated calls related to call logs. + In the process of fixing plumbing and typer, moved some phone call detail classes into the more appropriate call log package. + Update tests. Bug: 20524705 Change-Id: Ib8ee21e417c19f98f6474a5793416e8f99103b55
* Rewrite of MediaPlayer logic.Andrew Lee2015-06-191-1/+1
| | | | | | | | | | | | | | | | + Control MediaPlayer instance more tightly. Wait until prepareContent to initialize instance. Release MediaPlayer when it is no longer needed. + Instead of using isFinishing, check explicitly for orientation change to know whether to release MediaPlayer. + Change Presenter to singleton, to address audio change wonkiness. + Only create a Presenter if the call log fragment shows voicemail. + ... fixing a variety of cases. - Temporarily disable proximity sensor until blocking issue is fixed. Bug: 21856243 Change-Id: Ic06e98bb5278467c3cce726a06b6cf3d855861a2
* Pass activity into VoicemailPlaybackPresenter.Andrew Lee2015-06-181-6/+13
| | | | | | | | We will use it to set windows flags to help make playback behaviors reasonable. Bug: 21856243 Change-Id: I7c1ecb9e225a507ea8956ccc31d667361a4b6824
* Add play voicemail primary action to call log.Andrew Lee2015-06-151-3/+1
| | | | | | | | | | | | | | | | | | | + Add voicemail primary action button, which expands the call log and plays immediately when clicked. + Pass expand/collapse listener into the view holder. This is necessary because it needs to be triggered when the "play" primary action is clicked so that the CallLogAdapter correctly registers what has been added and binded. + Update primary action button state when showing or hiding actions, so the visibility of the voicemail play button is managed properly. + Ensure voicemail playback state is consistent between multiple call log items when the user initiates a collapse or expand. Add reset function to help manage this. + With the reset, protect against the possibility of functions in the presenter being called when no voicemail playback view is set. Bug: 21654755 Change-Id: I7bcf67d27fa08fe77d1334dc084b52effe8d3ccc
* Merge "Fix abundance of "Custom" labels." into mnc-devAndrew Lee2015-06-152-7/+0
|\
| * Fix abundance of "Custom" labels.Andrew Lee2015-06-152-7/+0
| | | | | | | | | | | | | | | | | | | | | | Not sure precisely why this changed, but hopefully this logic is more robust. Show the geocoded location if there is no name to use and a location is available. Removed GEOCODE_AS_LABEL, which wasn't really used anymore. Bug: 21814339 Change-Id: I1343282ef415647853d7995d900a3f50186ad156
* | Merge "Fix VoicemailPlaybackTest flakiness." into mnc-devAndrew Lee2015-06-151-0/+2
|\ \
| * | Fix VoicemailPlaybackTest flakiness.Andrew Lee2015-06-151-0/+2
| |/ | | | | | | Change-Id: I9568ab3236ab02125c3d7da5f8a477df34bd7499
* / Convert to primary action button on call log items.Andrew Lee2015-06-122-7/+9
|/ | | | | | | | + This is the call button on the standard call log list item, but will be play on voicemail call log list items. + Add call "list" action for voicemail call log list items. Change-Id: I4b115b96738b77c8a19c1071d5290e65f93395ac
* Move "Report" to CallDetailActivity.Andrew Lee2015-06-102-2/+2
| | | | | | | | | - Delete old report button/handling code. + Convert menu click listeners into single onMenuItemClick method. + Add and populate objectId on PhoneCallDetails, to be able to tell from the CallDetailActivity whether to enable reporting. Change-Id: Ie4b9a3c1835792cbba04dc826f71fd2e53071400
* Merge "Change PhoneCallDetail fields to be non-final." into mnc-devAndrew Lee2015-06-102-363/+129
|\
| * Change PhoneCallDetail fields to be non-final.Andrew Lee2015-06-102-363/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's been a pain to add/change fields on PhoneCallDetails because a multitude of parameters required for the constructors to create an instance. I ran into this while considering how to add an objectId to its parameters, and have previously too... Make fields non-final so that they are more easily set. This has the side-effect of making the casing of some initialization code more straightforward. + Change it's constructor to a subset of required fields. + Simplify/reorganize CallLogAdapter and CallLogAsyncTaskUtil code. + Simplify tests. Bug: 21733599 Change-Id: I236dfb0b8e6513f4b44dbdae17ce2eb9c9ae4778
* | Fix CallLogFragment UnitTests.Andrew Lee2015-06-091-2/+8
| | | | | | | | | | | | | | | | | | Run "changeCursor" on the main thread. I'm not precisely sure why this fixes things, but it appeared before that the data I had on my local device was being used instead of the test data. Bug: 21471763 Change-Id: I6bece02e7c6828d54f76b5221ad10cf8f0052aa9
* | Fix some more unit tests...Andrew Lee2015-06-092-159/+233
|/ | | | | | | | | + Pull out voicemail playback tests into their own test class. + Fix CallDetailActivity unit tests. + Some minor tweaks to functional code to facilitate. Bug: 21471763 Change-Id: I0f1747ab7ad6eba7dd2a7f6f8cfd060b409771bc
* Merge "Move VM playback from details to call log." into mnc-devAndrew Lee2015-06-043-25/+18
|\
| * Move VM playback from details to call log.Andrew Lee2015-06-033-25/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Delete voicemail playback in the CallDetailActivity. + Add voicemail playback to the call log list items. + Move the VoicemailPlaybackPresenter to the CallLogFragment. + Fix some retaining state for both call log (expanded items), and preserve rotation/state functionality for voicemail playback. This included some changes to the Presenter logic. + Fix some tests. Bug: 21471763 Bug: 21170557 Change-Id: I30aae3a52c5bbf74a5075a9666343c337b1fc0df
* | Fix unit test errors.Andrew Lee2015-06-031-4/+21
|/ | | | | | | | | | | | | When this was refactored before, some of the logic was bad. Some of the expected values were changed as well. I figured "add to contacts" is a really bad default text, because we don't actually support that action in call details. Also, the strings returned by the library for describing relative time spans changed. Bug: 21471763 Change-Id: I0c78c89c9c2e44de198f1f9299711fc31fe81cb1
* Fix CallDetailActivity tests.Andrew Lee2015-06-013-23/+30
| | | | | | | | | | | | | | | | | + Reset the AsyncTaskExecutor's instance between calls in tests. I don't know why this is necessary, but it fixes a class of problems which were happening. + Don't try to release a media player if it has not been prepared. + Handle possible race conditions since MediaPlayer's async prepare may be buffering or finished when a test assert is executed. + Add asset file no longer provided by variablespeed library. - Cleanup some stream copy code. Change-Id: I0ae5fde00514c6dcdb1e9c063435a13eed6e8528
* Refactor Voicemail Playback into standalone view.Andrew Lee2015-05-271-5/+1
| | | | | | | | | | | | | | | | | | + Substitutes the existing playback widget in CallDetailActivity, although the plan is to move this to the call log shortly. + Convert the widget from a fragment into a layout. This allows us to more easily create multiple instances of the voicemail widget in the same view, as we intend to do in the call log. + Shift UI-related logic from Presenter to the Layout. + Fix janky seeking, so that it now works correctly consistently rather than sporadically, and doesn't need to buffer again. - Remove the VariableSpeed player formerly used in the Presenter. We don't use this functionality anymore, and this allows us to directly used the framework MediaPlayer (instead of a custom legacy proxy). Bug: 21170557 Bug: 20693172 Change-Id: Ia34f459df10e43763b32fdb0954f83e882664231
* Add AsyncTaskUtil for call log actions.Andrew Lee2015-05-191-2/+2
| | | | | | | | | | | | | | + Factors out async tasks from Call Detail activity, so that in the near future it can be invoked from the call log directly. + Create listener interfaces for actions to execute after tasks have been completed. + Should have no logical/behavioral changes. Hopefully, this creates a more opaque interface for activities or other classes to perform these actions as well. Bug: 21170557 Change-Id: I43aea7e37600d3978e285f047cba7ce75ebb5787
* Performance improvements to call log scrolling.Andrew Lee2015-05-192-103/+290
| | | | | | | | | | | | | | | | | | - Remove call to CallUtil to check if video is enabled. It seems like it's fine to include the content description of what the call was, if it was a video call, even if there is not a video-enabled call account. - Factor out PhoneNumberDisplayHelper so it doesn't need to be an instance. This reduces some extra calls to getDisplayNameHelper. Probably a marginal difference, performance-wise, but it probably helps a smidgen and also simplifies the need for creating and passing or recalculating various instances of things. TODO: It'd be much better if PhoneCallDetails had a builder. It's terribly painful to fix all the tests when adding fields... Change-Id: I6da13dc8b6b047043aba871796a8ed13b112a227
* Change VM playback fragment layout.Andrew Lee2015-05-141-25/+0
| | | | | | | | | - Remove increase/decrease playback rate functionality. - Flip button controls below the scrubber. - Delete TextController. Bug: 20433758 Change-Id: Id628bac0c9f8baed014079f2a89ce912fd2bb549
* Reorganize Intent utilities, add send SMS intent.Andrew Lee2015-05-131-1/+1
| | | | | | | | | + Rename CallIntentUtils.java to IntentUtil.java. + Consolidate various intent creation methods to new file, and update referenes throughout the application. Bug: 20433758 Change-Id: Iee9e37985217c38c816124d0e74dff40a2871680
* Indicate whether CallLogAdapter is for Recents.Andrew Lee2015-05-121-1/+1
| | | | | Bug: 20924950 Change-Id: I6163565ec508d245afd83112927d636a4a50f27e
* Use TelecomManager.placeCall APIYorke Lee2015-04-231-1/+1
| | | | | Bug: 20348183 Change-Id: If1b193f933b4a7b2b322784b0cbbc66c210b25df
* Move call log actions into expandable view.Andrew Lee2015-04-163-88/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This isn't the prettiest thing ever, but with this the "framework" of all of the changes for the new visual style of the call logs is in place. From here on out, the remainder of tasks should be unblocked and relatively independent. + Rename ...ItemViews to ...ItemViewHolder. This probably wasn't completely necessary, but is more proper given the new architecture. + ViewHolder is now officially where most of the independent UI logic for a single call log list item should live. This changelist moves further in that direction by storing references and helpers in it, to lessen what must be passed in from the adapter. + Split out the call action from the rest of the actions, since it has a special treatment on the card. + Convert text action buttons into a vertical stack. + Consolidate action stylings into a single style, for simplicity. + Miscellaneous style and string changes to put things in a better state. This included tweaking some of the (ripple) backgrounds. + Update tests, according to changes. Bug: 19372817 Change-Id: Ic923c0bcbbc1c153952131d0c772df9e9589fb03
* Replace ListView with RecyclerView in call log.Andrew Lee2015-04-093-89/+91
| | | | | | | | | | | | | | | | | | | | | | | | Yay, finally! + Replace ListView with RecyclerView in layout and fragment files. + Change GroupingListAdapter to extend RecyclerView.Adapter instead of BaseAdapter. + Change CallLogListItemViews to extend RecyclerView.ViewHolder. + Adapt onBindViewHolder and onCreateViewHolder methods in the CallLogAdapter. + Update/rework tests for related classes. + Fix a bug in the GroupingListAdapter, where childCount was not updated for standalone views, and the previously cached group size was used instead. Set childCount to 1 for standalone views. - Removed the idea of creating different views for standalone vs group vs group headers from the adapters. This logic has not been used for quite some time and all these functions funneled into createView/bindView methods anyways, so there is no logical difference. If we need to create custom views in the future, we can leverage onCreateViewHolder's viewType parameter. Bug: 19372817 Change-Id: I1b7289340600609669db22d8bc89265240d0b561
* Move some CallLog testing from adapter to fragment.Andrew Lee2015-04-091-14/+27
| | | | | | | | - Remove custom testing method formerly in the adapter. - Remove unused expand animate code. Bug: 19372817 Change-Id: I78489d63ac9c3324cd80f8039d14a41813772e11
* Merge "Remove expand/collapse animations in the Call Log."Andrew Lee2015-04-081-1/+1
|\
| * Remove expand/collapse animations in the Call Log.Andrew Lee2015-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove animation logic in CallLogFragment. - Remove expand listener from CallLogAdapter. + Update tests and constructor. This preemptively removes expand/collapse behavior. While this will result in a janky short-term experience, this is an incremental step in shifting to RecyclerView and the new "Card" UI. I figured it would be most efficient to delete it straight up, rather than coding in intermediate logic to work with the RecyclerView because it will be made obsolete by the Cards UI anyways. In the long run, expand/collapse animation behavior will be restored once the call log is migrated to RecyclerView and converted to Cards. Bug: 19372817 Change-Id: Icbdc7dcb9f2f2223456c29334c826d38917b087a
* | Move copy of GroupingListAdapter to Dialer app.Andrew Lee2015-04-071-0/+311
|/ | | | | | | | | | | | | | | | + Copied in from com.android.common.widget. This component is pretty specific to phone number / call log grouping anyways. + Changed CallLogAdapter to reference this GroupingListAdapter instead of the one in the framework library. + Changed CallLogGroupBuilder to reference this adapter too. + Copy in tests too. Next step: change GroupingListAdapter to extend RecyclerView.Adapter. This will preserve existing grouping logic, despite switching to the new view. Bug: 19372817 Change-Id: Ic0186ca5fad06a3ae398b9d8f8006210077149dc
* Merge "Create ContactInfoCache from CallLogAdapter."Andrew Lee2015-04-062-15/+28
|\
| * Create ContactInfoCache from CallLogAdapter.Andrew Lee2015-04-032-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | This pulls code from the CallLogAdapter, with only tweaks to variable names and comments, to create a ContactInfoCache responsible for logic pertaining to looking up and caching contact info. The logic is intended to be unchanged for now, although in the future it can/should probably be cleaned up sometime. Bug: 20038300 Change-Id: I60a57b0a665496522a6b51c9e6e41a4fd6dbad1f
* | Stop using static common test lib. Fix Jack buildBrian Attwell2015-04-011-1/+5
|/ | | | | | | This is an exact copy of ag/655143. Bug: 19667686 Change-Id: I36d5e3e91b0e58e0fc4ecb4a3068c994f9b90111
* Fix image-related GoogleDialer compiler warnings.Andrew Lee2015-03-252-1/+0
| | | | | | | | | Fix warnings of form: "libpng warning: iCCP: Not recognizing known sRGB profile that has been edited". Most of these were swaped by replacing the old assets with newer or equivalent versions. Bug: 19536005 Change-Id: I0535c0876806607f4aa170a5839829fff367ab9a
* Add CACHED_PHOTO_URI to test valuesYorke Lee2015-03-201-1/+1
| | | | Change-Id: I4cbc6d79985680b4b5fc6e807fb30908352900b5
* Delete call log list item extras.Andrew Lee2015-03-161-1/+1
| | | | | | | | | | | | | | | - Remove isCallLog specific code from adapter; now everything will always be in the call log. - Remove unneeded adapter bits from ListsFragment; there is now no shortcut card shown in the lists fragment. - Remove call log list item extra. We won't bind badges using this any more. This will be superseded by the actions. Remove badge-related code in CallLogAdapter. + Leaving the add-person icon, since it will be used in the future. Bug: 19372817 Bug: 19627987 Change-Id: I4db8149761b017e02e89c081930a05f3aafe9606
* Only consider toString value of TtsSpan for unit testsYorke Lee2015-03-021-1/+1
| | | | Change-Id: I84da99d70801a6d1621de0883b801fa43ea5e5fd
* Fix some Dialer testsYorke Lee2015-02-272-4/+2
| | | | Change-Id: I46188070997ebc9b69f7d9b5a8ba9cb3c221b743
* Remove call to deleted method AsyncTask.init().Jeff Brown2014-11-141-7/+0
| | | | | Bug: 18192406 Change-Id: I94df77ad8aaac8da5583ab80572c0bbd120b980e
* Merge "Refactor ActionBarController and tests" into lmp-mr1-devYorke Lee2014-10-291-38/+9
|\
| * Refactor ActionBarController and testsYorke Lee2014-10-281-38/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original CL to fix ActionBarControllerTest by using an ActivityInstrumentationTestCase was too heavyweight and caused flaky test. It was also indicative of a flaw in the original design that ActionBar couldn't be mocked out easily. Refactor the code so that: 1) getActionBar() is no longer needed 2) Respect the invariant that all access to the actionBar goes through the ActionBarController (see the changes in ListsFragment) so that any change to the ActionBar's hide offset can be tracked appropriately. Bug: 17487016 Change-Id: I935b683ddb301ca5d3952889af1381bdbdcc97d3
* | More test-related changesYorke Lee2014-10-282-2/+9
| | | | | | | | | | | | | | | | | | Fix failure in CallLogListItemHelper#testGetCallDescription_Video Add some documentation to CallDetailActivityTest Bug: 17487016 Change-Id: I31594feccb936500b20e13f3db5c68cbe5435c6e
* | Merge "Fix some broken Dialer tests" into lmp-mr1-devYorke Lee2014-10-273-4/+13
|\ \
| * | Fix some broken Dialer testsYorke Lee2014-10-253-4/+13
| | | | | | | | | | | | | | | Bug: 17487016 Change-Id: I4c13c3e826a4eb1de84708dfa27ad093b2134087
* | | Merge "Fix NPEs in ActionBarControllerTest" into lmp-mr1-devYorke Lee2014-10-271-3/+36
|\ \ \ | | |/ | |/|
| * | Fix NPEs in ActionBarControllerTestYorke Lee2014-10-251-3/+36
| |/ | | | | | | | | | | | | | | Create a MockActionBar that to prevent NPEs. For this an ActivityInstrumentationTestCase is needed. Bug: 17487016 Change-Id: Ieca95bec22c075ad64a1167e57f6b85f913bcf7e
* / Remove CallLogListItemViewYorke Lee2014-10-241-1/+2
|/ | | | | | | | | CallLogListItemView is a custom view that might have done something once, but doesn't anymore. It makes the code more complicated to read and requires a lot of casting that does nothing at all. Change-Id: I53efb35367d748aa3d164d0fb56686175967c90e
* Enable use of phone accounts for voicemail info display.Nancy Chen2014-10-153-25/+25
| | | | | | | | | | | Call the "isVoicemailNumber(subId, number)" method instead of the one with just the number. This is because we need to check whether a number is the voicemail number for a specific phone account, otherwise the UI would never correctly display "voicemail" for the non-default SIM. Bug:17925501 Change-Id: If1d6cb1acfcb570aca5e639858af8804bac202c0
* Remove ability to enable/disable phoneaccounts (4/6)Nancy Chen2014-09-161-1/+1
| | | | | | | | | Enabling/disabling of phone accounts was only used for SIP accounts and is no longer necessary for the purpose it was put in. Bug: 17510811 Change-Id: I41a2d11cfa85343fdf3f8681f1152d94abd79d2f