fix: clear task after linking device to prevent going back and treating PNModeActivity.kt viewing as seeing welcome screen so the fallback notifications will be used and allow users through without selecting PN type

pull/468/head
jubb 4 years ago
parent 6614b76411
commit 840cc50a31

@ -115,7 +115,10 @@ class LinkDeviceActivity : BaseActionBarActivity(), ScanQRCodeWrapperFragmentDel
private fun register(skipped: Boolean) {
restoreJob?.cancel()
loader.isVisible = false
ApplicationContext.getInstance(this).stopPolling()
val intent = Intent(this@LinkDeviceActivity, if (skipped) DisplayNameActivity::class.java else PNModeActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
push(intent)
}
// endregion

@ -33,6 +33,7 @@ class PNModeActivity : BaseActionBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setUpActionBarSessionLogo()
TextSecurePreferences.setHasSeenWelcomeScreen(this, true)
setContentView(R.layout.activity_pn_mode)
contentView.disableClipping()
fcmOptionView.setOnClickListener { toggleFCM() }
@ -150,7 +151,6 @@ class PNModeActivity : BaseActionBarActivity() {
dialog.create().show()
return
}
TextSecurePreferences.setHasSeenWelcomeScreen(this, true)
TextSecurePreferences.setIsUsingFCM(this, (selectedOptionView == fcmOptionView))
val application = ApplicationContext.getInstance(this)
application.setUpStorageAPIIfNeeded()

Loading…
Cancel
Save