Skip to content

Commit 50d60d7

Browse files
committed
fix: Mobile project compile errors after refactor
1 parent 26a658f commit 50d60d7

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

you-have-mail-android/app/src/main/java/dev/lbeernaert/youhavemail/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class MainActivity : ComponentActivity() {
221221

222222
override fun onDestroy() {
223223
if (mState != null) {
224-
mState!!.close(this)
224+
mState!!.close()
225225
mState = null
226226
}
227227

you-have-mail-android/app/src/main/java/dev/lbeernaert/youhavemail/app/State.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
package dev.lbeernaert.youhavemail.app
22

3-
import android.content.BroadcastReceiver
43
import android.content.Context
5-
import android.content.Intent
6-
import android.content.IntentFilter
74
import android.content.SharedPreferences
85
import android.util.Log
9-
import androidx.localbroadcastmanager.content.LocalBroadcastManager
106
import androidx.security.crypto.EncryptedSharedPreferences
117
import androidx.security.crypto.MasterKey
128
import dev.lbeernaert.youhavemail.Account
13-
import dev.lbeernaert.youhavemail.AccountsUpdated
9+
import dev.lbeernaert.youhavemail.AccountWatcher
1410
import dev.lbeernaert.youhavemail.Backend
1511
import dev.lbeernaert.youhavemail.Event
1612
import dev.lbeernaert.youhavemail.Proxy
@@ -45,7 +41,7 @@ const val STATE_LOG_TAG = "state"
4541
// changes.
4642
var NOTIFICATION_STATE = NotificationState()
4743

48-
class State(context: Context) : AccountsUpdated {
44+
class State(context: Context) : AccountWatcher {
4945
private var mPollInterval = MutableStateFlow(15UL)
5046
private var mYhm: Yhm
5147
private var mAccounts: MutableStateFlow<List<Account>>
@@ -57,7 +53,7 @@ class State(context: Context) : AccountsUpdated {
5753
val key = getOrCreateEncryptionKey(context)
5854
val dbPath = getDatabasePath(context)
5955
mYhm = Yhm(dbPath, encryptionKey = key)
60-
mWatchHandle = mYhm.addAccountObserver(this)
56+
mWatchHandle = mYhm.watchAccounts(this)
6157
mAccounts = MutableStateFlow(mYhm.accounts())
6258
val pollInterval = mYhm.pollInterval()
6359
mPollInterval.value = pollInterval
@@ -161,7 +157,7 @@ class State(context: Context) : AccountsUpdated {
161157
/**
162158
* Unregister receiver and release resource.
163159
*/
164-
fun close(context: Context) {
160+
fun close() {
165161
Log.i(STATE_LOG_TAG, "Closing")
166162
mAccounts.value = ArrayList()
167163
mLoginSequence = null

0 commit comments

Comments
 (0)