Skip to content

Commit 7f936f3

Browse files
authored
Merge pull request #370 from chenxiaolong/migration
Remove "initially paused" setting to auto-record rules migration logic
2 parents ca76e9b + 176283d commit 7f936f3

File tree

3 files changed

+0
-100
lines changed

3 files changed

+0
-100
lines changed

app/src/androidTest/java/com/chiller3/bcr/PreferenceMigrationTest.kt

-78
This file was deleted.

app/src/main/java/com/chiller3/bcr/Preferences.kt

-19
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ class Preferences(private val context: Context) {
2828
const val PREF_ADD_RULE = "add_rule"
2929
const val PREF_RULE_PREFIX = "rule_"
3030

31-
// Legacy preferences
32-
internal const val PREF_INITIALLY_PAUSED = "initially_paused"
33-
3431
// Not associated with a UI preference
3532
private const val PREF_DEBUG_MODE = "debug_mode"
3633
private const val PREF_RECORD_RULE_PREFIX = "record_rule_"
@@ -222,22 +219,6 @@ class Preferences(private val context: Context) {
222219
get() = prefs.getBoolean(PREF_RECORD_RULES_HELP_SHOWN, false)
223220
set(shown) = prefs.edit { putBoolean(PREF_RECORD_RULES_HELP_SHOWN, shown) }
224221

225-
/**
226-
* Migrate old "initially paused" setting to the new record rules.
227-
*
228-
* Will be removed in version 1.47.
229-
*/
230-
fun migrateInitiallyPaused() {
231-
if (prefs.contains(PREF_INITIALLY_PAUSED)) {
232-
val oldValue = !prefs.getBoolean(PREF_INITIALLY_PAUSED, false)
233-
recordRules = listOf(
234-
RecordRule.UnknownCalls(oldValue),
235-
RecordRule.AllCalls(oldValue),
236-
)
237-
prefs.edit { remove(PREF_INITIALLY_PAUSED) }
238-
}
239-
}
240-
241222
/**
242223
* The saved output format.
243224
*

app/src/main/java/com/chiller3/bcr/RecorderApplication.kt

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ class RecorderApplication : Application() {
1010
override fun onCreate() {
1111
super.onCreate()
1212

13-
val props = Preferences(this)
14-
props.migrateInitiallyPaused()
15-
1613
// Enable Material You colors
1714
DynamicColors.applyToActivitiesIfAvailable(this)
1815

0 commit comments

Comments
 (0)