Simply PushServiceSocket constructor.

This commit is contained in:
Moxie Marlinspike
2013-10-19 11:15:45 -07:00
parent 5b2caa0074
commit ca3c82f581
8 changed files with 52 additions and 30 deletions

View File

@@ -47,6 +47,7 @@ import com.actionbarsherlock.view.MenuItem;
import com.google.android.gcm.GCMRegistrar;
import org.thoughtcrime.securesms.contacts.ContactAccessor;
import org.thoughtcrime.securesms.contacts.ContactIdentityManager;
import org.thoughtcrime.securesms.util.TextSecurePushCredentials;
import org.whispersystems.textsecure.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.MasterSecretUtil;
import org.thoughtcrime.securesms.service.KeyCachingService;
@@ -351,10 +352,8 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
@Override
protected Integer doInBackground(Void... params) {
try {
Context context = ApplicationPreferencesActivity.this;
String localNumber = TextSecurePreferences.getLocalNumber(context);
String pushPassword = TextSecurePreferences.getPushServerPassword(context);
PushServiceSocket socket = new PushServiceSocket(context, localNumber, pushPassword);
Context context = ApplicationPreferencesActivity.this;
PushServiceSocket socket = new PushServiceSocket(context, TextSecurePushCredentials.getInstance());
socket.unregisterGcmId();
GCMRegistrar.unregister(context);