Loading services/companion/java/com/android/server/companion/transport/SecureTransport.java +15 −16 Original line number Diff line number Diff line Loading @@ -67,25 +67,11 @@ class SecureTransport extends Transport implements SecureChannel.Callback { mShouldProcessRequests = false; } @Override public Future<byte[]> requestForResponse(int message, byte[] data) { // Check if channel is secured and start securing if (!mShouldProcessRequests) { Slog.d(TAG, "Establishing secure connection."); try { mSecureChannel.establishSecureConnection(); } catch (Exception e) { Slog.w(TAG, "Failed to initiate secure channel handshake.", e); onError(e); } } return super.requestForResponse(message, data); } @Override protected void sendMessage(int message, int sequence, @NonNull byte[] data) throws IOException { establishSecureConnection(); if (DEBUG) { Slog.d(TAG, "Queueing message 0x" + Integer.toHexString(message) + " sequence " + sequence + " length " + data.length Loading @@ -103,6 +89,19 @@ class SecureTransport extends Transport implements SecureChannel.Callback { } } private void establishSecureConnection() { // Check if channel is secured and start securing if (!mShouldProcessRequests) { Slog.d(TAG, "Establishing secure connection."); try { mSecureChannel.establishSecureConnection(); } catch (Exception e) { Slog.w(TAG, "Failed to initiate secure channel handshake.", e); onError(e); } } } @Override public void onSecureConnection() { mShouldProcessRequests = true; Loading Loading
services/companion/java/com/android/server/companion/transport/SecureTransport.java +15 −16 Original line number Diff line number Diff line Loading @@ -67,25 +67,11 @@ class SecureTransport extends Transport implements SecureChannel.Callback { mShouldProcessRequests = false; } @Override public Future<byte[]> requestForResponse(int message, byte[] data) { // Check if channel is secured and start securing if (!mShouldProcessRequests) { Slog.d(TAG, "Establishing secure connection."); try { mSecureChannel.establishSecureConnection(); } catch (Exception e) { Slog.w(TAG, "Failed to initiate secure channel handshake.", e); onError(e); } } return super.requestForResponse(message, data); } @Override protected void sendMessage(int message, int sequence, @NonNull byte[] data) throws IOException { establishSecureConnection(); if (DEBUG) { Slog.d(TAG, "Queueing message 0x" + Integer.toHexString(message) + " sequence " + sequence + " length " + data.length Loading @@ -103,6 +89,19 @@ class SecureTransport extends Transport implements SecureChannel.Callback { } } private void establishSecureConnection() { // Check if channel is secured and start securing if (!mShouldProcessRequests) { Slog.d(TAG, "Establishing secure connection."); try { mSecureChannel.establishSecureConnection(); } catch (Exception e) { Slog.w(TAG, "Failed to initiate secure channel handshake.", e); onError(e); } } } @Override public void onSecureConnection() { mShouldProcessRequests = true; Loading