Remove unneeded SEEN_WELCOME_SCREEN_PREF

This commit is contained in:
bemusementpark 2024-07-03 18:28:12 +09:30
parent 40b901d417
commit 4660905c09
7 changed files with 4 additions and 26 deletions

View File

@ -263,7 +263,7 @@ public class ApplicationContext extends Application implements DefaultLifecycleO
// If the user account hasn't been created or onboarding wasn't finished then don't start // If the user account hasn't been created or onboarding wasn't finished then don't start
// the pollers // the pollers
if (textSecurePreferences.getLocalNumber() == null || !textSecurePreferences.hasSeenWelcomeScreen()) { if (textSecurePreferences.getLocalNumber() == null) {
return; return;
} }

View File

@ -131,8 +131,6 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
return STATE_PROMPT_PASSPHRASE; return STATE_PROMPT_PASSPHRASE;
} else if (DatabaseUpgradeActivity.isUpdate(this)) { } else if (DatabaseUpgradeActivity.isUpdate(this)) {
return STATE_UPGRADE_DATABASE; return STATE_UPGRADE_DATABASE;
} else if (!TextSecurePreferences.hasSeenWelcomeScreen(this)) {
return STATE_WELCOME_SCREEN;
} else { } else {
return STATE_NORMAL; return STATE_NORMAL;
} }

View File

@ -56,6 +56,7 @@ import org.session.libsession.messaging.jobs.JobQueue
import org.session.libsession.messaging.sending_receiving.MessageSender import org.session.libsession.messaging.sending_receiving.MessageSender
import org.session.libsession.snode.SnodeAPI import org.session.libsession.snode.SnodeAPI
import org.session.libsession.utilities.Address import org.session.libsession.utilities.Address
import org.session.libsession.utilities.AppTextSecurePreferences
import org.session.libsession.utilities.GroupUtil import org.session.libsession.utilities.GroupUtil
import org.session.libsession.utilities.ProfilePictureModifiedEvent import org.session.libsession.utilities.ProfilePictureModifiedEvent
import org.session.libsession.utilities.TextSecurePreferences import org.session.libsession.utilities.TextSecurePreferences

View File

@ -76,7 +76,7 @@ class BackgroundPollWorker(val context: Context, params: WorkerParameters) : Wor
} }
override fun doWork(): Result { override fun doWork(): Result {
if (TextSecurePreferences.getLocalNumber(context) == null || !TextSecurePreferences.hasSeenWelcomeScreen(context)) { if (TextSecurePreferences.getLocalNumber(context) == null) {
Log.v(TAG, "User not registered yet.") Log.v(TAG, "User not registered yet.")
return Result.failure() return Result.failure()
} }

View File

@ -271,7 +271,7 @@ public class DefaultMessageNotifier implements MessageNotifier {
try { try {
telcoCursor = DatabaseComponent.get(context).mmsSmsDatabase().getUnread(); // TODO: add a notification specific lighter query here telcoCursor = DatabaseComponent.get(context).mmsSmsDatabase().getUnread(); // TODO: add a notification specific lighter query here
if ((telcoCursor == null || telcoCursor.isAfterLast()) || !TextSecurePreferences.hasSeenWelcomeScreen(context)) if ((telcoCursor == null || telcoCursor.isAfterLast()) || TextSecurePreferences.getLocalNumber(context) == null)
{ {
updateBadge(context, 0); updateBadge(context, 0);
cancelActiveNotifications(context); cancelActiveNotifications(context);

View File

@ -42,7 +42,6 @@ class MessageNotificationsActivity : BaseActionBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setUpActionBarSessionLogo() setUpActionBarSessionLogo()
prefs.setHasSeenWelcomeScreen(true)
setComposeContent { MessageNotificationsScreen() } setComposeContent { MessageNotificationsScreen() }

View File

@ -118,8 +118,6 @@ interface TextSecurePreferences {
fun isPassphraseTimeoutEnabled(): Boolean fun isPassphraseTimeoutEnabled(): Boolean
fun getPassphraseTimeoutInterval(): Int fun getPassphraseTimeoutInterval(): Int
fun getLanguage(): String? fun getLanguage(): String?
fun hasSeenWelcomeScreen(): Boolean
fun setHasSeenWelcomeScreen(value: Boolean)
fun isNotificationsEnabled(): Boolean fun isNotificationsEnabled(): Boolean
fun getNotificationRingtone(): Uri fun getNotificationRingtone(): Uri
fun removeNotificationRingtone() fun removeNotificationRingtone()
@ -216,7 +214,6 @@ interface TextSecurePreferences {
const val THREAD_TRIM_ENABLED = "pref_trim_threads" const val THREAD_TRIM_ENABLED = "pref_trim_threads"
const val LOCAL_NUMBER_PREF = "pref_local_number" const val LOCAL_NUMBER_PREF = "pref_local_number"
const val REGISTERED_GCM_PREF = "pref_gcm_registered" const val REGISTERED_GCM_PREF = "pref_gcm_registered"
const val SEEN_WELCOME_SCREEN_PREF = "pref_seen_welcome_screen"
const val UPDATE_APK_REFRESH_TIME_PREF = "pref_update_apk_refresh_time" const val UPDATE_APK_REFRESH_TIME_PREF = "pref_update_apk_refresh_time"
const val UPDATE_APK_DOWNLOAD_ID = "pref_update_apk_download_id" const val UPDATE_APK_DOWNLOAD_ID = "pref_update_apk_download_id"
const val UPDATE_APK_DIGEST = "pref_update_apk_digest" const val UPDATE_APK_DIGEST = "pref_update_apk_digest"
@ -707,15 +704,6 @@ interface TextSecurePreferences {
return getStringPreference(context, LANGUAGE_PREF, "zz") return getStringPreference(context, LANGUAGE_PREF, "zz")
} }
@JvmStatic
fun hasSeenWelcomeScreen(context: Context): Boolean {
return getBooleanPreference(context, SEEN_WELCOME_SCREEN_PREF, false)
}
fun setHasSeenWelcomeScreen(context: Context, value: Boolean) {
setBooleanPreference(context, SEEN_WELCOME_SCREEN_PREF, value)
}
@JvmStatic @JvmStatic
fun isNotificationsEnabled(context: Context): Boolean { fun isNotificationsEnabled(context: Context): Boolean {
return getBooleanPreference(context, NOTIFICATION_PREF, true) return getBooleanPreference(context, NOTIFICATION_PREF, true)
@ -1341,14 +1329,6 @@ class AppTextSecurePreferences @Inject constructor(
return getStringPreference(TextSecurePreferences.LANGUAGE_PREF, "zz") return getStringPreference(TextSecurePreferences.LANGUAGE_PREF, "zz")
} }
override fun hasSeenWelcomeScreen(): Boolean {
return getBooleanPreference(TextSecurePreferences.SEEN_WELCOME_SCREEN_PREF, false)
}
override fun setHasSeenWelcomeScreen(value: Boolean) {
setBooleanPreference(TextSecurePreferences.SEEN_WELCOME_SCREEN_PREF, value)
}
override fun isNotificationsEnabled(): Boolean { override fun isNotificationsEnabled(): Boolean {
return getBooleanPreference(TextSecurePreferences.NOTIFICATION_PREF, true) return getBooleanPreference(TextSecurePreferences.NOTIFICATION_PREF, true)
} }