Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: remoting/host/android/jni_host.cc

Issue 1896293002: [remoting android] Display IT2Me host state and access-code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@android-host-state-changed
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/android/host/src/org/chromium/chromoting/host/MainActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/android/jni_host.cc
diff --git a/remoting/host/android/jni_host.cc b/remoting/host/android/jni_host.cc
index f6ae73cd911f3a66c2bcda4db2a138bfb50a46e6..11b3bcc90e7f26bc1a1583c9779eacc0d9ae6c84 100644
--- a/remoting/host/android/jni_host.cc
+++ b/remoting/host/android/jni_host.cc
@@ -92,7 +92,12 @@ void JniHost::Connect(JNIEnv* env,
}
void JniHost::Disconnect(JNIEnv* env,
- const base::android::JavaParamRef<jobject>& caller) {}
+ const base::android::JavaParamRef<jobject>& caller) {
+ if (it2me_host_) {
+ it2me_host_->Disconnect();
+ it2me_host_ = nullptr;
+ }
+}
void JniHost::OnClientAuthenticated(const std::string& client_username) {
HOST_LOG << "OnClientAuthenticated: " << client_username;
@@ -112,6 +117,10 @@ void JniHost::OnNatPolicyChanged(bool nat_traversal_enabled) {
void JniHost::OnStateChanged(It2MeHostState state,
const std::string& error_message) {
+ if (state == kDisconnected) {
+ it2me_host_ = nullptr;
+ }
+
JNIEnv* env = base::android::AttachCurrentThread();
Java_Host_onStateChanged(env, java_host_.obj(), state,
ConvertUTF8ToJavaString(env, error_message).obj());
« no previous file with comments | « remoting/android/host/src/org/chromium/chromoting/host/MainActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698