Merge "The reset() should not throw exceptions"

This commit is contained in:
TreeHugger Robot
2019-12-24 02:53:35 +00:00
committed by Android (Google) Code Review

View File

@@ -121,7 +121,12 @@ final class FieldClassificationStrategy {
synchronized (mLock) {
if (mServiceConnection != null) {
if (sDebug) Slog.d(TAG, "reset(): unbinding service.");
mContext.unbindService(mServiceConnection);
try {
mContext.unbindService(mServiceConnection);
} catch (IllegalArgumentException e) {
// no-op, just log the error message.
Slog.w(TAG, "reset(): " + e.getMessage());
}
mServiceConnection = null;
} else {
if (sDebug) Slog.d(TAG, "reset(): service is not bound. Do nothing.");