aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java3
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java20
2 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index 99ba3ddfe..053685fc6 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -107,7 +107,7 @@ public class NotificationService {
}
@RequiresApi(api = Build.VERSION_CODES.O)
- public void initializeChannels() {
+ void initializeChannels() {
final Context c = mXmppConnectionService;
final NotificationManager notificationManager = c.getSystemService(NotificationManager.class);
if (notificationManager == null) {
@@ -969,6 +969,7 @@ public class NotificationService {
} else {
intent = new Intent(mXmppConnectionService, EditAccountActivity.class);
intent.putExtra("jid", errors.get(0).getJid().asBareJid().toEscapedString());
+ intent.putExtra(EditAccountActivity.EXTRA_OPENED_FROM_NOTIFICATION, true);
}
mBuilder.setContentIntent(PendingIntent.getActivity(mXmppConnectionService, 145, intent, PendingIntent.FLAG_UPDATE_CURRENT));
if (Compatibility.runsTwentySix()) {
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
index 426627510..5daaafacd 100644
--- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
@@ -81,6 +81,8 @@ import rocks.xmpp.addr.Jid;
public class EditAccountActivity extends OmemoActivity implements OnAccountUpdate, OnUpdateBlocklist,
OnKeyStatusUpdated, OnCaptchaRequested, KeyChainAliasCallback, XmppConnectionService.OnShowErrorToast, XmppConnectionService.OnMamPreferencesFetched {
+ public static final String EXTRA_OPENED_FROM_NOTIFICATION = "opened_from_notification";
+
private static final int REQUEST_DATA_SAVER = 0xf244;
private static final int REQUEST_CHANGE_STATUS = 0xee11;
@@ -673,23 +675,17 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}
}
boolean init = intent.getBooleanExtra("init", false);
+ boolean openedFromNotification = intent.getBooleanExtra(EXTRA_OPENED_FROM_NOTIFICATION, false);
this.mInitMode = init || this.jidToEdit == null;
this.messageFingerprint = intent.getStringExtra("fingerprint");
if (!mInitMode) {
this.binding.accountRegisterNew.setVisibility(View.GONE);
- if (getSupportActionBar() != null) {
- getSupportActionBar().setTitle(getString(R.string.account_details));
- }
+ setTitle(getString(R.string.account_details));
+ configureActionBar(getSupportActionBar(), !openedFromNotification);
} else {
- binding.avater.setVisibility(View.GONE);
- ActionBar ab = getSupportActionBar();
- if (ab != null) {
- if (init && Config.MAGIC_CREATE_DOMAIN == null) {
- ab.setDisplayShowHomeEnabled(false);
- ab.setDisplayHomeAsUpEnabled(false);
- }
- ab.setTitle(R.string.action_add_account);
- }
+ this.binding.avater.setVisibility(View.GONE);
+ configureActionBar(getSupportActionBar(), !(init && Config.MAGIC_CREATE_DOMAIN == null));
+ setTitle(R.string.action_add_account);
}
}
SharedPreferences preferences = getPreferences();