diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 8e5b69446c..ace5c81075 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -264,7 +264,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private ImageButton attachButton; private ProfilePictureView profilePictureView; private TextView titleTextView; - private TextView charactersLeft; private ConversationFragment fragment; private Button unblockButton; private Button makeDefaultSmsButton; @@ -284,7 +283,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private AudioRecorder audioRecorder; private Handler audioHandler; private Runnable stopRecordingTask; - private BroadcastReceiver securityUpdateReceiver; private Stub emojiDrawerStub; protected HidingLinearLayout quickAttachmentToggle; protected HidingLinearLayout inlineAttachmentToggle; @@ -296,9 +294,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private Recipient recipient; private long threadId; private int distributionType; - private boolean archived; private boolean isDefaultSms = false; - private boolean isMmsEnabled = false; private boolean isSecurityInitialized = false; private int expandedKeyboardHeight = 0; private int collapsedKeyboardHeight = Integer.MAX_VALUE; @@ -476,7 +472,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity EventBus.getDefault().register(this); initializeEnabledCheck(); - initializeMmsEnabledCheck(); composeText.setTransport(); updateTitleTextView(recipient); @@ -533,7 +528,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity protected void onDestroy() { saveDraft(); if (recipient != null) recipient.removeListener(this); - if (securityUpdateReceiver != null) unregisterReceiver(securityUpdateReceiver); for (BroadcastReceiver broadcastReceiver : broadcastReceivers) { LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver); } @@ -1145,16 +1139,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } private void handleAddAttachment() { - if (this.isMmsEnabled) { - if (attachmentTypeSelector == null) { - attachmentTypeSelector = new AttachmentTypeSelector( - this, - LoaderManager.getInstance(this), - new AttachmentTypeListener(), - keyboardHeight); - } - attachmentTypeSelector.show(this, attachButton); + if (attachmentTypeSelector == null) { + attachmentTypeSelector = new AttachmentTypeSelector( + this, + LoaderManager.getInstance(this), + new AttachmentTypeListener(), + keyboardHeight); } + attachmentTypeSelector.show(this, attachButton); } private void handleSecurityChange(boolean isSecureText, boolean isDefaultSms) { @@ -1340,20 +1332,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } } - private void initializeMmsEnabledCheck() { - new AsyncTask() { - @Override - protected Boolean doInBackground(Void... params) { - return org.thoughtcrime.securesms.util.Util.isMmsCapable(ConversationActivity.this); - } - - @Override - protected void onPostExecute(Boolean isMmsEnabled) { - ConversationActivity.this.isMmsEnabled = isMmsEnabled; - } - }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } - private void initializeViews() { profilePictureView = findViewById(R.id.profilePictureView); titleTextView = findViewById(R.id.titleTextView); @@ -1361,7 +1339,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity sendButton = ViewUtil.findById(this, R.id.send_button); attachButton = ViewUtil.findById(this, R.id.attach_button); composeText = ViewUtil.findById(this, R.id.embedded_text_editor); - charactersLeft = ViewUtil.findById(this, R.id.space_left); emojiDrawerStub = ViewUtil.findStubById(this, R.id.emoji_drawer_stub); unblockButton = ViewUtil.findById(this, R.id.unblock_button); makeDefaultSmsButton = ViewUtil.findById(this, R.id.make_default_sms_button); @@ -1402,10 +1379,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity sendButton.setOnClickListener(sendButtonListener); sendButton.setEnabled(true); - /* - titleView.setOnClickListener(v -> handleConversationSettings()); - titleView.setOnLongClickListener(v -> handleDisplayQuickContact()); - */ unblockButton.setOnClickListener(v -> handleUnblock()); makeDefaultSmsButton.setOnClickListener(v -> handleMakeDefaultSms()); @@ -1447,7 +1420,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity if (address == null) { finish(); return; } recipient = Recipient.from(this, address, true); threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1); - archived = getIntent().getBooleanExtra(IS_ARCHIVED_EXTRA, false); distributionType = getIntent().getIntExtra(DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT); glideRequests = GlideApp.with(this); diff --git a/app/src/main/java/org/thoughtcrime/securesms/mms/IncomingMediaMessage.java b/app/src/main/java/org/thoughtcrime/securesms/mms/IncomingMediaMessage.java index a2943c8737..d6c1f73a92 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/mms/IncomingMediaMessage.java +++ b/app/src/main/java/org/thoughtcrime/securesms/mms/IncomingMediaMessage.java @@ -35,30 +35,6 @@ public class IncomingMediaMessage { private final List sharedContacts = new LinkedList<>(); private final List linkPreviews = new LinkedList<>(); - public IncomingMediaMessage(Address from, - Optional
groupId, - String body, - long sentTimeMillis, - List attachments, - int subscriptionId, - long expiresIn, - boolean expirationUpdate, - boolean unidentified) - { - this.from = from; - this.groupId = groupId.orNull(); - this.sentTimeMillis = sentTimeMillis; - this.body = body; - this.push = false; - this.subscriptionId = subscriptionId; - this.expiresIn = expiresIn; - this.expirationUpdate = expirationUpdate; - this.quote = null; - this.unidentified = unidentified; - - this.attachments.addAll(attachments); - } - public IncomingMediaMessage(Address from, long sentTimeMillis, int subscriptionId, diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/Util.java b/app/src/main/java/org/thoughtcrime/securesms/util/Util.java index e2c417f172..bd1802c839 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/Util.java +++ b/app/src/main/java/org/thoughtcrime/securesms/util/Util.java @@ -66,9 +66,4 @@ public class Util { throw new AssertionError(e); } } - - @TargetApi(VERSION_CODES.LOLLIPOP) - public static boolean isMmsCapable(Context context) { - return VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP; - } }