File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
app/src/main/java/org/mozilla/reference/browser Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import android.os.Build.VERSION.SDK_INT
1515import androidx.annotation.RequiresApi
1616import androidx.core.app.NotificationCompat
1717import androidx.core.app.NotificationManagerCompat
18+ import androidx.core.content.edit
1819import androidx.core.net.toUri
1920import androidx.preference.PreferenceManager
2021import mozilla.components.concept.sync.Device
@@ -151,10 +152,10 @@ object NotificationManager {
151152 NotificationManagerCompat .from(context)
152153 .notify(DATA_REPORTING_TAG , DATA_REPORTING_NOTIFICATION_ID , notificationBuilder.build())
153154
154- preferences.edit()
155- . putLong(PREFS_POLICY_NOTIFIED_TIME , System .currentTimeMillis())
156- . putInt(PREFS_POLICY_VERSION , DATA_REPORTING_VERSION )
157- . apply ()
155+ preferences.edit {
156+ putLong(PREFS_POLICY_NOTIFIED_TIME , System .currentTimeMillis())
157+ putInt(PREFS_POLICY_VERSION , DATA_REPORTING_VERSION )
158+ }
158159 }
159160
160161 private fun getNotificationChannelId (
Original file line number Diff line number Diff line change 55package org.mozilla.reference.browser.settings
66
77import android.content.Context
8+ import androidx.core.content.edit
89import androidx.preference.PreferenceManager
910import org.mozilla.reference.browser.R
1011
@@ -29,18 +30,16 @@ object Settings {
2930
3031 fun setOverrideAmoUser (context : Context , value : String ) {
3132 val key = context.getString(R .string.pref_key_override_amo_user)
32- PreferenceManager .getDefaultSharedPreferences(context)
33- .edit()
34- .putString(key, value)
35- .apply ()
33+ PreferenceManager .getDefaultSharedPreferences(context).edit {
34+ putString(key, value)
35+ }
3636 }
3737
3838 fun setOverrideAmoCollection (context : Context , value : String ) {
3939 val key = context.getString(R .string.pref_key_override_amo_collection)
40- PreferenceManager .getDefaultSharedPreferences(context)
41- .edit()
42- .putString(key, value)
43- .apply ()
40+ PreferenceManager .getDefaultSharedPreferences(context).edit {
41+ putString(key, value)
42+ }
4443 }
4544
4645 fun isAmoCollectionOverrideConfigured (context : Context ): Boolean {
You can’t perform that action at this time.
0 commit comments