History log of /packages/services/Telephony/src/com/android/phone/vvm/omtp/DefaultOmtpEventHandler.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
822de03463e4d275ca19c6f6209a28773f4ce215 12-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow initial voicemail status setup without signal" into nyc-mr1-dev
c1963674379bc648f92fe3ff1f7f08a824c39e22 12-Oct-2016 Ta-wei Yen <twyen@google.com> Allow initial voicemail status setup without signal

During device shutdown the VVM status might be wiped as the SIM will be
perceived as removed, setting the configuration state as "not
configured". During this state dialer will not show the VVM tab. The tab
will be restored when activation is ran because the configuration state
is set back to OK or ACTIVATING.

During previous optimization, the activation will not be queued at all
if the phone does not have signal. In this case after a shut down the
user will not see the voicemail tab again until signal is restore and
activation is ran.

In this CL, VVM activation will be queued even if there are no signal
the activation task will do the initial status table setup to bring
back the VVM tab,then check for signal and abort. Notification channel
state is wiped during the setup, but the "no signal" will be restored
if the task is aborted due to no signal.

Change-Id: Ib7c376b0a208fc14452ece0f5fad84b136f97d45
Fixes: 31903828
/packages/services/Telephony/src/com/android/phone/vvm/omtp/DefaultOmtpEventHandler.java
997518896094bb809bd606f7a207e6eaa50754d6 08-Oct-2016 Ta-wei Yen <twyen@google.com> Add missing case in DefaultOmtpEventHandler

These are causing wtf crashes.

Change-Id: Idc26666d77b03a97cab3e603b2fd9896e97c6917
Fixes: 31995389
/packages/services/Telephony/src/com/android/phone/vvm/omtp/DefaultOmtpEventHandler.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/DefaultOmtpEventHandler.java
28ffaca6466d4da53339c14b5cc03ff8240db642 21-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Wipe data channel state when signal returns" into nyc-mr1-dev
d7f0202199d08e1bc104debbb4db30010683c80f 21-Jul-2016 Ta-wei Yen <twyen@google.com> Wipe data channel state when signal returns

When the signal is lost and cellular data is required for the carrier,
DATA_CHANNEL_STATE_NO_CONNECTION_CELLULAR_REQUIRED will be set.
When the signal is returned, the error was not cleared immediately.
Instead, it was cleared when a sync task is started. Although a sync
task usually follows the signal return, it could be blocked by the
sync interval requirement, and the error state will remain forever.

After this CL, the data channel state is reset after the signal
returns. If there are any errors it would be posted again by the sync
task.

Change-Id: I810eb8b89e19cb0fe5091b4d63e393cc93a8e9d0
Fixes:30263279
/packages/services/Telephony/src/com/android/phone/vvm/omtp/DefaultOmtpEventHandler.java
93887f495a9fcedbed03501e92adb10cab6c16a3 21-Jul-2016 Ta-wei Yen <twyen@google.com> Tweak visual voicemail

b/30254448
When something triggered vvm activation under airplane mode an error
will overwrite the "turn off airplane mode" message.

After this CL activation task cannot be launched when there is no
signal.

b/30230197
The error message "PIN too short" and "PIN mismatch" is showing when
the input box is still empty, confusing the user.

After this CL, the error message will not be shown if the user has
not typed anything yet. Logging in the change PIN activity is also
improved.

b/30191958
"Actvating" is shown to user that has "subscriber unknown"
provisioning status, but the carrier does not support provisioning.
The activation should fail immediately, and a message should be shown.

After this CL the "Can't activate visual voicemail" will be displayed
if provisioning can not be done.

b/30197149
Sync fails too easily. Sync is only tried for three times in a three
minute period. Tries increased to 5.

b/30155953
The error from the last sync retains until the new sync has completed,
even if the root cause like airplane mode is already resolved.

After this CL when a new sync is started the IMAP_OPERATION_STARTED
event will be sent and data channel errors will be cleared.

Change-Id: I035145849d281834fd7ef84d22162d490430b70c
Fixes: 30254448
Fixes: 30230197
Fixes: 30191958
Fixes: 30197149
Fixes: 30155953
/packages/services/Telephony/src/com/android/phone/vvm/omtp/DefaultOmtpEventHandler.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/DefaultOmtpEventHandler.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/DefaultOmtpEventHandler.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/DefaultOmtpEventHandler.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/DefaultOmtpEventHandler.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/DefaultOmtpEventHandler.java
f5c5d934a418a6c28313f284eec4f98a6fbbdc5c 02-Jun-2016 Ta-wei Yen <twyen@google.com> Centralize VVM error Processing

To prepare for vendor specific error codes every error that is written to
the voicemail status table is centralized to the VoicemailProtocol,
which determines what error code will be actually written.

+ Use PhoneAccountHandleConverter to convert subId instead of PhoneUtils.
PhoneAccountHandleConverter still uses PhoneUtils under the hood but
it will be changed to using public API in the future.

Bug:28968317
Bug:28977379
Change-Id: I69232b276ec0d456fb9ca1fb08f25b2d51d89462
/packages/services/Telephony/src/com/android/phone/vvm/omtp/DefaultOmtpEventHandler.java