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

Unified Diff: remoting/android/host/src/org/chromium/chromoting/host/MainActivity.java

Issue 1884253003: [remoting android] Plumb It2Me events from C++ to Java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@android-host-it2me-connect
Patch Set: Address comments, git cl format 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/BUILD.gn ('k') | remoting/android/host/src/org/chromium/chromoting/host/jni/Host.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/host/src/org/chromium/chromoting/host/MainActivity.java
diff --git a/remoting/android/host/src/org/chromium/chromoting/host/MainActivity.java b/remoting/android/host/src/org/chromium/chromoting/host/MainActivity.java
index dacf21fb9e84b54e46e698d45b1df40472d61f7e..5d304d655892d18f8c1a840edd846177eb790972 100644
--- a/remoting/android/host/src/org/chromium/chromoting/host/MainActivity.java
+++ b/remoting/android/host/src/org/chromium/chromoting/host/MainActivity.java
@@ -14,11 +14,12 @@ import android.view.View;
import org.chromium.base.Log;
import org.chromium.chromoting.base.OAuthTokenFetcher;
import org.chromium.chromoting.host.jni.Host;
+import org.chromium.chromoting.host.jni.It2MeHostObserver;
/**
* Main screen of the Chromoting Host application.
*/
-public class MainActivity extends AppCompatActivity {
+public class MainActivity extends AppCompatActivity implements It2MeHostObserver {
private static final String TAG = "host";
/** Scope to use when fetching the OAuth token. */
@@ -69,7 +70,7 @@ public class MainActivity extends AppCompatActivity {
new OAuthTokenFetcher(this, mAccountName, TOKEN_SCOPE, new OAuthTokenFetcher.Callback() {
@Override
public void onTokenFetched(String token) {
- mHost.connect(mAccountName, token);
+ mHost.connect(mAccountName, token, MainActivity.this);
}
@Override
@@ -78,4 +79,14 @@ public class MainActivity extends AppCompatActivity {
}
}).fetch();
}
+
+ @Override
+ public void onAccessCodeReceived(String accessCode, int lifetimeSeconds) {
+ Log.e(TAG, "OnAccessCodeReceived: %s, %d", accessCode, lifetimeSeconds);
+ }
+
+ @Override
+ public void onStateChanged(State state, String errorMessage) {
+ Log.e(TAG, "OnStateChanged: %s", state.name());
+ }
}
« no previous file with comments | « remoting/android/BUILD.gn ('k') | remoting/android/host/src/org/chromium/chromoting/host/jni/Host.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698