History log of /packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b29425b49c3ed353a114291712ef4d484ef645c5 22-Sep-2016 Ta-wei Yen <twyen@google.com> Disable MWI suppression if VVM cannot be activated

MWI is the traditional voicemail notification which should be suppressed
if visual voicemail is active. NotificationMgr.updateMwi() currently
checks the CONFIGURATION_STATE to suppress the MWI, but there are several
issues. b/31229016 is a bug that when the device boots the configuration
state will be cleared and the MWI for voicemail that arrives when the
device is offline will be cleared, even if the account cannot be
activated. A full solution will be adding a setMwiEnabled() method and
stop checking the configuration state, but that is too risky at this
moment (ag/1467545). This is a temporary workaround to shut down the
configuration state check if visual voicemail cannot be activated.

+ Don't clear MWI when signal is restored. Checking the notification
state to hide MWI is obsolete in ag/1333776

Change-Id: I03b7e5cde2aa7ad4c1a31526eaf63d6832717e0a
Fixes: 31229016
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
ff5b6a9c2e5d579b79ba74fbc08735b4d2700818 09-Sep-2016 Ta-wei Yen <twyen@google.com> Optimize visual voicemail activation

Before this CL VVM voicemail will wait for a 60 seconds timeout for the
carrier to respond the status request, Regardless of the situation.

After this CL if the cellular signal is lost before the task is ran,
the activation task will abort immediately. Failing to send the SMS
will also fail the task immediately and queue for a retry.

This change should significantly reduce the time the wake lock is held
waiting for the status response when the signal is poor.

Change-Id: I8284d00b52875ba067afdda21dc3dbbb02f103bd
Fixes: 30126770
Bug: 31049275
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
016df6b594d4a5aba8c1e325a646a0bcf5d6d263 22-Jul-2016 Ta-wei Yen <twyen@google.com> Postpone error until no more retries are available

Error messages generated from tasks that have retries are often short
lived and not actionable. These errors should wait until no more
retries are available before being shown.

Before this CL, All error codes are written directly to the database
when a event is triggered. After this CL, writing to the database
requires a VoicemailStatus.Editor() object to be passed in. Usually
the object will be the same direct-write object as before. But in
retrying tasks, the object passed in will have the writes deferred
until the result of the task is determined. The writes will only be
committed if the task is successful or no more retries are left.

Passing a error handling object deep down is not ideal. A better way
will be throwing a exception back up so the task can decide how to
handle it. Unfortunately, deeper codes cannot handle escaping
exceptions gracefully, and changing it involves too much risk at this
moment.

+ Subsequent activation does not show the activating message

Fixes: 30284894
Change-Id: I523e8aa2f89ff3af13016eccd2392cee302e79dc
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
4fa8ef367c9d49e4970a6e9156c2b1565de54018 20-Jul-2016 Ta-wei Yen <twyen@google.com> Fix NPE when VvmNetworkRequest failed.

Previously when VvmNetworkReust.getNetwork() fails, it will return a
null Network, causing NPE and terminates the task.
ACTION_SYNC_VOICEMAIL which should attempt activation on unactivated
accounts also fails to do so because only activated accounts are
registered as a voicemail source.

After this CL VvmNetworkReust.getNetwork() will throw a
RequestFailedException instead of null. All callers will fail the task
to schedule a retry.

Sync task, which is triggered by ACTION_SYNC_VOICEMAIL will scan
through all phone accounts for accounts that have visual voicemail
enabled but is not activated, and retry activation for them.

The CONFIG_ACTIVATING event also wipe the state in data and
notification channel to remove errors from the last try.

Change-Id: Id376f10ff463c722db2fb1a9ad58d16a334f0701
Fixes: 30229368
Fixes: 30228947
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
9115aeb89a584ed173665c7fff725e1a41564a4b 16-Jul-2016 Ta-wei Yen <twyen@google.com> Provision user from iPhone without VoLTE

While requesting STATUS on a VVM3 user provisioned for iPhone, the
returned SMS is UNRECOGNIZED?cmd=STATUS.

This CL translate the SMS into an standard STATUS SMS that will trigger
the provisioning.

+ Removed waiting for STATUS SMS after provisioning is completed. It
could take more then 5 minute. The status will stay "Activating"
until the SMS is received.

+ Removed minimum interval requirement for activation, for above.

+ Activation will not start while the SIM/carrier config has changed if
the phone is not in service. The activation is likely to fail, and
it wastes time waiting for the timeout.

Change-Id: Iba9485443ee2088be3d1a33016b0844abaff83b8
Fixes: 30123702
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
771bf0b5e4a63d4ffe80b5d264774dadf855b8ab 15-Jul-2016 Ta-wei Yen <twyen@google.com> Make ImapHelper constructor throw

Instead of checking with isSuccessfullyInitialized(), ImapHelper now
throws an checked InitializingException if it cannot be initialized.

+ Recategorize VVM3 error for non-IMAP errors.

Change-Id: Ifd17f154b580efdc09535d8a7751b0031326d92c
Fixes: 30032461
Fixes: 30106330
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
63bfbec5d93b536f25ab600224de74771ad8aa1d 14-Jul-2016 Ta-wei Yen <twyen@google.com> Convert activation to task

Previously visual voicemail activation is done in a set of fire
and forget manner. After some events happend a request for STATUS
SMS will be sent to the carrier, and it was never checked if it
is actually sent or has any SMS been received. Often, multiple
requests were sent and multiple SMS were received. For each of the
SMS, provisioning is attempted, the source was updated and a sync
is requested.

After the CL, Activation has a explicit flow. Activation request,
which is throttled, will send a STATUS request, which the respond
SMS will be explictly waited upon. After receiving the SMS all former
activation steps will be done in a single threaded manner, and retries
will be requested if anything failed, including SMS failed to send.

Change-Id: Ic1e194d1e7802f2d30077cc256096123ac6dce72
Fixes: 30026407
Fixes: 28730056
Fixes: 29832345
Fixes: 29346494
Bug: 30068100
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
a05b9d6ee8218006d9502e3dcf212ef8e8bd7f61 13-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Implement UI for changing voicemail PIN" into nyc-mr1-dev
a96501cff3ca998bb705b49feede6af28a53189d 13-Jul-2016 Ta-wei Yen <twyen@google.com> Implement UI for changing voicemail PIN

The temporary dialog for chagin PIN is replaced.

The setting still reside in Dialer->settings->call->voicemail
https://screenshot.googleplex.com/gKzDdP9DnHH

To change the PIN, the user must enter their old PIN first.
https://screenshot.googleplex.com/jMBcrkiJquJ
Which will be checked with the server.
https://screenshot.googleplex.com/38iz4wOySF9
https://screenshot.googleplex.com/mxjnXgSWNAH

After the old PIN is confirmed, the user then proceed to enter the new
PIN.
The length requirement from the server will be enforced.
https://screenshot.googleplex.com/d7cigtR08di
https://screenshot.googleplex.com/0MVVzViuArP
https://screenshot.googleplex.com/mwnRda213HO

The user then must confirm their new PIN
https://screenshot.googleplex.com/4R9T5m3sPp4
https://screenshot.googleplex.com/GHmqSDxPr1z

The change will be commited to the server
https://screenshot.googleplex.com/38iz4wOySF9

If it succeeded, the user will return to the setting screen, and a
toast will be shown.
https://screenshot.googleplex.com/a7qPxQOvPJm
else an error message will be shown, and the user will return to the
enter new PIN step.

If the default PIN was set by the OMTP client before, the user will be
asked to "Set PIN" instead
https://screenshot.googleplex.com/RPYRxqOFSkw

The default PIN will be validated first
https://screenshot.googleplex.com/bYZcROA560B
If the server rejects the default PIN, The flow will continue as the
regular change PIN process. Else the enter old pin step is by passed
and the user will go to the enter new PIN step directly.
If other error happens in this step, a message will be shown
https://screenshot.googleplex.com/YRKLo5VmGzL
and the user will then return to the settings screen

+ All phone account dependent storaged is moved to
VisualVoicemailPreferences.
- Retry in OmtpSyncService is removed. It was never ran, and a new retry
mechanism will be added later.

Fixes: 29082418
Fixes: 29102412
Fixes: 29903609

Change-Id: I28dcc08113120abedd907fa8faffd3eb00bd87b4
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
b8e59094d40a87fe4560c39bdde4d31908987f29 12-Jul-2016 Ta-wei Yen <twyen@google.com> Merge "Handle non-ready provisioning status on non-VVM3" into nyc-mr1-dev
524f0398f279e90a95753d3dcafe1ae5c1eca0b6 12-Jul-2016 Ta-wei Yen <twyen@google.com> Handle non-ready provisioning status on non-VVM3

Currently only VVM3 has implemented provisioning steps.
Before implementing provisioning we used to ignore the provisioning
status and attempt to access the server. By having all protocol
going through the provisioning process non-VVM3 protocols will do
nothing and not complete the activation.

In this CL if provisioning is not supported for the protocol, the old
behavior will be used. Meaning the provisioning status will once again
be ignored.

Change-Id: Iebf9c159bc4a1c4fe91d5734f5f53c6d90c0fa8a
Fixes: 30063031
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
1bedb4f02433e86d10ee9693a2208b23476cb2d1 12-Jul-2016 Ta-wei Yen <twyen@google.com> Proper IMAP logout

Prior to this CL the IMAP client never send a LOGOUT command and just
shut down the socket, which was regarded as an "abnormal session
termination" to the server.

In this CL, we will attempt to send the LOGOUT command before closing
the socket. ImapHelper was also made closeable to ensure the connection
is not leaked.

Change-Id: I920c63edaa39116e56d17866451709306e5ab91c
Fixes: 27816588
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
ceeed0fd74ba1390d5c820952dd7903b8efc7356 28-Jun-2016 Ta-wei Yen <twyen@google.com> Tweak VVM error handling

+ Losing cellular signal also set
DATA_CHANNEL_STATE_NO_CONNECTION_CELLULAR_REQUIRED, instead of
launching a separate event.
+ handle SUBSCRIBER_PROVISIONED and SUBSCRIBER_BLOCKED for VVM3
SUBSCRIBER_PROVISIONED will deactivate VVM client, as required for
VVM3

Bug: 28968317
Change-Id: If683f5c4caf62562318ea2bb415e46de70b0f66f
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
324d59cc0242dd825f3f8ddb5a69377d4fb0e18c 23-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Change VVM3 default prompt level to no guest prompts" into nyc-mr1-dev
915e98adeceb657c902b333199d5c8dac5c5ffb0 23-Jun-2016 Ta-wei Yen <twyen@google.com> Change VVM3 default prompt level to no guest prompts

The telephone user interface language setting also affects how much
instruction is given to the user. The default prompt level is specified
to be "standard for user, none for caller". Before this CL it was
"standard for user and caller", which is corrected.

Change-Id: Ib8cb597e0bd93149f49bbc9609ea82962880549c
Fixes: 29242725
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
a0d3aec9f17236e8618d9a9aaeaec611215bc5e4 22-Jun-2016 Ta-wei Yen <twyen@google.com> Add Error handling for VVM3

This CL requires the prebuilt dialer to be updated, else PIN not being
set will be considered an error and the dialer will not show the
voicemail tab. b/29577838 will disable VVM3 by default so dialer support
is ensured.

Bug:29082418
Bug:28968317
Change-Id: Iaad58711853ce350916ce3f49db69ef8f92156e4
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
99282e0eb8f04d03c9464bea94fa2d8959edbd13 22-Jun-2016 Ta-wei Yen <twyen@google.com> Log visual voicemail to LocalLog

Up to 100 entries of visual voicemail log will be preserved and dumped
into the bug report. The status of the config will also be dumped.

Sample output:
https://paste.googleplex.com/4537194828005376

Fixes: 29517754
Change-Id: I9c460a6544f3b834009667e2eefb863735f82f9a
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
b250ce8d53a07ee1900f979095479074ab7d509c 08-Jun-2016 Ta-wei Yen <twyen@google.com> Support unknown user provisioning for VVM3

Users on legacy visual voicemail or transfering from other devices
may receive a STATUS SMS with the provisioning status "Unknown".
On VVM3 we need to go though a series of URLs to have the user
provisioned.

The STATUS SMS will come with a URL to the voicemail management
gateway. From it we can find the self provisioning gateway URL that
we can modify voicemail services.

A request to the self provisioning gateway to activate basic visual
voicemail will return us with a web page. If the user hasn't
subscribe to it yet it will contain a link to confirm the
subscription. This link should be clicked through cellular network,
and have cookies enabled.

After the process is completed, the carrier should send us another
STATUS SMS with a new or ready user.

+ Moved provisioning to OmtpProvisioningService, which will do it in
the background instead of blocking the SMS receiver.
+ Handle missing MESSAGE_LENGTH field in SyncMessage, this field is
optional.

Change-Id: I473bf62143ce611dffbdb0bb74de9d011bbf1400
Fixes:28697797
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
190cbb0fe0a86267b7aa2c98c0790bb5d019fd48 03-Jun-2016 Ta-wei Yen <twyen@google.com> Support new user setup for VVM3

A new VVM3 SIM starts with st=N (New user). In this state some setup
is required to configure the TUI (Telephone user interface, the
traditional voicemail that the user can still call in to.)

The TUI language should be set. Spanish is selected only if the system
language is Spanish. Later CL will change this to use LocaleList.

The PIN is set to a 6 digit random number. Later CL will add an error
to prompt the user to replace the PIN. When the PIN is the generated
PIN, the "old pin" field in the change PIN dialog will be hidden
and filled with the generated PIN. If the user changed the PIN or the
server rejected the generated PIN it will be wiped from the system.

Fixes:28697797
Change-Id: Icd3f563e5ea82d1c648cf0bce19ceee56fdc4a0c
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
0786462237e5a29e4491d43a78c07e365731dc7b 02-Jun-2016 Ta-wei Yen <twyen@google.com> Support XCHANGE_TUI_PWD

The XCHANGE_TUI_PWD OMTP IMAP command allows the user to change the PIN
required to dial in their voicemail inbox.

A prefernce in voicemail settings has been added to access this feature.
https://screenshot.googleplex.com/X9rWDsKB0Bw

The preference will launch a dialog to enter the old and new PIN
the EditText has numberPassword format
https://screenshot.googleplex.com/L3WW6q5igVw

A modal progress dialog will spin when the PIN change is processing.
https://screenshot.googleplex.com/J9Gfv8zq1oo

If any error occurred, a dialog will be shown with the error message
https://screenshot.googleplex.com/LBq7G3FXG8M

Change-Id: I8a083b2a22bd85bbdfdae16593f4827b44049776
Fixes:29056644
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java
ce8d0fff0de34c3d982486dd8e92dbfa7b637e2b 25-May-2016 Ta-wei Yen <twyen@google.com> Support Verizon visual voicemail protocol

The VVM3 implementation differs with existing OMTP and CVVM,
especially it does not have the concept of activation/deactivation. VVM3
is activated once it is provisioned, and can not be turned off from
the client side.

To support none data driven features, We defined the
VisualVoicemailProtocol interface for methods that depends on the
implementation. The protocol will be selected based on the vvm_type_string
in the carrier config.

For VVM3 activation, instead of sending a ACTIVATE SMS which they do
not support, we will send a STATUS SMS to check the provisioning status
and get the server credentials. Provisioning is to be handled in a future
CL.

+ Carrier config values for VZW
+ VVM validity for a carrier is checked by
OmtpVvmCarrierConfigHelper.isValid() instead of getVvmType() matching.
A carrier is valid if a protocol for its' type is implemented.
+ All VVM type dependent code refactored into protocols.
+ StatusMessage.getProvisioningStatus() return unquoted status.
+ Fixed bug in ImapConnection that caused all capability to be rejected
if disabledCapability is null.

Change-Id: I512b954b3260138267cb5eeb2fcc5ae016ec0f2d
Fixes:27817303
Bug:27816386
Bug:28696525
/packages/services/Telephony/src/com/android/phone/vvm/omtp/protocol/Vvm3Protocol.java