summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/precall
AgeCommit message (Collapse)Author
2018-07-10Update translation strings.Eric Erfanian
Test: make Change-Id: Ib75f4f25e91067311de244d7f1fb95bc898aec22
2018-06-28Remove redundant @TargetApi, @RequiresApi and @SuppressWarningslinyuh
Test: Existing tests PiperOrigin-RevId: 202589482 Change-Id: I6982e4069d30032bf46caf3c9984dfc0e7196f6f
2018-06-05Allow CallingAccountSelector to be shown when the device is locked.linyuh
Bug: 80408180 Test: PreCallActivityTest + Manual testing on a Moto device PiperOrigin-RevId: 199387969 Change-Id: I81d19e22f5a26676eb725b32148c43afd43d3119
2018-06-01Inlined ConfigProviderBindings.get() and removed ConfigProviderBindings.zachh
It no longer provides any value, so just use dagger directly. Bug: 80441695 Test: tap PiperOrigin-RevId: 198806461 Change-Id: Id607abb65b77633bce511ad0c943ac19453a85d5
2018-05-21Implement a global theme to be easily configured in Dialer.calderwoodra
deleted several colors and unified them across the app migrated several alert dialogs to support alert dialogs added many todos migrated several tests from GoogleRobolectricTestRunner to RobolectricTestRunner Because of the test migration: - moved dialpad theme attributes into dialpad/theme - moved incall ui theme attributes into incallui/theme Bug: 79883035 Test: tap PiperOrigin-RevId: 197246477 Change-Id: Ifc534793bc32757bbbf2007a7c40287c8d0817ad
2018-05-15Use new instances of PreCallAction on activity resumetwyen
Previously the same action instance is used every time the PreCallActivity is resumed. This causes some state to be retain, for example the isDiscarding state on CallingAccountSelector prevents canceling the next dialog to abort the call. Actions should not retain state between activity life cycles. TEST=TAP Bug: 79692264 Test: TAP PiperOrigin-RevId: 196696224 Change-Id: Ifa604f431563dd1fb123a42e2a64b34c001e897d
2018-05-11Don't show select SIM dialog after the pre call action has been discardedtwyen
If the PreferredAccountWorker completed after a rotation, it might show a dialog from the previous action which is no longer valid. TEST=TAP Bug: 79530586 Test: TAP PiperOrigin-RevId: 196306574 Change-Id: I1d64eb63ad4f0bbe0ccdb7b8f73f638f67c56070
2018-05-11Add @InstallIn and @IncludeInDialerRoot to dagger modules in dialer codebase.weijiaxu
Test: presubmit. PiperOrigin-RevId: 196158524 Change-Id: Iec1e457039e97be0236cd700d397b4095ee3c2c3
2018-05-09Place Duo calls with PreCalltwyen
This CL consolidates common duo calling operations into precall, including checking reachability, falling back to carrier video call, placing the call to duo with startActivityForResult. TEST=TAP Bug: 78783816 Test: TAP PiperOrigin-RevId: 195742478 Change-Id: I9fea1e4999f604e1f3a153b28079cd0db77b7393
2018-04-30Refactor PreferredAccountWorker to provide the dialog to be shown.twyen
When dual SIM selection support is added to In Call UI it was a rush order and codes are duplicated. This CL moves the duplicated logic into PreferredAccountWorker so the same dialog can be shown for both. TEST=manual Bug: 69675796,72618783 Test: manual PiperOrigin-RevId: 194845320 Change-Id: Id283ca7616580b0efd4e8f02e63691c70ee7f93c
2018-04-25Make SIM Selection hint multi-linetwyen
SIM names can be really long and might be truncated if the template placed it at the end of the string. Also removed the char limit on the hint. TEST=TAP Bug: 69675796,72618783 Test: TAP PiperOrigin-RevId: 194163675 Change-Id: I8ee43ce87da80bc6438d2eaad480c63a0d89fbe2
2018-04-25Disable entries in CallingAccountSelector that are not selectabletwyen
This CL also unifies the disabled color for primary and secondary text. The in call UI dialog will be implemented in a followup CL. TEST=TAP DEFAULT_VALUE_OK=no server. Bug: 69675796,72618783 Test: TAP PiperOrigin-RevId: 194147061 Change-Id: I5be5a45a7df09061a3bf391f6ae2a32d9c73b6e3
2018-04-25Add "enabled" to SelectPhoneAccountDialogFragment.twyen
This is used to inform the user an account cannot be used right now. On most dual SIM devices, only a single SIM can make calls at the same time. The UI will be implemented in a followup CL. This CL also packs the parameters of SelectPhoneAccountDialogFragment into a proto. There are too many arguments and it needs structured representation. TEST=TAP Bug: 69675796,72618783 Test: TAP PiperOrigin-RevId: 194139636 Change-Id: I7d9f92c73b650654fff28ba625a2c8e3dfa0b96c
2018-04-24Don't show SIM selection and swap SIM for emergency calls.twyen
TEST=TAP Bug: 73012833,73718978 Test: TAP PiperOrigin-RevId: 194110263 Change-Id: I54dbbaada89e4974030e0b3a397040d4d686bcae
2018-04-19Use PreCall.start instead of context.startActivity when starting calls from ↵zachh
call log. For some reason not understood, startActivity with the call intent causes the current activity (MainActivity) to be paused, resumed, and paused again. This results in an opportunity to double-tap the row which causes the InCallUi to open in bubble mode (this is also not well understood). In any event, PreCall.start eventually uses TelecomManager to place the call rather than startActivity, which is presumably the thing that fixes the problem. Also refactored TestPreCallModule to remove the many test implementations of PreCall and remove the static field in the module which could cause test interference. TEST=manual Bug: 78187587 Test: manual PiperOrigin-RevId: 193596093 Change-Id: I933020d33db1c158628f14b30c2681c59c86201b
2018-03-26Forward extras from pre call external receivers to placeCall().twyen
All extras that CallIntentBuilder handles will be stripped and read into the builder. Other entries will be send to telecom when the intent is build. Renamed CallIntentBuilder.outGoingCallExtras for clarity. Bug: 72877810 Test: Unit tests PiperOrigin-RevId: 190301333 Change-Id: I9a8bf6664b270078d91dbfb3398f8990d243b9f8
2018-03-26Fix UK numbers in international format with extra 0twyen
See class comment on UkRegionPrefixInInternationalFormatHandler Bug: 32501490 Test: Unit tests PiperOrigin-RevId: 190296011 Change-Id: I6f01935f022fc288ad702735b38cb297fb9d2621
2018-03-26Show SIM auto select reason in in call UItwyen
The assisted dialed string will also along show with the "calling via" label. To handle the long string, Top row is now a marquee. Bug: 72571130 Test: Unit tests PiperOrigin-RevId: 190156719 Change-Id: I18a13712bdc9d780f744ef65a1773d249e40fb15
2018-03-07Handle preferred SIM for ACTION_CALLtwyen
Previously preferred SIM is handled only by precall, which covers dialing with dialer or with the special receiver contacts uses. If a third party app uses ACTION_CALL or telecomManager.placeCall(), then the in call UI will be launched directly and the old account selection dialog will be used without preferred SIM support. In this CL logic from CallingAccountSelector is refactored out so InCallActivity can use it for the dialog. Bug: 73718976 Test: Unit tests, In call UI not covered. PiperOrigin-RevId: 188214007 Change-Id: Ifaacf982a3e98601dc362b649c3501d4ee96e63e
2018-03-06Make user able to set default sim when there is no account.yueg
Test: CallingAccountSelectorTest, manual PiperOrigin-RevId: 188089149 Change-Id: Id1be88124e243e46ac9b0277f40de142af6bb5a9
2018-03-02Move assisted dialing out of P.erfanian
Bug: 73727182 Test: tested PiperOrigin-RevId: 187673539 Change-Id: I9c790e912990fb8dc46da1c1057339c979ac9501
2018-02-06Fix NPE when querying preferred without an accounttwyen
Bug: 72986691 Test: Unit tests PiperOrigin-RevId: 184743227 Change-Id: I2e37c2916ce05a72324f68c4530b7f6f3daf23eb
2018-02-02Exit early when phone_lookup returned duplicated results for Preferred SIMtwyen
Previously all results are validated then checked if there are duplicate. In this CL once duplicates are found it will exit early. Bug: 72873001 Test: Existing unit tests. No behavior changes except query counts and latency which we don't test. PiperOrigin-RevId: 184355913 Change-Id: I5ef89c25b100752d939daba69fcfeca3c9d32521
2018-02-01Add suggestion reason ACCOUNTtwyen
Bug: 72817785 Test: Unit tests PiperOrigin-RevId: 184178722 Change-Id: I7154058ab7ac1a94adc781a1aa9a49a3f13c1599
2018-02-01Handle missing contact permission for preferred SIMtwyen
Bug: 72163953,72749906 Test: Unit tests PiperOrigin-RevId: 184167756 Change-Id: I19f4a71fb443fbb31960be486c3c5e996535fc32
2018-01-26Add logging that assisted dialing was used.erfanian
Previously we only logged during degenerative events. Bug: 72174016 Test: none PiperOrigin-RevId: 183392966 Change-Id: Ibf4b8ce08dff39e9bba2f698162683c2431d06eb
2018-01-25Update preferred SIM SuggestionProvidertwyen
"remember this SIM" checkbox state is reported to the provider. The other SIM is reported to the provider when "change SIM" is used Bug: 70503524 Test: Unit tests PiperOrigin-RevId: 183308581 Change-Id: I3d097d14a503c759f130044c9a9c48c420eee19d
2018-01-11Attempt to place call even call permission is missingtwyen
Telecom might still allow emergency calls to be placed if dialer is the default dialer. Bug: 71739167 Test: Unit tests. PiperOrigin-RevId: 181661814 Change-Id: I24063ee42d646c4b614f3fdeb5685490f064a898
2018-01-09Allow SimSuggestionProvider to auto select phone account.twyen
Bug: 70503524 Test: Unit tests. PiperOrigin-RevId: 181400523 Change-Id: I07f2f2cd7c1402d1acb6bfbde9db8d90c888edf6
2018-01-08Use support lib to determine build version.erfanian
Test: none PiperOrigin-RevId: 181185206 Change-Id: I167d9604285f7d5af4f34c6417d0ce1263e64fa1
2018-01-03Only consider writable accounts for preferred SIMtwyen
Some apps will add their own account to contacts and cause PhoneLookup to return multiple accounts. Since Contacts cannot write to these accounts the preferred SIM settings on them does not make sense. In this CL a reduced version of AccountTypeManager is used to determine if the account is writable. External accounts (which capabilities are determined by parsing their sync adapter) are not supported. Bug: 70689051 Test: CallingAccountSelectorTest PiperOrigin-RevId: 180693656 Change-Id: I24e93860cd576777c6d3861f65f75baa234dac87
2017-12-22Enable multi-sim support in assisted dialing.erfanian
* Add a new flag to enable or disable multi-sim support. * Add a new mock method to the ShadowTelephonyMananger to support N+. * Use new O+ API when available. This logic is client specific, and is unecessary in the platform. Bug: 69861007 Test: new unit tests PiperOrigin-RevId: 179970674 Change-Id: Id9889c81e3c196f4a246f0a604d08b81cc906499
2017-12-22Update assisted dialing extras in preparation for platform implementation.erfanian
* Use only one extra as if we were going to make a request of the Platform. * Modify the incallui to handle instances where the platform may not supply TransformationInfo. This should accommodate instances where the platform "used" assisted dialing, but did not provide the necessary TransformationInfo. Test: unit tests PiperOrigin-RevId: 179841752 Change-Id: I06411dc00812dba8978a2a090d8769dcce9b2ad6
2017-12-14Add PreCall step to check permissiontwyen
If CALL_PHONE is missing PreCall will abort immediately and show a toast. Bug: 70565989,70566029 Test: PermissionCheckActionTest PiperOrigin-RevId: 179123070 Change-Id: I0d43c6acd44e77562752c871bed0223b2f787dde
2017-11-30*** Reason for rollback ***roldenburg
Copybara is fixed for AOSP export Bug: 68665330 Test: rollback PiperOrigin-RevId: 177480870 Change-Id: I0ba38e213bb840436fa6dafc4af0a79019ee93f4
2017-11-29Add flag to control default assisted dialing state during precall flow.erfanian
Currently, the only other client that is initiating calls is Contacts, and we consider that to be a non-idle-dial. Bug: 69860859 Test: existing unit tests PiperOrigin-RevId: 177367226 Change-Id: I22de38dc973f5a1eecfe42833110690744c317fd
2017-11-29Adjust strings for select SIM dialogtwyen
Test: N/A PiperOrigin-RevId: 177336359 Change-Id: Icec2eacef55ea6c1b3aad00fe10cde6284c89e25
2017-11-29Prevent PreCallActivity from showing in lockscreen if it is not started in ↵twyen
the lockscreen Bug: 69812359 Test: PreCallActivityTest PiperOrigin-RevId: 177193665 Change-Id: Ic61819b8456ee22c01228d6be2255b3f2c1e418a
2017-11-29Adjust strings for select SIM dialogtwyen
Test: N/A PiperOrigin-RevId: 177075957 Change-Id: Idf4546c57aba72470e07614d2a20d828da8ee08d
2017-11-29Add impressions for dual sim featurestwyen
Bug: 69618691 Test: CallingAccountSelectorTest PiperOrigin-RevId: 177062349 Change-Id: I4bc9098d06c541b607cca293269cf3489077b6c2
2017-11-22Prevent SIM selection and change SIM from showing when there are active callstwyen
Most devices are DSDS (dual SIM dual standby) which only one SIM can have active calls at a time. Telecom will ignore the phone account handle and use the current active SIM. The SIM selection dialog has no effect, and the change SIM button will just redial with the same SIM. Bug: 69417430 Test: CallingAccountSelectorTest, CallButtonPresenterTest PiperOrigin-RevId: 176718021 Change-Id: I231cfeaa5ff77c29cdaf8e0865d096c85cfb7fc4
2017-11-22Fix showing CallingAccountSelector in lock screentwyen
FLAG_SHOW_WHEN_LOCKED is added to PreCallActivity so it can be launched in lockscreen. PreCallCoordinator now grabs new instances of PreCallActions onResume so the state can be flushed. If it is reused states like PendingAction might be used after it is discarded. Added null check before discarding fragment because it might not be created yet due to background query. Bug: 69570769 Test: CallingAccountSelectorTest PiperOrigin-RevId: 176714225 Change-Id: I8b09441bd1cdb8df835978a1d82b53a3d3d056e0
2017-11-22Automated rollback of changelist 176587256twyen
Bug: 69570769 Test: CallingAccountSelectorTest PiperOrigin-RevId: 176706378 Change-Id: I50da0d2dd40a83ae6c1189fed2693368369849d3
2017-11-22Check Contacts support for preferred SIMtwyen
Preferred SIM can only be enabled when both dialer and the system contact app supports it. This CL checks if the app for ACTION_QUICK_CONTACT has the metadata supports_per_number_preferred_account. Also added a flag to disable the whole preferred SIM feature. Bug: 69638458 Test: CallingAccountSelectorTest PiperOrigin-RevId: 176687062 Change-Id: Id00debe2393068a422907a9eff2ac4ef0fcf6f8e
2017-11-22Fix showing CallingAccountSelector in lock screentwyen
android:showWhenLocked and FLAG_SHOW_WHEN_LOCKED is added to PreCallActivity so it can be launched in lockscreen. PreCallCoordinator now grabs new instances of PreCallActions onResume so the state can be flushed. If it is reused states like PendingAction might be used after it is discarded. Added null check before discarding fragment because it might not be created yet due to background query. Bug: 69570769 Test: CallingAccountSelectorTest PiperOrigin-RevId: 176587256 Change-Id: Iaa7145e860136e9177f568e2c84461ed5efa12a1
2017-11-21Require N for preferred SIM querytwyen
PhoneLookup.DATA_ID is only available after N. The fallback database should address this in a future CL. Bug: 69420158 Test: CallingAccountSelectorTest PiperOrigin-RevId: 176534281 Change-Id: I51ae1705fce6d7d4138b41fbd00d131447e49786
2017-11-20Implement SIM selection dialogtwyen
Bug: 64216442,64214592,64213352 Test: N/A PiperOrigin-RevId: 176424724 Change-Id: I1709156098a14ac3bd35d98b913e7b881fcd9b2b
2017-11-20Clear pendingAction when pausing PreCallCoordinatortwyen
When resumed runNextAction() will assert that pendingAction is null so if there's any it won't be interrupted. When the coordinator is paused all dialogs and pending actions must be discarded. If the pending action is not properly discarded it will still assert when trying to call finish(). Bug: 69069675 Test: PreCallCoordinatorImplTest PiperOrigin-RevId: 176420108 Change-Id: Ie89bda3621371a105dc58ff02d83812194a1ea0b
2017-11-20Add config flag for CallingAccountSelectortwyen
Since CallingAccountSelector is currently the only action that requires a UI, disabling it will effectively revert the PreCall behavior back to pre-PreCall era, sending intents to telecom directly. Bug: 68953196 Test: CallingAccountSelectorTest PiperOrigin-RevId: 176398440 Change-Id: I612a56bc66f32cf72779bd7c507de6a0784f1298
2017-11-18Added place voice call search action to regular search.calderwoodra
When a user types a phone number into the search bar, there isn't an intuitive way for them to place a call when the number doesn't match any existing contacts in the new search UI. This change adds the option to place a voice call from regular search, like the old UI. Bug: 69385190 Test: NSFT PiperOrigin-RevId: 176189153 Change-Id: I6c1561bcce104c56855d996570a79b34da7230ff
2017-11-18Implement suggested SIMtwyen
This CL adds a module that can query providers to aid users choosing which SIM to call with. Bug: 64214592 Test: MotoSuggestionProviderTest PiperOrigin-RevId: 176129303 Change-Id: Idb6314ad7f5a1bcd20b5b9173d3bfd873383cc84
2017-11-18Implement headless PreCalltwyen
If no actions require an activity, instead of launching the PreCallActivity, all actions will be performed immediately, and the call intent will be sent to telecom directly. This reduces the latency & risk when mutli SIM is not supported. Bug: 68953196 Test: PreCallImplTest, HeadlessPreCallCoordinatorTest PiperOrigin-RevId: 176032790 Change-Id: I03258e8643f18c65a8e5b1a84b18b71b30638044
2017-11-18Implement preferred SIMtwyen
Before prompting the user to select the SIM, CallingAccountSelector will lookup the fallback preferred SIM database to see if a preferred SIM is already set and bypass the selection. If the number is in contacts the user will also have the option to store the selected SIM as preferred. Bug: 64213352 Test: CallingAccountSelectorTest PiperOrigin-RevId: 175592732 Change-Id: I6a5a8ad8772eccfb4a119c529dcd3945b9dc0b1e
2017-11-18Allow external apps to start pre-call flowtwyen
This CL adds an activity that will forward parameters to PreCall so external apps like contact can utilize SIM selection or assisted dialing features. The caller needs to have CALL_PHONE permission. Bug: 64213352 Test: LaunchPreCallActivityTest PiperOrigin-RevId: 175591732 Change-Id: I096ea022d5ed87c29ffb191cd1bdb04e3a17c945
2017-11-11Hook up pre-call actionstwyen
This CL replaces all instance of CallIntentBuilder.build() with PreCall.getIntent(), which when run as an activity, will finish building the intent with user interaction. Bug: 64216442 Test: manual PiperOrigin-RevId: 174924323 Change-Id: If41868df4c7ed078d03bd3431fa85b8947056a01
2017-11-11Implement CallingAccountSelector and AssistedDialActionZachary Heidepriem
CallingAccountSelector examines the CallIntentBuilder, and if the PhoneAccountHandle is missing on a multi-SIM device while the default is not set, it will show a dialog to let the user select it. This step used to be after the in call UI is launched and telecom wants dialer to disambiguate. This step is moved to pre call as dialer need more control, like voicemail calls should always prompt, or the preferred SIM info might be available. This also allows telecom to send the selected PhoneAccountHandle to other apps so they have more information on how to rewrite numbers. AssistedDialAction replaces the step previously in CallIntentBuilder.build(), and rewrites the URI. Pre-call actions are not hooked up for dialing in this CL yet, assisted dialing will still be broken. Bug: 64216442 Test: CallingAccountSelectorTest, AssistedDialActionTest PiperOrigin-RevId: 174917321 Change-Id: Iba2e9092f83c036b402d4044a48ff5c44e806210
2017-11-11Implement PreCallCoordinatortwyen
When the user makes a call, the PreCallCoordinator will get a list of actions to perform from PreCallActionProviderComponent and apply them to the pending CallIntentBuilder, before sending the built intent to telecom Bug: 64216442 Test: PreCallExecutorImplTest PiperOrigin-RevId: 174911537 Change-Id: Ide5ec431d4e6e7879fcdfdbbbd7ea5eed9963b2c