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:
burke.davey
2011-05-11 20:34:49 +00:00
parent cdcab027dc
commit 768ea20aa1
3 changed files with 8 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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',