move routing logic to all activities

Fixes #2239
Closes #27923

// FREEBIE
This commit is contained in:
Jake McGinty
2014-12-15 12:25:55 -08:00
committed by Moxie Marlinspike
parent 141ee6565d
commit 0ff99258ac
52 changed files with 503 additions and 984 deletions

View File

@@ -18,6 +18,7 @@
package org.thoughtcrime.securesms;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.widget.TextView;
import android.widget.Toast;
@@ -29,7 +30,6 @@ import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.recipients.RecipientFactory;
import org.thoughtcrime.securesms.util.DynamicLanguage;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.MemoryCleaner;
import org.whispersystems.libaxolotl.AxolotlAddress;
import org.whispersystems.libaxolotl.IdentityKey;
import org.whispersystems.libaxolotl.state.SessionRecord;
@@ -53,10 +53,14 @@ public class VerifyIdentityActivity extends KeyScanningActivity {
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
@Override
public void onCreate(Bundle state) {
protected void onPreCreate() {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this);
super.onCreate(state);
}
@Override
protected void onCreate(Bundle state, @NonNull MasterSecret masterSecret) {
this.masterSecret = masterSecret;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.verify_identity_activity);
@@ -73,12 +77,6 @@ public class VerifyIdentityActivity extends KeyScanningActivity {
}
@Override
protected void onDestroy() {
MemoryCleaner.clean(masterSecret);
super.onDestroy();
}
private void initializeLocalIdentityKey() {
if (!IdentityKeyUtil.hasIdentityKey(this)) {
localIdentityFingerprint.setText(R.string.VerifyIdentityActivity_you_do_not_have_an_identity_key);
@@ -116,7 +114,6 @@ public class VerifyIdentityActivity extends KeyScanningActivity {
this.localIdentityFingerprint = (TextView)findViewById(R.id.you_read);
this.remoteIdentityFingerprint = (TextView)findViewById(R.id.friend_reads);
this.recipient = RecipientFactory.getRecipientForId(this, this.getIntent().getLongExtra("recipient", -1), true);
this.masterSecret = this.getIntent().getParcelableExtra("master_secret");
}
@Override