mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Change share from device to only go to Chrome (simpler mental model for now).
More robustness to browser channel. Temporary logging.
This commit is contained in:
@@ -79,9 +79,7 @@ public class ShareLinkActivity extends Activity implements Handler.Callback {
|
||||
try {
|
||||
List<NameValuePair> params = new ArrayList<NameValuePair>();
|
||||
params.add(new BasicNameValuePair("url", mPendingLink));
|
||||
params.add(new BasicNameValuePair("deviceName", "Chrome," +
|
||||
(DeviceRegistrar.isTablet(ShareLinkActivity.this) ? "Phone" : "Tablet")));
|
||||
|
||||
params.add(new BasicNameValuePair("deviceName", "Chrome"));
|
||||
SharedPreferences settings = Prefs.get(ShareLinkActivity.this);
|
||||
final String accountName = settings.getString("accountName", null);
|
||||
if (accountName == null) {
|
||||
|
||||
@@ -120,6 +120,9 @@ public class SendServlet extends HttpServlet {
|
||||
deviceInfo, reqDebug);
|
||||
}
|
||||
|
||||
// ***** TEMP LOGGING for debugging on test version. Remove before production push *****
|
||||
log.info("Sending " + url + " to " + deviceInfo.getDeviceRegistrationID());
|
||||
|
||||
if (res) {
|
||||
log.info("Link sent to phone! collapse_key:" + collapseKey);
|
||||
ok = true;
|
||||
|
||||
@@ -150,6 +150,10 @@ function initializeBrowserChannel() {
|
||||
} else if (req.responseText.indexOf('NOT_ENABLED') == 0) {
|
||||
console.log('Not initializing browser channel because feature not enabled for user');
|
||||
}
|
||||
} else { // server not happy, random backoff
|
||||
var delay = Math.random() * 20000;
|
||||
console.log('Failed to register browser channel (' + req.status + '), retrying in ' + delay + 'ms');
|
||||
setTimeout('initializeBrowserChannel()', delay);
|
||||
}
|
||||
}, {
|
||||
'method': 'POST',
|
||||
|
||||
Reference in New Issue
Block a user