summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/precall/impl
Commit message (Collapse)AuthorAgeFilesLines
* Update translation strings.Eric Erfanian2018-07-1082-0/+328
| | | | | Test: make Change-Id: Ib75f4f25e91067311de244d7f1fb95bc898aec22
* Remove redundant @TargetApi, @RequiresApi and @SuppressWarningslinyuh2018-06-281-6/+0
| | | | | | Test: Existing tests PiperOrigin-RevId: 202589482 Change-Id: I6982e4069d30032bf46caf3c9984dfc0e7196f6f
* Allow CallingAccountSelector to be shown when the device is locked.linyuh2018-06-051-5/+26
| | | | | | | Bug: 80408180 Test: PreCallActivityTest + Manual testing on a Moto device PiperOrigin-RevId: 199387969 Change-Id: I81d19e22f5a26676eb725b32148c43afd43d3119
* Inlined ConfigProviderBindings.get() and removed ConfigProviderBindings.zachh2018-06-013-6/+8
| | | | | | | | | It no longer provides any value, so just use dagger directly. Bug: 80441695 Test: tap PiperOrigin-RevId: 198806461 Change-Id: Id607abb65b77633bce511ad0c943ac19453a85d5
* Implement a global theme to be easily configured in Dialer.calderwoodra2018-05-211-29/+0
| | | | | | | | | | | | | | | 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
* Use new instances of PreCallAction on activity resumetwyen2018-05-153-7/+1
| | | | | | | | | | | | 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
* Don't show select SIM dialog after the pre call action has been discardedtwyen2018-05-111-0/+4
| | | | | | | | | | 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
* Add @InstallIn and @IncludeInDialerRoot to dagger modules in dialer codebase.weijiaxu2018-05-111-0/+3
| | | | | | Test: presubmit. PiperOrigin-RevId: 196158524 Change-Id: Iec1e457039e97be0236cd700d397b4095ee3c2c3
* Place Duo calls with PreCalltwyen2018-05-093-2/+118
| | | | | | | | | | 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
* Refactor PreferredAccountWorker to provide the dialog to be shown.twyen2018-04-304-228/+81
| | | | | | | | | | 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
* Make SIM Selection hint multi-linetwyen2018-04-251-1/+1
| | | | | | | | | | | | 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
* Disable entries in CallingAccountSelector that are not selectabletwyen2018-04-252-40/+144
| | | | | | | | | | | | | 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
* Add "enabled" to SelectPhoneAccountDialogFragment.twyen2018-04-251-10/+23
| | | | | | | | | | | | 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
* Don't show SIM selection and swap SIM for emergency calls.twyen2018-04-241-0/+5
| | | | | | | | TEST=TAP Bug: 73012833,73718978 Test: TAP PiperOrigin-RevId: 194110263 Change-Id: I54dbbaada89e4974030e0b3a397040d4d686bcae
* Use PreCall.start instead of context.startActivity when starting calls from ↵zachh2018-04-192-11/+25
| | | | | | | | | | | | | | | | 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
* Forward extras from pre call external receivers to placeCall().twyen2018-03-262-3/+5
| | | | | | | | | | | 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
* Fix UK numbers in international format with extra 0twyen2018-03-263-1/+151
| | | | | | | | | See class comment on UkRegionPrefixInInternationalFormatHandler Bug: 32501490 Test: Unit tests PiperOrigin-RevId: 190296011 Change-Id: I6f01935f022fc288ad702735b38cb297fb9d2621
* Show SIM auto select reason in in call UItwyen2018-03-261-0/+5
| | | | | | | | | 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
* Handle preferred SIM for ACTION_CALLtwyen2018-03-072-371/+23
| | | | | | | | | | | 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
* Make user able to set default sim when there is no account.yueg2018-03-061-1/+2
| | | | | | Test: CallingAccountSelectorTest, manual PiperOrigin-RevId: 188089149 Change-Id: Id1be88124e243e46ac9b0277f40de142af6bb5a9
* Move assisted dialing out of P.erfanian2018-03-021-4/+1
| | | | | | | Bug: 73727182 Test: tested PiperOrigin-RevId: 187673539 Change-Id: I9c790e912990fb8dc46da1c1057339c979ac9501
* Fix NPE when querying preferred without an accounttwyen2018-02-061-1/+1
| | | | | | | Bug: 72986691 Test: Unit tests PiperOrigin-RevId: 184743227 Change-Id: I2e37c2916ce05a72324f68c4530b7f6f3daf23eb
* Exit early when phone_lookup returned duplicated results for Preferred SIMtwyen2018-02-021-14/+11
| | | | | | | | | 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
* Add suggestion reason ACCOUNTtwyen2018-02-011-1/+1
| | | | | | | Bug: 72817785 Test: Unit tests PiperOrigin-RevId: 184178722 Change-Id: I7154058ab7ac1a94adc781a1aa9a49a3f13c1599
* Handle missing contact permission for preferred SIMtwyen2018-02-011-0/+7
| | | | | | | Bug: 72163953,72749906 Test: Unit tests PiperOrigin-RevId: 184167756 Change-Id: I19f4a71fb443fbb31960be486c3c5e996535fc32
* Add logging that assisted dialing was used.erfanian2018-01-261-0/+1
| | | | | | | | | Previously we only logged during degenerative events. Bug: 72174016 Test: none PiperOrigin-RevId: 183392966 Change-Id: Ibf4b8ce08dff39e9bba2f698162683c2431d06eb
* Update preferred SIM SuggestionProvidertwyen2018-01-252-119/+7
| | | | | | | | | | "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
* Attempt to place call even call permission is missingtwyen2018-01-111-2/+2
| | | | | | | | | 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
* Allow SimSuggestionProvider to auto select phone account.twyen2018-01-091-0/+10
| | | | | | | Bug: 70503524 Test: Unit tests. PiperOrigin-RevId: 181400523 Change-Id: I07f2f2cd7c1402d1acb6bfbde9db8d90c888edf6
* Use support lib to determine build version.erfanian2018-01-081-1/+2
| | | | | | Test: none PiperOrigin-RevId: 181185206 Change-Id: I167d9604285f7d5af4f34c6417d0ce1263e64fa1
* Only consider writable accounts for preferred SIMtwyen2018-01-032-9/+82
| | | | | | | | | | | 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
* Enable multi-sim support in assisted dialing.erfanian2017-12-221-2/+50
| | | | | | | | | | | | | * 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
* Update assisted dialing extras in preparation for platform implementation.erfanian2017-12-221-2/+4
| | | | | | | | | | | | * 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
* Add PreCall step to check permissiontwyen2017-12-143-1/+59
| | | | | | | | | If CALL_PHONE is missing PreCall will abort immediately and show a toast. Bug: 70565989,70566029 Test: PermissionCheckActionTest PiperOrigin-RevId: 179123070 Change-Id: I0d43c6acd44e77562752c871bed0223b2f787dde
* Adjust strings for select SIM dialogtwyen2017-11-291-1/+1
| | | | | | Test: N/A PiperOrigin-RevId: 177336359 Change-Id: Icec2eacef55ea6c1b3aad00fe10cde6284c89e25
* Prevent PreCallActivity from showing in lockscreen if it is not started in ↵twyen2017-11-291-1/+4
| | | | | | | | | the lockscreen Bug: 69812359 Test: PreCallActivityTest PiperOrigin-RevId: 177193665 Change-Id: Ic61819b8456ee22c01228d6be2255b3f2c1e418a
* Adjust strings for select SIM dialogtwyen2017-11-291-3/+3
| | | | | | Test: N/A PiperOrigin-RevId: 177075957 Change-Id: Idf4546c57aba72470e07614d2a20d828da8ee08d
* Add impressions for dual sim featurestwyen2017-11-293-2/+49
| | | | | | | Bug: 69618691 Test: CallingAccountSelectorTest PiperOrigin-RevId: 177062349 Change-Id: I4bc9098d06c541b607cca293269cf3489077b6c2
* Prevent SIM selection and change SIM from showing when there are active callstwyen2017-11-221-0/+12
| | | | | | | | | 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
* Fix showing CallingAccountSelector in lock screentwyen2017-11-223-11/+21
| | | | | | | | | | | | 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
* Automated rollback of changelist 176587256twyen2017-11-224-18/+11
| | | | | | | Bug: 69570769 Test: CallingAccountSelectorTest PiperOrigin-RevId: 176706378 Change-Id: I50da0d2dd40a83ae6c1189fed2693368369849d3
* Check Contacts support for preferred SIMtwyen2017-11-221-0/+48
| | | | | | | | | 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
* Fix showing CallingAccountSelector in lock screentwyen2017-11-224-11/+18
| | | | | | | | | | | | 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
* Require N for preferred SIM querytwyen2017-11-211-0/+5
| | | | | | | | | 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
* Implement SIM selection dialogtwyen2017-11-202-6/+51
| | | | | | | Bug: 64216442,64214592,64213352 Test: N/A PiperOrigin-RevId: 176424724 Change-Id: I1709156098a14ac3bd35d98b913e7b881fcd9b2b
* Clear pendingAction when pausing PreCallCoordinatortwyen2017-11-201-0/+1
| | | | | | | | | 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
* Add config flag for CallingAccountSelectortwyen2017-11-201-0/+6
| | | | | | | | | 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
* Implement suggested SIMtwyen2017-11-181-6/+58
| | | | | | | | | 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
* Implement headless PreCalltwyen2017-11-184-11/+51
| | | | | | | | | | | 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
* Implement preferred SIMtwyen2017-11-182-14/+321
| | | | | | | | | 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