| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chromoting.jni; | 5 package org.chromium.chromoting.jni; |
| 6 | 6 |
| 7 import android.graphics.Bitmap; | 7 import android.graphics.Bitmap; |
| 8 import android.graphics.Point; | 8 import android.graphics.Point; |
| 9 import android.os.Looper; | 9 import android.os.Looper; |
| 10 | 10 |
| 11 import org.chromium.base.Log; | 11 import org.chromium.base.Log; |
| 12 import org.chromium.base.annotations.CalledByNative; | 12 import org.chromium.base.annotations.CalledByNative; |
| 13 import org.chromium.base.annotations.JNINamespace; | 13 import org.chromium.base.annotations.JNINamespace; |
| 14 import org.chromium.base.annotations.SuppressFBWarnings; | 14 import org.chromium.base.annotations.SuppressFBWarnings; |
| 15 import org.chromium.chromoting.CapabilityManager; | 15 import org.chromium.chromoting.CapabilityManager; |
| 16 import org.chromium.chromoting.ConnectAndCancelTest; |
| 16 import org.chromium.chromoting.SessionAuthenticator; | 17 import org.chromium.chromoting.SessionAuthenticator; |
| 17 | 18 |
| 18 import java.nio.ByteBuffer; | 19 import java.nio.ByteBuffer; |
| 19 import java.nio.ByteOrder; | 20 import java.nio.ByteOrder; |
| 20 | 21 |
| 21 /** | 22 /** |
| 22 * Class to manage a client connection to the host. This class controls the life
time of the | 23 * Class to manage a client connection to the host. This class controls the life
time of the |
| 23 * corresponding C++ object which implements the connection. A new object should
be created for | 24 * corresponding C++ object which implements the connection. A new object should
be created for |
| 24 * each connection to the host, so that notifications from a connection are alwa
ys sent to the | 25 * each connection to the host, so that notifications from a connection are alwa
ys sent to the |
| 25 * right object. | 26 * right object. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // simplify the disconnectFromHost() code. | 159 // simplify the disconnectFromHost() code. |
| 159 disconnectFromHostWithoutNotification(); | 160 disconnectFromHostWithoutNotification(); |
| 160 } | 161 } |
| 161 } | 162 } |
| 162 | 163 |
| 163 /** | 164 /** |
| 164 * Called on the UI thread to prompt the user to enter a PIN. | 165 * Called on the UI thread to prompt the user to enter a PIN. |
| 165 */ | 166 */ |
| 166 @CalledByNative | 167 @CalledByNative |
| 167 void displayAuthenticationPrompt(boolean pairingSupported) { | 168 void displayAuthenticationPrompt(boolean pairingSupported) { |
| 168 mAuthenticator.displayAuthenticationPrompt(pairingSupported); | 169 ConnectAndCancelTest.getTest().onAuthDialog(this); |
| 170 // mAuthenticator.displayAuthenticationPrompt(pairingSupported); |
| 169 } | 171 } |
| 170 | 172 |
| 171 /** | 173 /** |
| 172 * Called by the SessionAuthenticator after the user enters a PIN. | 174 * Called by the SessionAuthenticator after the user enters a PIN. |
| 173 * @param pin The entered PIN. | 175 * @param pin The entered PIN. |
| 174 * @param createPair Whether to create a new pairing for this client. | 176 * @param createPair Whether to create a new pairing for this client. |
| 175 * @param deviceName The device name to appear in the pairing registry. Only
used if createPair | 177 * @param deviceName The device name to appear in the pairing registry. Only
used if createPair |
| 176 * is true. | 178 * is true. |
| 177 */ | 179 */ |
| 178 public void handleAuthenticationResponse( | 180 public void handleAuthenticationResponse( |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 /** Passes touch event information to the native handling code. */ | 441 /** Passes touch event information to the native handling code. */ |
| 440 private native void nativeSendTouchEvent( | 442 private native void nativeSendTouchEvent( |
| 441 long nativeJniClient, int eventType, TouchEventData[] data); | 443 long nativeJniClient, int eventType, TouchEventData[] data); |
| 442 | 444 |
| 443 /** Native implementation of Client.enableVideoChannel() */ | 445 /** Native implementation of Client.enableVideoChannel() */ |
| 444 private native void nativeEnableVideoChannel(long nativeJniClient, boolean e
nable); | 446 private native void nativeEnableVideoChannel(long nativeJniClient, boolean e
nable); |
| 445 | 447 |
| 446 /** Passes extension message to the native code. */ | 448 /** Passes extension message to the native code. */ |
| 447 private native void nativeSendExtensionMessage(long nativeJniClient, String
type, String data); | 449 private native void nativeSendExtensionMessage(long nativeJniClient, String
type, String data); |
| 448 } | 450 } |
| OLD | NEW |