Skip to content

Commit 4227eb2

Browse files
authored
chore: remove scala migration code and related references [WPB-17693] (#4036)
1 parent df2af36 commit 4227eb2

File tree

61 files changed

+37
-4862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+37
-4862
lines changed

app/src/androidTest/kotlin/com/wire/android/ui/debug/DebugScreenComposeTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class DebugScreenComposeTest {
3535
WireTestTheme {
3636
UserDebugContent(
3737
onNavigationPressed = { },
38-
onManualMigrationPressed = {},
3938
state = UserDebugState(logPath = "logPath"),
4039
onLoggingEnabledChange = {},
4140
onDeleteLogs = {},

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -339,16 +339,6 @@
339339
</intent-filter>
340340
</receiver>
341341

342-
343-
<receiver
344-
android:name=".migration.UpdateReceiver"
345-
android:enabled="true"
346-
android:exported="false">
347-
<intent-filter>
348-
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
349-
</intent-filter>
350-
</receiver>
351-
352342
<service
353343
android:name=".services.PersistentWebSocketService"
354344
android:exported="false"

app/src/main/kotlin/com/wire/android/datastore/GlobalDataStore.kt

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import androidx.datastore.preferences.core.stringPreferencesKey
2828
import androidx.datastore.preferences.preferencesDataStore
2929
import com.wire.android.BuildConfig
3030
import com.wire.android.feature.AppLockSource
31-
import com.wire.android.migration.failure.UserMigrationStatus
3231
import com.wire.android.ui.theme.ThemeOption
3332
import com.wire.android.util.sha256
3433
import dagger.hilt.android.qualifiers.ApplicationContext
@@ -50,7 +49,6 @@ class GlobalDataStore @Inject constructor(@ApplicationContext private val contex
5049
// keys
5150
private val SHOW_CALLING_DOUBLE_TAP_TOAST =
5251
booleanPreferencesKey("show_calling_double_tap_toast_")
53-
private val MIGRATION_COMPLETED = booleanPreferencesKey("migration_completed")
5452
private val WELCOME_SCREEN_PRESENTED = booleanPreferencesKey("welcome_screen_presented")
5553
private val IS_LOGGING_ENABLED = booleanPreferencesKey("is_logging_enabled")
5654
private val APP_LOCK_PASSCODE = stringPreferencesKey("app_lock_passcode")
@@ -63,14 +61,8 @@ class GlobalDataStore @Inject constructor(@ApplicationContext private val contex
6361

6462
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = PREFERENCES_NAME)
6563

66-
private fun userMigrationStatusKey(userId: String): Preferences.Key<Int> =
67-
intPreferencesKey("user_migration_status_$userId")
68-
6964
private fun userDoubleTapToastStatusKey(userId: String): Preferences.Key<Boolean> =
7065
booleanPreferencesKey("$SHOW_CALLING_DOUBLE_TAP_TOAST$userId")
71-
72-
private fun userLastMigrationAppVersion(userId: String): Preferences.Key<Int> =
73-
intPreferencesKey("migration_app_version_$userId")
7466
}
7567

7668
suspend fun clear() {
@@ -86,10 +78,6 @@ class GlobalDataStore @Inject constructor(@ApplicationContext private val contex
8678
): Flow<String> =
8779
context.dataStore.data.map { it[key] ?: defaultValue }
8880

89-
fun isMigrationCompletedFlow(): Flow<Boolean> = getBooleanPreference(MIGRATION_COMPLETED, false)
90-
91-
suspend fun isMigrationCompleted(): Boolean = isMigrationCompletedFlow().firstOrNull() ?: false
92-
9381
fun isLoggingEnabled(): Flow<Boolean> =
9482
getBooleanPreference(IS_LOGGING_ENABLED, BuildConfig.LOGGING_ENABLED)
9583

@@ -104,59 +92,9 @@ class GlobalDataStore @Inject constructor(@ApplicationContext private val contex
10492
context.dataStore.edit { it[RECORD_AUDIO_EFFECTS_CHECKBOX] = enabled }
10593
}
10694

107-
suspend fun setMigrationCompleted() {
108-
context.dataStore.edit { it[MIGRATION_COMPLETED] = true }
109-
}
110-
11195
suspend fun isWelcomeScreenPresented(): Boolean =
11296
getBooleanPreference(WELCOME_SCREEN_PRESENTED, false).firstOrNull() ?: false
11397

114-
suspend fun setWelcomeScreenPresented() {
115-
context.dataStore.edit { it[WELCOME_SCREEN_PRESENTED] = true }
116-
}
117-
118-
suspend fun setWelcomeScreenNotPresented() {
119-
context.dataStore.edit { it[WELCOME_SCREEN_PRESENTED] = false }
120-
}
121-
122-
suspend fun setUserMigrationStatus(userId: String, status: UserMigrationStatus) {
123-
context.dataStore.edit { it[userMigrationStatusKey(userId)] = status.value }
124-
when (status) {
125-
UserMigrationStatus.Completed,
126-
UserMigrationStatus.CompletedWithErrors,
127-
UserMigrationStatus.Successfully -> setUserMigrationAppVersion(
128-
userId,
129-
BuildConfig.VERSION_CODE
130-
)
131-
132-
UserMigrationStatus.NoNeed,
133-
UserMigrationStatus.NotStarted -> {
134-
/* no-op */
135-
}
136-
}
137-
}
138-
139-
/**
140-
* Returns the migration status of the user with the given [userId].
141-
* If there is no status stored, the status will be [UserMigrationStatus.NoNeed]
142-
* meaning that the user does not need to be migrated.
143-
*/
144-
fun getUserMigrationStatus(userId: String): Flow<UserMigrationStatus?> =
145-
context.dataStore.data.map {
146-
it[userMigrationStatusKey(userId)]?.let { status ->
147-
UserMigrationStatus.fromInt(
148-
status
149-
)
150-
}
151-
}
152-
153-
suspend fun setUserMigrationAppVersion(userId: String, version: Int) {
154-
context.dataStore.edit { it[userLastMigrationAppVersion(userId)] = version }
155-
}
156-
157-
suspend fun getUserMigrationAppVersion(userId: String): Int? =
158-
context.dataStore.data.map { it[userLastMigrationAppVersion(userId)] }.firstOrNull()
159-
16098
suspend fun setShouldShowDoubleTapToastStatus(userId: String, shouldShow: Boolean) {
16199
context.dataStore.edit { it[userDoubleTapToastStatusKey(userId)] = shouldShow }
162100
}

0 commit comments

Comments
 (0)