Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/Chromoting.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java |
| index 800be2e323e043b80d7705411ddc1359ec91d527..ef38ec1fa24287c5b5caf643917badea87255dd8 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java |
| @@ -36,6 +36,7 @@ import org.chromium.chromoting.accountswitcher.AccountSwitcher; |
| import org.chromium.chromoting.accountswitcher.AccountSwitcherFactory; |
| import org.chromium.chromoting.help.HelpContext; |
| import org.chromium.chromoting.help.HelpSingleton; |
| +import org.chromium.chromoting.jni.Client; |
| import org.chromium.chromoting.jni.ConnectionListener; |
| import org.chromium.chromoting.jni.JniInterface; |
| @@ -335,7 +336,7 @@ public class Chromoting extends AppCompatActivity implements ConnectionListener, |
| @Override |
| public void onDestroy() { |
| super.onDestroy(); |
| - JniInterface.disconnectFromHost(); |
| + JniInterface.destroyClient(); |
| mAccountSwitcher.destroy(); |
| } |
| @@ -430,6 +431,7 @@ public class Chromoting extends AppCompatActivity implements ConnectionListener, |
| } |
| private void connectToHost(HostInfo host) { |
| + Client client = JniInterface.createClient(); |
|
Sergey Ulanov
2015/12/21 17:58:15
Can this be replaced with "new Client()". The Clie
Lambros
2016/01/29 23:58:25
Done.
|
| mProgressIndicator = ProgressDialog.show( |
| this, |
| host.name, |
| @@ -439,11 +441,11 @@ public class Chromoting extends AppCompatActivity implements ConnectionListener, |
| new DialogInterface.OnCancelListener() { |
| @Override |
| public void onCancel(DialogInterface dialog) { |
| - JniInterface.disconnectFromHost(); |
| + JniInterface.destroyClient(); |
|
Sergey Ulanov
2015/12/21 17:58:15
client.destroy()?
Lambros
2016/01/29 23:58:25
Done.
|
| } |
| }); |
| - SessionConnector connector = new SessionConnector(this, this, mHostListLoader); |
| - mAuthenticator = new SessionAuthenticator(this, host); |
| + SessionConnector connector = new SessionConnector(client, this, this, mHostListLoader); |
| + mAuthenticator = new SessionAuthenticator(this, client, host); |
| connector.connectToHost(mAccount, mToken, host, mAuthenticator); |
| } |