Bug 1216307 - Backout e0ba952c2819 to backout top level shareplane (bug 1140048).

This commit is contained in:
Michael Comella 2015-11-18 15:56:52 -08:00
parent 983be2c090
commit 2fc4f165ce

View File

@ -1292,6 +1292,32 @@ public class ActivityChooserModel extends DataSetObservable {
}
}
/**
* Mozilla: Return whether or not there are other synced clients.
*/
private boolean hasOtherSyncClients() {
// ClientsDatabaseAccessor returns stale data (bug 1145896) so we work around this by
// checking if we have accounts set up - if not, we can't have any clients.
if (!FirefoxAccounts.firefoxAccountsExist(mContext) &&
!SyncAccounts.syncAccountsExist(mContext)) {
return false;
}
final BrowserDB browserDB = GeckoProfile.get(mContext).getDB();
final TabsAccessor tabsAccessor = browserDB.getTabsAccessor();
final Cursor remoteClientsCursor = tabsAccessor
.getRemoteClientsByRecencyCursor(mContext);
if (remoteClientsCursor == null) {
return false;
}
try {
return remoteClientsCursor.getCount() > 0;
} finally {
remoteClientsCursor.close();
}
}
/**
* Mozilla: Reload activities on sync.
*/