Fix some dead back button handling.

This commit is contained in:
Greyson Parrelli
2026-08-04 09:23:14 -04:00
committed by Alex Hart
parent 7e6c89931d
commit d441c3da53
3 changed files with 8 additions and 18 deletions
@@ -313,13 +313,6 @@ public class SubmitDebugLogActivity extends BaseActivity {
return false;
}
@Override
public void onBackPressed() {
if (!viewModel.onBackPressed()) {
super.onBackPressed();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
@@ -172,10 +172,6 @@ public class SubmitDebugLogViewModel extends ViewModel {
});
}
boolean onBackPressed() {
return false;
}
enum Mode {
NORMAL, LOADING, SUBMITTING
}
@@ -1,8 +1,8 @@
package org.thoughtcrime.securesms.megaphone;
import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.activity.OnBackPressedCallback;
import androidx.core.view.WindowInsetsCompat;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
@@ -31,6 +31,13 @@ public class ClientDeprecatedActivity extends PassphraseRequiredActivity {
findViewById(R.id.client_deprecated_update_button).setOnClickListener(v -> onUpdateClicked());
findViewById(R.id.client_deprecated_dont_update_button).setOnClickListener(v -> onDontUpdateClicked());
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
// The user must explicitly choose to update or to dismiss this screen.
}
});
}
@Override
@@ -44,12 +51,6 @@ public class ClientDeprecatedActivity extends PassphraseRequiredActivity {
theme.onResume(this);
}
@SuppressLint("MissingSuperCall")
@Override
public void onBackPressed() {
// Disabled
}
private void onUpdateClicked() {
PlayStoreUtil.openPlayStoreOrOurApkDownloadPage(this);
}