mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Remove unneeded SEEN_WELCOME_SCREEN_PREF
This commit is contained in:
parent
40b901d417
commit
4660905c09
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
@ -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() }
|
||||||
|
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user