Skip to content

Commit

Permalink
fixed server info push not showing up when unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
iNPUTmice committed Feb 14, 2016
1 parent 92a6e95 commit 3561999
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ public void registerPushTokenOnServer(Account account) {
public boolean available(Account account) {
return false;
}

public boolean isStub() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,9 @@ private void updateAccountInformation(boolean init) {
this.mServerInfoHttpUpload.setText(R.string.server_info_unavailable);
}

this.mPushRow.setVisibility(xmppConnectionService.getPushManagementService().available(mAccount) ? View.VISIBLE : View.GONE);
this.mPushRow.setVisibility(xmppConnectionService.getPushManagementService().isStub() ? View.GONE : View.VISIBLE);

if (features.push()) {
if (xmppConnectionService.getPushManagementService().available(mAccount)) {
this.mServerInfoPush.setText(R.string.server_info_available);
} else {
this.mServerInfoPush.setText(R.string.server_info_unavailable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ private void enablePushOnServer(final Account account, final Jid jid, final Stri
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
if (packet.getType() == IqPacket.TYPE.RESULT) {
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": successfully enabled push on server");
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": successfully enabled push on server");
} else if (packet.getType() == IqPacket.TYPE.ERROR) {
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": enabling push on server failed");
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": enabling push on server failed");
}
}
});
Expand Down Expand Up @@ -109,6 +109,10 @@ private boolean playServicesAvailable() {
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mXmppConnectionService) == ConnectionResult.SUCCESS;
}

public boolean isStub() {
return false;
}

interface OnGcmInstanceTokenRetrieved {
void onGcmInstanceTokenRetrieved(String token);
}
Expand Down

0 comments on commit 3561999

Please sign in to comment.