fixed compile bug in free version
This commit is contained in:
parent
6217e33a87
commit
c7a14092a8
|
@ -14,7 +14,7 @@ public class PushManagementService {
|
|||
//stub implementation. only affects playstore flavor
|
||||
}
|
||||
|
||||
public boolean available() {
|
||||
public boolean available(Account account) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||
fetchRosterFromServer(account);
|
||||
fetchBookmarks(account);
|
||||
sendPresence(account);
|
||||
if (mPushManagementService.pushAvailable(account)) {
|
||||
if (mPushManagementService.available(account)) {
|
||||
mPushManagementService.registerPushTokenOnServer(account);
|
||||
}
|
||||
mMessageArchiveService.executePendingQueries(account);
|
||||
|
@ -2856,7 +2856,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||
|
||||
private void refreshAllGcmTokens() {
|
||||
for(Account account : getAccounts()) {
|
||||
if (account.isOnlineAndConnected() && mPushManagementService.pushAvailable(account)) {
|
||||
if (account.isOnlineAndConnected() && mPushManagementService.available(account)) {
|
||||
mPushManagementService.registerPushTokenOnServer(account);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -686,7 +686,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
|
|||
this.mServerInfoHttpUpload.setText(R.string.server_info_unavailable);
|
||||
}
|
||||
|
||||
this.mPushRow.setVisibility(xmppConnectionService.getPushManagementService().available() ? View.VISIBLE : View.GONE);
|
||||
this.mPushRow.setVisibility(xmppConnectionService.getPushManagementService().available(mAccount) ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (features.push()) {
|
||||
this.mServerInfoPush.setText(R.string.server_info_available);
|
||||
|
|
|
@ -20,7 +20,7 @@ import eu.siacs.conversations.xmpp.stanzas.IqPacket;
|
|||
|
||||
public class PushManagementService {
|
||||
|
||||
private static final String APP_SERVER = "push.conversations.im";
|
||||
private static final String APP_SERVER = "push.siacs.eu";
|
||||
|
||||
protected final XmppConnectionService mXmppConnectionService;
|
||||
|
||||
|
@ -64,12 +64,13 @@ public class PushManagementService {
|
|||
|
||||
}
|
||||
|
||||
public boolean available() {
|
||||
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mXmppConnectionService) == ConnectionResult.SUCCESS;
|
||||
|
||||
public boolean available(Account account) {
|
||||
return account.getXmppConnection().getFeatures().push() && playServicesAvailable();
|
||||
}
|
||||
|
||||
public boolean pushAvailable(Account account) {
|
||||
return account.getXmppConnection().getFeatures().push() && available();
|
||||
private boolean playServicesAvailable() {
|
||||
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mXmppConnectionService) == ConnectionResult.SUCCESS;
|
||||
}
|
||||
|
||||
interface OnGcmInstanceTokenRetrieved {
|
||||
|
|
5
src/playstore/res/values/gcm.xml
Normal file
5
src/playstore/res/values/gcm.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="gcm_defaultSenderId" translatable="false">159709679736</string>
|
||||
<string name="google_app_id">1:159709679736:android:a61b47ae910a1ad7</string>
|
||||
</resources>
|
Loading…
Reference in a new issue