The reset() should not throw exceptions
The reset() should catch the IllegalArgumentException even if the service was not registered. Fixes: 141739693 Test: atest -it CtsAutoFillServiceTestCases Change-Id: I58f68d502f5e5d1675525f8ad5bc0442f787c8b3
This commit is contained in:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user