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

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/Chromoting.java

Issue 29583003: Use jni_generator in Chromoting Android client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Created 7 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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; 5 package org.chromium.chromoting;
6 6
7 import android.accounts.Account; 7 import android.accounts.Account;
8 import android.accounts.AccountManager; 8 import android.accounts.AccountManager;
9 import android.accounts.AccountManagerCallback; 9 import android.accounts.AccountManagerCallback;
10 import android.accounts.AccountManagerFuture; 10 import android.accounts.AccountManagerFuture;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 synchronized (mUi) { 224 synchronized (mUi) {
225 mAccount = new Account(accountName, accountType); 225 mAccount = new Account(accountName, accountType);
226 mToken = authToken; 226 mToken = authToken;
227 getPreferences(MODE_PRIVATE).edit().putString("account_name" , accountName). 227 getPreferences(MODE_PRIVATE).edit().putString("account_name" , accountName).
228 putString("account_type", accountType).apply(); 228 putString("account_type", accountType).apply();
229 } 229 }
230 230
231 // Send our HTTP request to the directory server. 231 // Send our HTTP request to the directory server.
232 URLConnection link = 232 URLConnection link =
233 new URL(HOST_LIST_PATH + JniInterface.getApiKey()).openC onnection(); 233 new URL(HOST_LIST_PATH + JniInterface.nativeGetApiKey()) .openConnection();
234 link.addRequestProperty("client_id", JniInterface.getClientId()) ; 234 link.addRequestProperty("client_id", JniInterface.nativeGetClien tId());
235 link.addRequestProperty("client_secret", JniInterface.getClientS ecret()); 235 link.addRequestProperty("client_secret", JniInterface.nativeGetC lientSecret());
236 link.setRequestProperty("Authorization", "OAuth " + authToken); 236 link.setRequestProperty("Authorization", "OAuth " + authToken);
237 237
238 // Listen for the server to respond. 238 // Listen for the server to respond.
239 StringBuilder response = new StringBuilder(); 239 StringBuilder response = new StringBuilder();
240 Scanner incoming = new Scanner(link.getInputStream()); 240 Scanner incoming = new Scanner(link.getInputStream());
241 Log.i("auth", "Successfully authenticated to directory server"); 241 Log.i("auth", "Successfully authenticated to directory server");
242 while (incoming.hasNext()) { 242 while (incoming.hasNext()) {
243 response.append(incoming.nextLine()); 243 response.append(incoming.nextLine());
244 } 244 }
245 incoming.close(); 245 incoming.close();
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 Toast.LENGTH_LONG).show(); 414 Toast.LENGTH_LONG).show();
415 415
416 // Close the application. 416 // Close the application.
417 finish(); 417 finish();
418 } 418 }
419 419
420 return target; 420 return target;
421 } 421 }
422 } 422 }
423 } 423 }
OLDNEW
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698