Clean up security token transport if connection procedure failed
This commit is contained in:
@@ -103,6 +103,7 @@ public class SecurityTokenConnection {
|
|||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void connectToDevice(Context context) throws IOException {
|
void connectToDevice(Context context) throws IOException {
|
||||||
|
try {
|
||||||
// Connect on transport layer
|
// Connect on transport layer
|
||||||
transport.connect();
|
transport.connect();
|
||||||
|
|
||||||
@@ -125,6 +126,10 @@ public class SecurityTokenConnection {
|
|||||||
isPw3Validated = false;
|
isPw3Validated = false;
|
||||||
|
|
||||||
smEstablishIfAvailable(context);
|
smEstablishIfAvailable(context);
|
||||||
|
} catch (IOException e) {
|
||||||
|
transport.release();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|||||||
Reference in New Issue
Block a user