| Index: remoting/android/java/src/org/chromium/chromoting/cardboard/DesktopActivity.java
|
| diff --git a/remoting/android/java/src/org/chromium/chromoting/cardboard/DesktopActivity.java b/remoting/android/java/src/org/chromium/chromoting/cardboard/DesktopActivity.java
|
| index 7800b4ef2da9180708bbdbc02ff8e9e0a0ca41c1..1f37082f2bbd1a605737227beb25953dabd6de65 100644
|
| --- a/remoting/android/java/src/org/chromium/chromoting/cardboard/DesktopActivity.java
|
| +++ b/remoting/android/java/src/org/chromium/chromoting/cardboard/DesktopActivity.java
|
| @@ -16,7 +16,7 @@
|
|
|
| import org.chromium.chromoting.R;
|
| import org.chromium.chromoting.TouchInputHandler;
|
| -import org.chromium.chromoting.jni.Client;
|
| +import org.chromium.chromoting.jni.JniInterface;
|
|
|
| import java.util.ArrayList;
|
|
|
| @@ -28,7 +28,6 @@
|
| // desktop activity.
|
| private boolean mSwitchToDesktopActivity;
|
|
|
| - private Client mClient;
|
| private CardboardRenderer mRenderer;
|
| private SpeechRecognizer mSpeechRecognizer;
|
|
|
| @@ -39,12 +38,9 @@
|
| public void onCreate(Bundle savedInstanceState) {
|
| super.onCreate(savedInstanceState);
|
| setContentView(R.layout.cardboard_desktop);
|
| -
|
| - mClient = Client.getInstance();
|
| -
|
| mSwitchToDesktopActivity = false;
|
| CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
|
| - mRenderer = new CardboardRenderer(this, mClient);
|
| + mRenderer = new CardboardRenderer(this);
|
| mIsListening = false;
|
|
|
| // Associate a CardboardView.StereoRenderer with cardboard view.
|
| @@ -79,9 +75,9 @@
|
| } else {
|
| if (mRenderer.isLookingAtDesktop()) {
|
| PointF coordinates = mRenderer.getMouseCoordinates();
|
| - mClient.sendMouseEvent((int) coordinates.x, (int) coordinates.y,
|
| + JniInterface.sendMouseEvent((int) coordinates.x, (int) coordinates.y,
|
| TouchInputHandler.BUTTON_LEFT, true);
|
| - mClient.sendMouseEvent((int) coordinates.x, (int) coordinates.y,
|
| + JniInterface.sendMouseEvent((int) coordinates.x, (int) coordinates.y,
|
| TouchInputHandler.BUTTON_LEFT, false);
|
| } else {
|
| if (mRenderer.isLookingFarawayFromDesktop()) {
|
| @@ -96,14 +92,14 @@
|
| @Override
|
| protected void onStart() {
|
| super.onStart();
|
| - mClient.enableVideoChannel(true);
|
| + JniInterface.enableVideoChannel(true);
|
| }
|
|
|
| @Override
|
| protected void onPause() {
|
| super.onPause();
|
| if (!mSwitchToDesktopActivity) {
|
| - mClient.enableVideoChannel(false);
|
| + JniInterface.enableVideoChannel(false);
|
| }
|
| if (mSpeechRecognizer != null) {
|
| mSpeechRecognizer.stopListening();
|
| @@ -113,7 +109,7 @@
|
| @Override
|
| protected void onResume() {
|
| super.onResume();
|
| - mClient.enableVideoChannel(true);
|
| + JniInterface.enableVideoChannel(true);
|
| }
|
|
|
| @Override
|
| @@ -122,7 +118,7 @@
|
| if (mSwitchToDesktopActivity) {
|
| mSwitchToDesktopActivity = false;
|
| } else {
|
| - mClient.enableVideoChannel(false);
|
| + JniInterface.enableVideoChannel(false);
|
| }
|
| if (mSpeechRecognizer != null) {
|
| mSpeechRecognizer.stopListening();
|
| @@ -190,7 +186,7 @@
|
| ArrayList<String> data =
|
| results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
|
| if (!data.isEmpty()) {
|
| - mClient.sendTextEvent(data.get(0));
|
| + JniInterface.sendTextEvent(data.get(0));
|
| }
|
| }
|
|
|
|
|