diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-26 01:13:06 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-26 01:13:06 +0000 |
commit | 2684d0b9a258171cfc35c17bce7f6d23cead3172 (patch) | |
tree | baf93cd9f4a45927d7ed5b4b547b29cf2489582e /java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java | |
parent | b9596e65467d9ad33efdfebb5ebc098207fda991 (diff) | |
parent | 923e186f97b3aeb67f4ddbb686e7c92336a7a4ef (diff) |
Merge changes I5e589b2b,I821a700c
* changes:
Prevent VvmNetworkRequestCallback from releasing twice
By pass media player strict mode violation
Diffstat (limited to 'java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java')
-rw-r--r-- | java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java b/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java index 60ba166ba..c0ab6788e 100644 --- a/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java +++ b/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java @@ -56,6 +56,7 @@ public abstract class VvmNetworkRequestCallback extends ConnectivityManager.Netw private final VoicemailStatus.Editor status; private boolean requestSent = false; private boolean resultReceived = false; + private boolean released = false; public VvmNetworkRequestCallback( Context context, PhoneAccountHandle phoneAccount, VoicemailStatus.Editor status) { @@ -112,7 +113,7 @@ public abstract class VvmNetworkRequestCallback extends ConnectivityManager.Netw @Override @CallSuper public void onLost(Network network) { - VvmLog.d(TAG, "onLost"); + VvmLog.i(TAG, "onLost"); resultReceived = true; onFailed(NETWORK_REQUEST_FAILED_LOST); } @@ -126,7 +127,7 @@ public abstract class VvmNetworkRequestCallback extends ConnectivityManager.Netw @CallSuper public void onUnavailable() { - // TODO(twyen): a bug this is hidden, do we really need this? + VvmLog.i(TAG, "onUnavailable"); resultReceived = true; onFailed(NETWORK_REQUEST_FAILED_TIMEOUT); } @@ -156,8 +157,13 @@ public abstract class VvmNetworkRequestCallback extends ConnectivityManager.Netw } public void releaseNetwork() { - VvmLog.d(TAG, "releaseNetwork"); - getConnectivityManager().unregisterNetworkCallback(this); + VvmLog.i(TAG, "releaseNetwork"); + if (!released) { + getConnectivityManager().unregisterNetworkCallback(this); + released = true; + } else { + VvmLog.w(TAG, "already released"); + } } public ConnectivityManager getConnectivityManager() { @@ -170,7 +176,7 @@ public abstract class VvmNetworkRequestCallback extends ConnectivityManager.Netw @CallSuper public void onFailed(String reason) { - VvmLog.d(TAG, "onFailed: " + reason); + VvmLog.i(TAG, "onFailed: " + reason); if (carrierConfigHelper.isCellularDataRequired()) { carrierConfigHelper.handleEvent(status, OmtpEvents.DATA_NO_CONNECTION_CELLULAR_REQUIRED); } else { |